Public report of lance-format/lance, 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, 18:08 UTC · Survey ID cd_48649ab7b4fb418fb11c510e941ffd67

lance-format/lance

Measured 14 November 2026, 18:00 UTC, at code version e105550

CAI score 64out of 100 At risk Up 2 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: 992,209 lines of product code in 35 projects, tests not counted · Estimated rebuild effort: about 10.5 person-years · Weakest lens: Code Health, 56

Findings by how serious they are

66 critical 3971 serious 222 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, 18:00 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 ▸

56of 56 dimensions measured by tools.
4154of 4259 findings point to an exact file and line, so you can open each one in the code. The other 105 concern the repository as a whole, such as missing documentation.
56dimensions across 7 lenses, read from 992,209 lines of product code in 35 projects.
Chapters

Executive summary

lance-format/lance is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 64 out of 100, which the At risk rating leaves unchanged.

Code Health, at 56, is the weakest lens and counts most in the score. The best first step is declaring which values may be missing, worth about 6 points. Writing log messages as searchable templates comes next, worth about 4 points. Raising Code Health to 70 would lift the score to about 69.

Twenty-two pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline. Fifteen pipeline steps install packages that can change without warning, and eleven known security holes in the packages the code depends on can be used by attackers. Passing outside input through environment variables, pinning what the pipeline installs and updating the vulnerable packages would close these risks. Limiting each secret to its own step would fix the two secrets exposed to more of the pipeline than needed, and fixing the weaknesses the scanner points to would deal with the two security weaknesses in the code. The four pages or frames without a title need a descriptive title.

The product code is 992,209 lines, about €1,500,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 56 · counts for 46%Security and Compliance 63 · counts for 25%Production Readiness 72 · counts for 14%Accessibility 76 · counts for 8%Maturity 82 · counts for 4%Architecture 94 · counts for 2%Performance 94 · counts for 1%

If Code Health rose from 56 to 70, the lowest score rated Strong, the score would rise from 64 to about 69.

Code composition: what the lines of code are
Product code 75%Tests 25%
New since the last survey: 1799 findings

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

  • Cyclomatic Complexity · Wand::and_bulk_search (cyclomatic 139) rust/lance-index/src/scalar/inverted/wand/bulk_conjunction.rs
  • Cyclomatic Complexity · Wand::maxscore_search (cyclomatic 128) rust/lance-index/src/scalar/inverted/wand/maxscore.rs
  • Cyclomatic Complexity · TransactionRebase::check_create_index_txn (cyclomatic 62) rust/lance/src/io/commit/conflict_resolver/check/create_index.rs
  • Cyclomatic Complexity · Wand::complete_maxscore_single_essential (cyclomatic 45) rust/lance-index/src/scalar/inverted/wand/maxscore.rs
  • Cyclomatic Complexity · Scanner::vector_search (cyclomatic 43) rust/lance/src/dataset/scanner/vector.rs
  • Cyclomatic Complexity · TransactionRebase::check_update_txn (cyclomatic 42) rust/lance/src/io/commit/conflict_resolver/check.rs
  • Cyclomatic Complexity · lance::index::vector::ivf::v2::partition_search::search_partitions (cyclomatic 42) rust/lance/src/index/vector/ivf/v2/partition_search.rs
  • Cyclomatic Complexity · TransactionRebase::check_rewrite_txn (cyclomatic 41) rust/lance/src/io/commit/conflict_resolver/check/rewrite.rs
  • Cyclomatic Complexity · DefaultCompactionPlanner::plan_groups_with_budget (cyclomatic 39) rust/lance/src/dataset/optimize/planning.rs
  • Cyclomatic Complexity · TransactionRebase::check_data_replacement_txn (cyclomatic 36) rust/lance/src/io/commit/conflict_resolver/check.rs
  • Cyclomatic Complexity · Branches::cleanup_branch_directories (cyclomatic 35) rust/lance/src/dataset/refs.rs
  • Cyclomatic Complexity · lance_index::scalar::zonemap::validate_seed (cyclomatic 35) rust/lance-index/src/scalar/zonemap.rs
  • Cyclomatic Complexity · Scanner::create_plan_impl (cyclomatic 34) rust/lance/src/dataset/scanner/plan.rs
  • Cyclomatic Complexity · lance::dataset::optimize::commit::commit_compaction (cyclomatic 33) rust/lance/src/dataset/optimize/commit.rs
  • Cyclomatic Complexity · pylance::dataset::write::get_write_params (cyclomatic 32) python/src/dataset/write.rs
  • Cyclomatic Complexity · MergeInsertJob::analyze_report (cyclomatic 32) rust/lance/src/dataset/write/merge_insert/job.rs
  • Cyclomatic Complexity · lance::dataset::optimize::execution::rewrite_files (cyclomatic 32) rust/lance/src/dataset/optimize/execution.rs
  • Cyclomatic Complexity · scanner._build_vector_search_query (cyclomatic 32) python/python/lance/_dataset/scanner.py
  • Cyclomatic Complexity · Merger::execute_batch (cyclomatic 31) rust/lance/src/dataset/write/merge_insert/merger.rs
  • Cyclomatic Complexity · TransactionRebase::finish_create_index (cyclomatic 31) rust/lance/src/io/commit/conflict_resolver/finish.rs
  • Cyclomatic Complexity · Scanner::plan_compound_scorer (cyclomatic 30) rust/lance/src/dataset/scanner/fts.rs
  • Cyclomatic Complexity · TransactionRebase::check_txn (cyclomatic 30) rust/lance/src/io/commit/conflict_resolver/check.rs
  • Cyclomatic Complexity · VariableFullZipDecoder::unzip (cyclomatic 29) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs
  • Cyclomatic Complexity · lance_encoding::encodings::logical::primitive::fullzip_decode::structure::read_row (cyclomatic 29) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode/structure.rs
  • Cyclomatic Complexity · DecodeMiniBlockTask::decode (cyclomatic 28) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs
  • Cyclomatic Complexity · Wand::next_and_candidate (cyclomatic 28) rust/lance-index/src/scalar/inverted/wand/conjunction.rs
  • Cyclomatic Complexity · CompoundQueryExec::execute (cyclomatic 27) rust/lance/src/io/exec/fts/compound.rs
  • Cyclomatic Complexity · CompactionOptions::apply_dataset_config (cyclomatic 26) rust/lance/src/dataset/optimize/planning.rs
  • Cyclomatic Complexity · Dataset::merge_existing_index_segments (cyclomatic 26) rust/lance/src/index/lifecycle.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::alp::encode_chunk_f64_rd (cyclomatic 26) rust/lance-encoding/src/encodings/physical/alp.rs
  • Cyclomatic Complexity · ObjectStore::read_local_staging_files (cyclomatic 26) rust/lance-io/src/object_store/local_staging.rs
  • Cyclomatic Complexity · DefaultCompactionPlanner::plan_with_budget (cyclomatic 25) rust/lance/src/dataset/optimize/planning.rs
  • Cyclomatic Complexity · lance::dataset::mem_wal::write::replay::replay_memtable_from_wal (cyclomatic 25) rust/lance/src/dataset/mem_wal/write/replay.rs
  • Cyclomatic Complexity · PostingIterator::merge_optional_freqs (cyclomatic 25) rust/lance-index/src/scalar/inverted/wand/maxscore.rs
  • Cyclomatic Complexity · pylance::scanner::vector_query_params_from_dict (cyclomatic 24) python/src/scanner.rs
  • Cyclomatic Complexity · Scanner::prefilter_source (cyclomatic 24) rust/lance/src/dataset/scanner/vector.rs
  • Cyclomatic Complexity · MergeInsertJob::update_fragments (cyclomatic 24) rust/lance/src/dataset/write/merge_insert/update_fragments.rs
  • Cyclomatic Complexity · TakeOperation::try_from_expr (cyclomatic 23) rust/lance/src/dataset/scanner/source.rs
  • Cyclomatic Complexity · Scanner::validate_options (cyclomatic 23) rust/lance/src/dataset/scanner/plan.rs
  • Cyclomatic Complexity · Dataset::open_vector_index_from_metadata_with_plan (cyclomatic 23) rust/lance/src/index/loading.rs
  • Cyclomatic Complexity · lance_file::versions::v2_3::reader::validate_compressive_encoding (cyclomatic 23) rust/lance-file/src/versions/v2_3/reader.rs
  • Cyclomatic Complexity · BatchRefineExec::refine (cyclomatic 22) rust/lance/src/io/exec/knn/refine.rs
  • Cyclomatic Complexity · lance::io::exec::knn::batch_probe::late_search (cyclomatic 22) rust/lance/src/io/exec/knn/batch_probe.rs
  • Cyclomatic Complexity · RleEncoder::encode_chunk_rolling_slice (cyclomatic 22) rust/lance-encoding/src/encodings/physical/rle.rs
  • Cyclomatic Complexity · Wand::prepare_score_first_and_window (cyclomatic 22) rust/lance-index/src/scalar/inverted/wand/conjunction.rs
  • Cyclomatic Complexity · Scanner::plan_corpus_query (cyclomatic 21) rust/lance/src/dataset/scanner/fts.rs
  • Cyclomatic Complexity · MergeInsertJob::execute_uncommitted_impl (cyclomatic 21) rust/lance/src/dataset/write/merge_insert/job.rs
  • Cyclomatic Complexity · Dataset::commit_existing_index_segments (cyclomatic 21) rust/lance/src/index/lifecycle.rs
  • Cyclomatic Complexity · Dataset::scalar_index_info_with_plugins (cyclomatic 21) rust/lance/src/index/loading.rs
  • Cyclomatic Complexity · IndexDescriptionImpl::try_new (cyclomatic 21) rust/lance/src/index/statistics.rs
  • Cyclomatic Complexity · lance::index::frag_reuse_with_stable_row_ids::history::validate_frag_reuse_history (cyclomatic 21) rust/lance/src/index/frag_reuse_with_stable_row_ids/history.rs
  • Cyclomatic Complexity · lance_datafusion::numeric_coercion::lower_decimal (cyclomatic 21) rust/lance-datafusion/src/numeric_coercion.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock_range (cyclomatic 21) rust/lance-encoding/src/encodings/physical/binary.rs
  • Cyclomatic Complexity · Checker.run (cyclomatic 21) skills/lance-table-maintenance/scripts/conformance.py
  • Cyclomatic Complexity · fsst::fsst::decompress_bulk (cyclomatic 20) rust/compression/fsst/src/fsst.rs
  • Cyclomatic Complexity · CleanupTask::run (cyclomatic 20) rust/lance/src/dataset/cleanup.rs
  • Cyclomatic Complexity · Scanner::plan_phrase_query (cyclomatic 20) rust/lance/src/dataset/scanner/fts.rs
  • Cyclomatic Complexity · Scanner::plan_combined_fields_query (cyclomatic 20) rust/lance/src/dataset/scanner/fts.rs
  • Cyclomatic Complexity · Scanner::new_filtered_read (cyclomatic 20) rust/lance/src/dataset/scanner/source.rs
  • Cyclomatic Complexity · TransactionRebase::finish_rewrite (cyclomatic 20) rust/lance/src/io/commit/conflict_resolver/finish.rs
  • Cyclomatic Complexity · lance::dataset::write::seeds::seed_writers_for (cyclomatic 20) rust/lance/src/dataset/write/seeds.rs
  • Cyclomatic Complexity · LookupKeys::match_page (cyclomatic 20) rust/lance-index/src/scalar/btree.rs
  • Cyclomatic Complexity · JsonFlattener::flatten (cyclomatic 20) rust/lance-index/src/scalar/inverted/tokenizer/document_tokenizer.rs
  • Cyclomatic Complexity · Wand::next (cyclomatic 20) rust/lance-index/src/scalar/inverted/wand/disjunction.rs
  • Cyclomatic Complexity · RowAddrMask::for_each_selected (cyclomatic 20) rust/lance-select/src/mask.rs
  • Cyclomatic Complexity · Scanner::plan_match_query (cyclomatic 19) rust/lance/src/dataset/scanner/fts.rs
  • Cyclomatic Complexity · Updater::update_batches (cyclomatic 19) rust/lance/src/dataset/updater.rs
  • Cyclomatic Complexity · lance::dataset::cleanup::build_cleanup_operation (cyclomatic 19) rust/lance/src/dataset/cleanup.rs
  • Cyclomatic Complexity · lance::index::provenance::fresh_fragments (cyclomatic 19) rust/lance/src/index/provenance.rs
  • Cyclomatic Complexity · lance::index::provenance::prune_stale_segment_coverage (cyclomatic 19) rust/lance/src/index/provenance.rs
  • Cyclomatic Complexity · lance::index::vector::builder::merge_partitions (cyclomatic 19) rust/lance/src/index/vector/builder.rs
  • Cyclomatic Complexity · FixedWidthDataBlock::byte_position_entropy (cyclomatic 19) rust/lance-encoding/src/statistics.rs
  • Cyclomatic Complexity · FullZipScheduler::schedule_list_structure (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode/structure.rs
  • Cyclomatic Complexity · lance_jni::utils::build_compaction_options (cyclomatic 18) java/lance-jni/src/utils.rs
  • Cyclomatic Complexity · MemTableFlushHandler::flush_memtable (cyclomatic 18) rust/lance/src/dataset/mem_wal/write/handlers.rs
  • Cyclomatic Complexity · Scanner::knn_combined (cyclomatic 18) rust/lance/src/dataset/scanner/vector.rs
  • Cyclomatic Complexity · MergeInsertJob::create_indexed_scan_joined_stream (cyclomatic 18) rust/lance/src/dataset/write/merge_insert/job.rs
  • Cyclomatic Complexity · Schema::do_project (cyclomatic 18) rust/lance-core/src/datatypes/schema.rs
  • Cyclomatic Complexity · BinaryMiniBlockDecompressor::decompress_range (cyclomatic 18) rust/lance-encoding/src/encodings/physical/binary.rs
  • Cyclomatic Complexity · lance_encoding::encodings::logical::primitive::dict::dict_encode_variable_width (cyclomatic 18) rust/lance-encoding/src/encodings/logical/primitive/dict.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::alp::transform_chunk_f32_avx2 (cyclomatic 18) rust/lance-encoding/src/encodings/physical/alp.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::alp::transform_chunk_f64_avx2 (cyclomatic 18) rust/lance-encoding/src/encodings/physical/alp.rs
  • Cyclomatic Complexity · KeepFiniteVectors::transform (cyclomatic 18) rust/lance-index/src/vector/transform.rs
  • Cyclomatic Complexity · lance_index::scalar::inverted::combined::maxscore::combined_maxscore (cyclomatic 18) rust/lance-index/src/scalar/inverted/combined/maxscore.rs
  • Cyclomatic Complexity · lance_index::scalar::tuple::planner::plan (cyclomatic 18) rust/lance-index/src/scalar/tuple/planner.rs
  • Cyclomatic Complexity · lance_index::scalar::tuple::planner::key_ranges (cyclomatic 18) rust/lance-index/src/scalar/tuple/planner.rs
  • Cyclomatic Complexity · Transaction::withdraw_coverage (cyclomatic 18) rust/lance-table/src/transaction/index_maintenance.rs
  • Cyclomatic Complexity · LanceDataset.shallow_clone (cyclomatic 18) python/python/lance/dataset.py
  • Cyclomatic Complexity · BlobPreprocessor::preprocess_field (cyclomatic 17) rust/lance/src/dataset/blob/write.rs
  • Cyclomatic Complexity · DatasetDelta::scan_rows (cyclomatic 17) rust/lance/src/dataset/delta.rs
  • Cyclomatic Complexity · Scanner::fts_document_granularity (cyclomatic 17) rust/lance/src/dataset/scanner/fts.rs
  • Cyclomatic Complexity · Scanner::calculate_final_projection (cyclomatic 17) rust/lance/src/dataset/scanner/plan.rs
  • Cyclomatic Complexity · Scanner::scalar_indexed_scan (cyclomatic 17) rust/lance/src/dataset/scanner/source.rs
  • Cyclomatic Complexity · MergeInsertJob::can_use_create_plan (cyclomatic 17) rust/lance/src/dataset/write/merge_insert/job.rs
  • Cyclomatic Complexity · MergeInsertJob::update_fragments::handle_fragment (cyclomatic 17) rust/lance/src/dataset/write/merge_insert/update_fragments.rs
  • Cyclomatic Complexity · TransactionRebase::check_delete_txn (cyclomatic 17) rust/lance/src/io/commit/conflict_resolver/check.rs
  • Cyclomatic Complexity · TransactionRebase::check_data_overlay_txn (cyclomatic 17) rust/lance/src/io/commit/conflict_resolver/check.rs
  • Cyclomatic Complexity · FilteredReadExec::statistics_from_inputs (cyclomatic 17) rust/lance/src/io/exec/filtered_read.rs
  • Cyclomatic Complexity · lance::dataset::optimize::execution::can_use_binary_copy_current (cyclomatic 17) rust/lance/src/dataset/optimize/execution.rs
  • Cyclomatic Complexity · lance::index::optimize::plan_optimize_indices_or_skip (cyclomatic 17) rust/lance/src/index/optimize.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: 726 findings

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

  • Cyclomatic Complexity · Wand::and_bulk_search (cyclomatic 139) rust/lance-index/src/scalar/inverted/wand.rs
  • Cyclomatic Complexity · Wand::maxscore_search (cyclomatic 128) rust/lance-index/src/scalar/inverted/wand.rs
  • Cyclomatic Complexity · TransactionRebase::check_create_index_txn (cyclomatic 59) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · Wand::complete_maxscore_single_essential (cyclomatic 45) rust/lance-index/src/scalar/inverted/wand_maxscore.rs
  • Cyclomatic Complexity · TransactionRebase::check_update_txn (cyclomatic 42) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · TransactionRebase::check_rewrite_txn (cyclomatic 41) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · lance::dataset::optimize::commit_compaction (cyclomatic 41) rust/lance/src/dataset/optimize.rs
  • Cyclomatic Complexity · MergeInsertJob::update_fragments (cyclomatic 39) rust/lance/src/dataset/write/merge_insert.rs
  • Cyclomatic Complexity · IVFIndex::search_partitions (cyclomatic 37) rust/lance/src/index/vector/ivf/v2.rs
  • Cyclomatic Complexity · Scanner::vector_search (cyclomatic 36) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · TransactionRebase::check_data_replacement_txn (cyclomatic 36) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · Scanner::create_plan_impl (cyclomatic 34) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · pylance::dataset::get_write_params (cyclomatic 32) python/src/dataset.rs
  • Cyclomatic Complexity · Scanner::plan_compound_scorer (cyclomatic 30) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · lance::dataset::optimize::rewrite_files (cyclomatic 30) rust/lance/src/dataset/optimize.rs
  • Cyclomatic Complexity · DefaultCompactionPlanner::plan (cyclomatic 29) rust/lance/src/dataset/optimize.rs
  • Cyclomatic Complexity · Merger::execute_batch (cyclomatic 29) rust/lance/src/dataset/write/merge_insert.rs
  • Cyclomatic Complexity · TransactionRebase::check_txn (cyclomatic 29) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · Wand::next_and_candidate (cyclomatic 28) rust/lance-index/src/scalar/inverted/wand.rs
  • Cyclomatic Complexity · dataset._build_vector_search_query (cyclomatic 28) python/python/lance/dataset.py
  • Cyclomatic Complexity · Dataset::merge_existing_index_segments (cyclomatic 26) rust/lance/src/index.rs
  • Cyclomatic Complexity · lance::dataset::mem_wal::write::replay_memtable_from_wal (cyclomatic 25) rust/lance/src/dataset/mem_wal/write.rs
  • Cyclomatic Complexity · PostingIterator::merge_optional_freqs (cyclomatic 25) rust/lance-index/src/scalar/inverted/wand_maxscore.rs
  • Cyclomatic Complexity · types._coerce_reader (cyclomatic 25) python/python/lance/types.py
  • Cyclomatic Complexity · CompactionOptions::apply_dataset_config (cyclomatic 24) rust/lance/src/dataset/optimize.rs
  • Cyclomatic Complexity · CompoundQueryExec::execute (cyclomatic 24) rust/lance/src/io/exec/fts.rs
  • Cyclomatic Complexity · TakeOperation::try_from_expr (cyclomatic 23) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Dataset::commit_existing_index_segments (cyclomatic 22) rust/lance/src/index.rs
  • Cyclomatic Complexity · Dataset::open_vector_index_from_metadata_with_plan (cyclomatic 22) rust/lance/src/index.rs
  • Cyclomatic Complexity · IvfIndexBuilder::merge_partitions (cyclomatic 22) rust/lance/src/index/vector/builder.rs
  • Cyclomatic Complexity · Wand::prepare_score_first_and_window (cyclomatic 22) rust/lance-index/src/scalar/inverted/wand.rs
  • Cyclomatic Complexity · pylance::dataset::vector_query_params_from_dict (cyclomatic 21) python/src/dataset.rs
  • Cyclomatic Complexity · FileFragment::update_columns_with_offsets (cyclomatic 21) rust/lance/src/dataset/fragment.rs
  • Cyclomatic Complexity · TransactionRebase::finish_create_index (cyclomatic 21) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · lance_encoding::encodings::logical::primitive::dict::dictionary_encode (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/dict.rs
  • Cyclomatic Complexity · Scanner::validate_options (cyclomatic 20) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · TransactionRebase::finish_rewrite (cyclomatic 20) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · lance::index::append::try_harvest_seeds (cyclomatic 20) rust/lance/src/index/append.rs
  • Cyclomatic Complexity · Wand::next (cyclomatic 20) rust/lance-index/src/scalar/inverted/wand.rs
  • Cyclomatic Complexity · Scanner::plan_phrase_query (cyclomatic 19) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Scanner::plan_restricted_match_query (cyclomatic 19) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · MergeInsertJob::execute_uncommitted_impl (cyclomatic 19) rust/lance/src/dataset/write/merge_insert.rs
  • Cyclomatic Complexity · MemTableFlushHandler::flush_memtable (cyclomatic 18) rust/lance/src/dataset/mem_wal/write.rs
  • Cyclomatic Complexity · Scanner::plan_match_query (cyclomatic 18) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Scanner::plan_combined_fields_query (cyclomatic 18) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Scanner::nearest (cyclomatic 17) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Scanner::calculate_final_projection (cyclomatic 17) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Scanner::fts_document_granularity (cyclomatic 17) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Scanner::scalar_indexed_scan (cyclomatic 17) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · MergeInsertJob::can_use_create_plan (cyclomatic 17) rust/lance/src/dataset/write/merge_insert.rs
  • Cyclomatic Complexity · TransactionRebase::check_delete_txn (cyclomatic 17) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · TransactionRebase::check_data_overlay_txn (cyclomatic 17) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · FilteredReadExec::partition_statistics (cyclomatic 17) rust/lance/src/io/exec/filtered_read.rs
  • Cyclomatic Complexity · lance::dataset::optimize::can_use_binary_copy_current (cyclomatic 17) rust/lance/src/dataset/optimize.rs
  • Cyclomatic Complexity · lance::index::fresh_fragments (cyclomatic 17) rust/lance/src/index.rs
  • Cyclomatic Complexity · lance::index::build_index_metadata_from_segments (cyclomatic 17) rust/lance/src/index.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock (cyclomatic 17) rust/lance-encoding/src/encodings/physical/binary.rs
  • Cyclomatic Complexity · FlatIndex::search_with_scratch (cyclomatic 17) rust/lance-index/src/vector/flat/index.rs
  • Cyclomatic Complexity · lance_index::scalar::inverted::wand::exclusive_partial_score_limit (cyclomatic 17) rust/lance-index/src/scalar/inverted/wand.rs
  • Cyclomatic Complexity · Scanner::create_filter_plan (cyclomatic 16) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · Scanner::plan_fts (cyclomatic 16) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · IndexDescriptionImpl::try_new (cyclomatic 16) rust/lance/src/index.rs
  • Cyclomatic Complexity · lance::dataset::scanner::collect_fts_columns_in_order::visit (cyclomatic 16) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · HNSW::flat_search (cyclomatic 16) rust/lance-index/src/vector/hnsw/builder.rs
  • Cyclomatic Complexity · Transaction::withdraw_rewritten_coverage (cyclomatic 16) rust/lance-table/src/transaction/index_maintenance.rs
  • Cognitive Complexity · Wand::maxscore_search (cognitive 513) rust/lance-index/src/scalar/inverted/wand.rs
  • Cognitive Complexity · Wand::and_bulk_search (cognitive 193) rust/lance-index/src/scalar/inverted/wand.rs
  • Cognitive Complexity · TransactionRebase::check_create_index_txn (cognitive 129) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · TransactionRebase::check_rewrite_txn (cognitive 119) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · TransactionRebase::check_update_txn (cognitive 105) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · Wand::complete_maxscore_single_essential (cognitive 103) rust/lance-index/src/scalar/inverted/wand_maxscore.rs
  • Cognitive Complexity · TransactionRebase::check_data_replacement_txn (cognitive 95) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · Scanner::vector_search (cognitive 90) rust/lance/src/dataset/scanner.rs
  • Cognitive Complexity · IVFIndex::search_partitions (cognitive 74) rust/lance/src/index/vector/ivf/v2.rs
  • Cognitive Complexity · lance::dataset::mem_wal::write::replay_memtable_from_wal (cognitive 73) rust/lance/src/dataset/mem_wal/write.rs
  • Cognitive Complexity · Merger::execute_batch (cognitive 71) rust/lance/src/dataset/write/merge_insert.rs
  • Cognitive Complexity · lance::dataset::optimize::commit_compaction (cognitive 69) rust/lance/src/dataset/optimize.rs
  • Cognitive Complexity · Wand::next_and_candidate (cognitive 65) rust/lance-index/src/scalar/inverted/wand.rs
  • Cognitive Complexity · pylance::dataset::get_write_params (cognitive 61) python/src/dataset.rs
  • Cognitive Complexity · lance_encoding::encodings::logical::primitive::dict::dictionary_encode (cognitive 51) rust/lance-encoding/src/encodings/logical/primitive/dict.rs
  • Cognitive Complexity · TransactionRebase::finish_create_index (cognitive 50) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · IvfIndexBuilder::merge_partitions (cognitive 49) rust/lance/src/index/vector/builder.rs
  • Cognitive Complexity · TransactionRebase::finish_rewrite (cognitive 47) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · lance::dataset::optimize::rewrite_files (cognitive 45) rust/lance/src/dataset/optimize.rs
  • Cognitive Complexity · PostingIterator::merge_optional_freqs (cognitive 45) rust/lance-index/src/scalar/inverted/wand_maxscore.rs
  • Cognitive Complexity · MergeInsertJob::update_fragments (cognitive 42) rust/lance/src/dataset/write/merge_insert.rs
  • Cognitive Complexity · Wand::next (cognitive 41) rust/lance-index/src/scalar/inverted/wand.rs
  • Cognitive Complexity · MergeInsertJob::execute_uncommitted_impl (cognitive 40) rust/lance/src/dataset/write/merge_insert.rs
  • Cognitive Complexity · DefaultCompactionPlanner::plan (cognitive 39) rust/lance/src/dataset/optimize.rs
  • Cognitive Complexity · TransactionRebase::finish_delete_update (cognitive 39) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · lance::index::fresh_fragments (cognitive 39) rust/lance/src/index.rs
  • Cognitive Complexity · TakeOperation::try_from_expr (cognitive 38) rust/lance/src/dataset/scanner.rs
  • Cognitive Complexity · FileFragment::update_columns_with_offsets (cognitive 37) rust/lance/src/dataset/fragment.rs
  • Cognitive Complexity · Scanner::create_plan_impl (cognitive 37) rust/lance/src/dataset/scanner.rs
  • Cognitive Complexity · Scanner::plan_compound_scorer (cognitive 37) rust/lance/src/dataset/scanner.rs
  • Cognitive Complexity · TransactionRebase::check_delete_txn (cognitive 37) rust/lance/src/io/commit/conflict_resolver.rs
  • Cognitive Complexity · CompoundQueryExec::execute (cognitive 37) rust/lance/src/io/exec/fts.rs
  • Cognitive Complexity · FilteredReadExec::partition_statistics (cognitive 34) rust/lance/src/io/exec/filtered_read.rs
  • Cognitive Complexity · ZoneTrainer::train (cognitive 34) rust/lance-index/src/scalar/zoned.rs
  • Cognitive Complexity · pylance::dataset::vector_query_params_from_dict (cognitive 33) python/src/dataset.rs
Rebuild cost: about €1,500,000 · Estimate
Cost to rebuild€510,000 to €2,500,000, for 8,422 to 26,720 hours of work, about 10.5 person-years for 6 to 20 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.9 at a score of 64. 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: 992,209 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
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced.
Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
Raises the score by about 6 points · Medium effort · Nullable reference types
2
Interpolated log message defeats structured logging
Raises the score by about 4 points · Medium effort · Structured logging
3
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
Raises the score by about 3 points · Medium effort · Web-Security Posture

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 €1,500,000 to build again, about 10.5 person-years of work. Its weakest lens is Code Health, at 56 (Adequate). 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
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 1,227,102 lines over the last 90 days, which is about 4,976,580 lines a year. At that pace, the extra work comes to an estimated 385 to 2310.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch lance lance lance-arrow lance-arrow lance->lance-arrow lance-core (Cargo) lance-core (Cargo) lance->lance-core (Cargo) lance-datafusion lance-datafusion lance->lance-datafusion lance-encoding lance-encoding lance->lance-encoding lance-file lance-file lance->lance-file lance-geo lance-geo lance->lance-geo lance-index lance-index lance->lance-index lance-io lance-io lance->lance-io lance-linalg lance-linalg lance->lance-linalg lance-namespace lance-namespace lance->lance-namespace lance-select lance-select lance->lance-select lance-table lance-table lance->lance-table lance-jsonb lance-jsonb lance-arrow->lance-jsonb lance-core (Cargo)->lance-arrow lance-datafusion->lance-arrow lance-datafusion->lance-core (Cargo) lance-datafusion-exec lance-datafusion-exec lance-datafusion->lance-datafusion-exec lance-datafusion->lance-jsonb lance-datafusion-exec->lance-arrow lance-datafusion-exec->lance-core (Cargo) lance-datafusion-exec->lance-jsonb lance-encoding->lance-arrow lance-encoding->lance-core (Cargo) lance-file->lance-arrow lance-file->lance-core (Cargo) lance-file->lance-encoding lance-file->lance-io lance-geo->lance-arrow lance-geo->lance-core (Cargo) lance-geo->lance-datafusion-exec lance-geo->lance-index lance-index-core lance-index-core lance-geo->lance-index-core lance-geo->lance-io lance-geo->lance-select lance-index->lance-arrow lance-index->lance-core (Cargo) lance-index->lance-datafusion lance-index->lance-datafusion-exec lance-index->lance-encoding lance-index->lance-file lance-index->lance-index-core lance-index->lance-io lance-index->lance-jsonb lance-index->lance-linalg lance-index->lance-select lance-index->lance-table lance-index-core->lance-core (Cargo) lance-index-core->lance-io lance-index-core->lance-select lance-io->lance-core (Cargo) lance-io->lance-namespace lance-jni lance-jni lance-jni->lance lance-jni->lance-core (Cargo) lance-jni->lance-datafusion lance-jni->lance-encoding lance-jni->lance-file lance-jni->lance-index lance-jni->lance-io lance-jni->lance-linalg lance-jni->lance-namespace lance-namespace-impls lance-namespace-impls lance-jni->lance-namespace-impls lance-jni->lance-table lance-linalg->lance-arrow lance-linalg->lance-core (Cargo) lance-namespace->lance-core (Cargo) lance-namespace-impls->lance lance-namespace-impls->lance-core (Cargo) lance-namespace-impls->lance-index lance-namespace-impls->lance-io lance-namespace-impls->lance-linalg lance-namespace-impls->lance-namespace lance-namespace-impls->lance-table lance-select->lance-core (Cargo) lance-table->lance-arrow lance-table->lance-core (Cargo) lance-table->lance-file lance-table->lance-io lance-table->lance-select lance-tools lance-tools lance-tools->lance lance-tools->lance-core (Cargo) lance-tools->lance-file lance-tools->lance-io lance-tools->lance-table pylance pylance pylance->lance pylance->lance-arrow pylance->lance-core (Cargo) pylance->lance-datafusion pylance->lance-encoding pylance->lance-file pylance->lance-index pylance->lance-io pylance->lance-linalg pylance->lance-namespace pylance->lance-namespace-impls pylance->lance-table __more__ +13 more projects

Architecture: which parts of the code depend on which

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

1043 modules, with 3290 dependencies between them. 24 loops run through 156 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1003 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 lance_core.cache.key2 lance_core.deepsize3 lance_encoding.buffer4 lance_jsonb.jsonpath.path5 lance_linalg.distance6 lance_core.cache7 lance_core.datatypes.schema8 lance_core.error9 lance_core.utils.row_addr_remap10 lance_index_core11 lance_select.mask12 lance_core.datatypes.field13 lance_encoding.data14 lance_file.version15 lance_index.scalar.inverted.tokenizer16 lance_index_core.scalar17 lance_io.object_store18 lance_encoding.encoder19 lance_file.versions.v1.writer20 lance_index.scalar.inverted.query21 lance_index_core.remapping22 lance_io.scheduler23 lance_table.format.fragment24 lance_table.format.index25 lance.io.exec.utils26 lance_encoding.decoder27 lance_table.format.manifest28 lance_file.reader29 lance_table.format.transaction30 lance_index.vector.storage31 lance.session32 lance_index.vector.quantizer33 lance.dataset.write34 lance_index.vector35 lance.dataset.scanner36 lance.index.vector.ivf.v237 lance.dataset.fragment38 lance.dataset39 lance.dataset.write.merge_insert40 lance.index.vector.ivf
1 lance_core.cache.key
2 lance_core.deepsize
3 lance_encoding.buffer
4 lance_jsonb.jsonpath.path
5 lance_linalg.distance
6 lance_core.cache133
7 lance_core.datatypes.schema7
8 lance_core.error1
9 lance_core.utils.row_addr_remap18
10 lance_index_core1
11 lance_select.mask2
12 lance_core.datatypes.field1
13 lance_encoding.data112
14 lance_file.version41
15 lance_index.scalar.inverted.tokenizer1
16 lance_index_core.scalar2121321
17 lance_io.object_store2422
18 lance_encoding.encoder33223
19 lance_file.versions.v1.writer1311
20 lance_index.scalar.inverted.query2
21 lance_index_core.remapping1221
22 lance_io.scheduler222
23 lance_table.format.fragment2122
24 lance_table.format.index411
25 lance.io.exec.utils412131
26 lance_encoding.decoder642111
27 lance_table.format.manifest2111111
28 lance_file.reader242610115213
29 lance_table.format.transaction11111112
30 lance_index.vector.storage631111211
31 lance.session222
32 lance_index.vector.quantizer54111
33 lance.dataset.write5223731212
34 lance_index.vector1211111
35 lance.dataset.scanner1152114221143
36 lance.index.vector.ivf.v24922911241561536
37 lance.dataset.fragment41281111451112
38 lance.dataset244327233221
39 lance.dataset.write.merge_insert151131336
40 lance.index.vector.ivf2212311111312223
Uses a module listed above itPart of a loopThe module itself
1 lance_core.cache.key2 lance_core.deepsize3 lance_encoding.buffer4 lance_jsonb.jsonpath.path5 lance_linalg.distance6 lance_core.cache7 lance_core.datatypes.schema8 lance_core.error9 lance_core.utils.row_addr_remap10 lance_index_core11 lance_select.mask12 lance_core.datatypes.field13 lance_encoding.data14 lance_file.version15 lance_index.scalar.inverted.tokenizer16 lance_index_core.scalar17 lance_io.object_store18 lance_encoding.encoder19 lance_file.versions.v1.writer20 lance_index.scalar.inverted.query21 lance_index_core.remapping22 lance_io.scheduler23 lance_table.format.fragment24 lance_table.format.index25 lance.io.exec.utils26 lance_encoding.decoder27 lance_table.format.manifest28 lance_file.reader29 lance_table.format.transaction30 lance_index.vector.storage31 lance.session32 lance_index.vector.quantizer33 lance.dataset.write34 lance_index.vector35 lance.dataset.scanner36 lance.index.vector.ivf.v237 lance.dataset.fragment38 lance.dataset39 lance.dataset.write.merge_insert40 lance.index.vector.ivflance_core.cache.key1lance_core.deepsize2lance_encoding.buffer3lance_jsonb.jsonpath.path4lance_linalg.distance5lance_core.cache6lance_core.datatypes.schema7lance_core.error8lance_core.utils.row_addr_remap9lance_index_core10lance_select.mask11lance_core.datatypes.field12lance_encoding.data13lance_file.version14lance_index.scalar.inverted.tokenizer15lance_index_core.scalar16lance_io.object_store17lance_encoding.encoder18lance_file.versions.v1.writer19lance_index.scalar.inverted.query20lance_index_core.remapping21lance_io.scheduler22lance_table.format.fragment23lance_table.format.index24lance.io.exec.utils25lance_encoding.decoder26lance_table.format.manifest27lance_file.reader28lance_table.format.transaction29lance_index.vector.storage30lance.session31lance_index.vector.quantizer32lance.dataset.write33lance_index.vector34lance.dataset.scanner35lance.index.vector.ivf.v236lance.dataset.fragment37lance.dataset38lance.dataset.write.merge_insert39lance.index.vector.ivf40133711812111241121213212422332231311212212222122411412131642111211111124261011521311111112631111211222541115223731212121111111521142211434922911241561536412811114511122443272332211511313362212311111312223+1003 more modules (most-connected shown)

At a glance — Code Health · 56% · Adequate · gated by D2, X5 ·

At a glance — Architecture · 94% · Exemplary ·

At a glance — Maturity · 82% · Strong ·

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

At a glance — Security · 63% · Adequate · gated by D29 ·

At a glance — Accessibility · 76% · Strong ·

At a glance — Performance · 94% · 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 Failures69High / Critical
A05:2025 — Injection56High / Critical
A02:2025 — Security Misconfiguration4Medium
A07:2025 — Authentication Failures2High / Critical

Roadmap

Top priorities: Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor); Interpolated log message defeats structured logging; Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.

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

Do thisHelpsEffortDimension
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).+6.2 ptsMediumNullable reference types
Interpolated log message defeats structured logging+3.8 ptsMediumStructured logging
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.+3.2 ptsMediumWeb-Security Posture
Bring the 11 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Operation::eq (cyclomatic 241), lance_datafusion_exec::expr::safe_coerce_scalar (cyclomatic 211), Transaction::build_manifest_prepared (cyclomatic 200).+1.7 ptsHighCyclomatic Complexity
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED.+0.7 ptsLowSecrets (history)
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED.+0.7 ptsLowStatic Analysis (SAST)
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED.+0.7 ptsLowDependency Vulnerabilities
Resolve the 9 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (7), REDACTED (2).+0.7 ptsLowDependency Vulnerabilities

File quality

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

FileScoreBandWorst signal
REDACTED1.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.4SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedDependency Vulnerabilities: Medium advisory (unsound): REDACTED
REDACTED4.5MixedDependency Vulnerabilities: Medium advisory (unsound): REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.7MixedDependency Vulnerabilities: Medium advisory (unsound): REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
rust/lance/src/index/vector/ivf/v2.rs5.5MixedCognitive Complexity: lance::index::vector::ivf::v2::prewarm_partition_window (cognitive 23)
rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs5.5MixedGod Classes: FileTooLong: scanner/builder.rs
rust/lance-linalg/src/distance/dot.rs5.5MixedGod Classes: FileTooLong: distance/dot.rs
python/python/lance/indices/__init__.py5.5MixedChange Coupling: Boundary-crossing change coupling: __init__.py ↔ index.rs
java/lance-jni/src/blocking_scanner.rs5.5MixedCyclomatic Complexity: lance_jni::blocking_scanner::build_scanner_with_options (cyclomatic 34)

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

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

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

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 56 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 — 56 dimensions across the health lenses
D1D2D3D4D5D6D12D13D14D15D16D17D19D20D26D28D29D30D31D34D35D36D43D44AC2AC3AC5AC6AX10AX3AX4AX8AX9M1M2M3M4P1P10P2P3P4P6P7PF1PF3S1X1X15X21X27X28X29X30X4X5

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, 4154 of 4259 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 · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1db38-2ed4-791d-b760-4d1e2b393f17.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a coverage step in CI (`codecov/codecov-action`) shows coverage is measured in your own CI.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py, .rs, .java) and this repository declares a Cargo test suite (repository root, 839 test files), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Currency was graded against Maven Central, but whether an artifact is DEPRECATED is not: Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether one is UNMAINTAINED is not graded either — no registry publishes a maintenance status, and release age does not stand in for one. Two of this dimension's four signals are therefore unread on a Maven tree, and its score reflects currency alone.
  • 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 Python REDACTED/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Python 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 Maven POM, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Maven 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.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated 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 — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • 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 REDACTED (REDACTED). the image ran but published no HTTP port — nothing to crawl (EXPOSE the web port to unlock runtime evidence).
  • 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 Java, Python, Rust, c 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, c 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.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 14 further occurrence(s) are not listed individually; the score already reflects all 54.
  • 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.
  • X19 Unrestored process-global state — 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.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — 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: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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.
  • 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.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • 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 REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • 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 Complexity5.1 / 10Adequate✓ 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 5.1 / 10 · rule-coverage 100% · ceiling Prevented

331 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Operation::eq at 241. A further 38 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 lance_arrow_scalar::serde::data_type_to_format_string at 46 — they are counted neither in the figure above nor in this dimension's score. 15 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/lance-datagen/src/generator.rs (lance_datagen::generator::array::rand_type at 38), rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs (lance_bitpacking::bitpacker_internal::bitpacker4x::neon::right_shift_32 at 34), rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs (lance_bitpacking::bitpacker_internal::bitpacker8x::neon::right_shift_32 at 34), java/lance-jni/src/schema.rs (lance_jni::schema::convert_arrow_type at 33), rust/lance-file/src/versions/v1/writer/statistics.rs (StatisticsBuilder::append at 31), and 10 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.

lance::index::append::merge_indices_with_unindexed_frags (cyclomatic 46) · ×56rust/lance/src/index/append.rs:1696
Scanner::vector_search (cyclomatic 43) · ×17rust/lance/src/dataset/scanner/vector.rs:145
lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cyclomatic 127) · ×15rust/lance-index/src/vector/distributed/index_merger.rs:868
lance_encoding::encodings::physical::axis_delta::x86_64::transform_width (cyclomatic 34) · ×14rust/lance-encoding/src/encodings/physical/axis_delta/x86_64.rs:90
Dataset::scanner (cyclomatic 72) · ×12python/src/dataset.rs:943

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

What to do

  1. Bring the 11 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Operation::eq (cyclomatic 241), lance_datafusion_exec::expr::safe_coerce_scalar (cyclomatic 211), Transaction::build_manifest_prepared (cyclomatic 200). — 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 11 together lifts Cyclomatic Complexity from 5.1 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity4.0 / 10Weak✓ Tool-verified

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

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

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

659 method(s) exceeded the cognitive complexity threshold of 15; the worst was Wand::maxscore_search at 513.

lance::dataset::optimize::binary_copy::rewrite_files_binary_copy (cognitive 108) · ×117rust/lance/src/dataset/optimize/binary_copy.rs:135
lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cognitive 308) · ×48rust/lance-index/src/vector/distributed/index_merger.rs:868
lance_encoding::encodings::physical::alp::encode_chunk_f64_rd (cognitive 55) · ×30rust/lance-encoding/src/encodings/physical/alp.rs:1644
Scanner::vector_search (cognitive 106) · ×23rust/lance/src/dataset/scanner/vector.rs:145
lance_table::transaction::row_version::resolve_update_version_metadata (cognitive 43) · ×19rust/lance-table/src/transaction/row_version.rs:91

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

What to do

  1. Bring the 3 bodies over 240 down to 240 or less in Cognitive Complexity — start with Wand::maxscore_search (cognitive 513), Transaction::build_manifest_prepared (cognitive 377), lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cognitive 308). — 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 3 together lifts Cognitive Complexity from 4.0 to about 4.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.5 / 10Strong✓ Tool-verified

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

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

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

622 god class(es) detected.

FileTooLong: vector/ivf.rs · ×229rust/lance/src/index/vector/ivf.rs
MethodTooLong: Transaction.build_manifest_prepared · ×157rust/lance-table/src/transaction/manifest_build.rs:747
FunctionTooLong: lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner · ×97rust/lance-index/src/vector/distributed/index_merger.rs:868
ClassTooLong: Dataset · ×81python/src/dataset.rs:313
TooManyMethods: Dataset · ×52java/src/main/java/org/lance/Dataset.java:91

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

What to do

  1. Resolve the 229 FileTooLong finding(s) in God Classes — start with REDACTED (9), fragment.rs (4), fts.rs (3). — One of this dimension's main actionable groups (229 warning-level).
  2. Resolve the 157 MethodTooLong finding(s) in God Classes — start with fts.rs (9), dataset.rs (6), REDACTED (6). — One of this dimension's main actionable groups (157 warning-level).
  3. Resolve the 97 FunctionTooLong finding(s) in God Classes — start with ivf.rs (6), transaction.rs (4), commit.rs (4). — One of this dimension's main actionable groups (97 warning-level).

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

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

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

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

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

1083 duplicated block group(s) detected. 4.8 % of the production lines (47,305 of 992,209) are in a reported copy. A further 770 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 3 of the 1853 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 (6 lines × 2) · ×110java/lance-jni/src/namespace.rs:3509
Duplicated block (8 lines × 2) · ×82java/lance-jni/src/blocking_scanner.rs:501
Duplicated block (10 lines × 2) · ×79java/lance-jni/src/mem_wal.rs:780
Edited copy of a member (7 corresponding lines) · ×56python/src/namespace.rs:477
Duplicated block (9 lines × 2) · ×56java/lance-jni/src/otel.rs:161

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

What to do

  1. Resolve the 110 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with namespace.rs (37), REDACTED (4), f32.rs (4). — One of this dimension's main actionable groups (110 warning-level).
  2. Resolve the 82 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with restore.rs (7), otel.rs (3), blob.rs (2). — One of this dimension's main actionable groups (82 warning-level).
  3. Resolve the 79 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with bitpacker4x.rs (4), mem_wal.rs (3), namespace.rs (3). — One of this dimension's main actionable groups (79 warning-level).

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

D5 · Coupling8.2 / 10Strong✓ Tool-verified

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

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

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

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

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

Off the main sequence: fsst · ×6
Unstable project lance-geo

What to do

  1. Resolve the 6 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 1 Unstable project lance-geo finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 11 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.9 / 10 · rule-coverage 100% · ceiling Verified

11 of 1155 classes have LCOM4 above 3.

Low cohesion: Dataset (LCOM4 22) · ×11rust/lance/src/dataset.rs:256

What to do

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

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

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

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

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

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

77 outdated artifact(s) of 86 resolved by the build, graded against Maven Central. Whether any of these is DEPRECATED is not graded — Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Known CVEs in this graph are D30's question, read from the manifest there.

Outdated (test): software.amazon.awssdk:sdk-core · ×43
Outdated (compile): com.fasterxml.jackson.core:jackson-core · ×34

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

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

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

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

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

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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 852 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Python REDACTED/requirements.txt (pip/uv/Poetry) and a Maven POM, 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 Hotspots9.4 / 10Stronggated by 130 serious findings✓ Tool-verified

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

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

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

Top hotspots: rust/lance-table/src/transaction/manifest_build.rs (56×200=11200); python/python/lance/dataset.py (83×79=6557); python/src/dataset.rs (53×72=3816) Repeated repair below the complexity floor: rust/lance/src/io/commit/conflict_resolver.rs (27 of 43 changes were fixes); rust/lance-index/src/scalar/expression.rs (11 of 17 changes were fixes); rust/lance-linalg/src/distance.rs (9 of 14 changes were fixes)

Hotspot: rust/lance-table/src/transaction/manifest_build.rs · ×100rust/lance-table/src/transaction/manifest_build.rs:747
Repeated repair: rust/lance/src/io/commit/conflict_resolver.rs · ×30rust/lance/src/io/commit/conflict_resolver.rs:430

What to do

  1. Resolve the 100 Hotspot finding(s) in Churn × Complexity Hotspots — start with dataset.rs (2), commit.rs (2), planner.rs (2). — One of this dimension's main actionable groups (100 warning-level).
  2. Resolve the 30 Repeated repair finding(s) in Churn × Complexity Hotspots — start with struct.rs (2), conflict_resolver.rs, expression.rs. — One of this dimension's main actionable groups (30 warning-level).

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

D16 · Bus Factor9.4 / 10Exemplary✓ 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 9.4 / 10 · rule-coverage 100% · ceiling Documented

72 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is rust/lance-index/src/vector/bq/ex_dot.rs. Counted over 1127 of the 1363 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 · ×6
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.9 / 10Stronggated by 280 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

280 deducted task-comment markers across 992209 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 · ×273rust/lance-table/src/rowids.rs:15
FixmeComment · ×5rust/lance-file/src/versions/v1/writer/mod.rs:1139
HackComment · ×2rust/lance-datafusion/src/sql.rs:100

What to do

  1. Resolve the 273 TodoComment finding(s) in Explicit Debt — start with vector.rs (8), storage.rs (7), schema.rs (6). — One of this dimension's main actionable groups (273 warning-level).
  2. Resolve the 5 FixmeComment finding(s) in Explicit Debt — start with mod.rs, planner.rs, sbbf.rs. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 2 HackComment finding(s) in Explicit Debt — start with sql.rs, vector.py. — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs foundtest_data/fri_straddle_pre_6610/datagen/src/main.rs:1

What to do

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

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

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

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

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

9 of 35 build units (Cargo, Maven, Python) 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)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

D29 · Static Analysis (SAST)0.0 / 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.0 / 10 · rule-coverage 100% · ceiling Documented

56 finding(s): 0 critical, 44 high, 8 medium, 4 low. semgrep hit a parse error in 24 file(s) — `docs/theme/404.html` (lines 1–3, line 13), `docs/theme/base.html` (lines 1–37, line 50, line 128), `docs/theme/home.html` (lines 1–3, line 147), `docs/theme/main.html` (lines 1–5, line 17, line 19, …), `java/mvnw` (line 86, line 121, line 131, …), … (+19 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 14 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

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

What to do

  1. Resolve the 22 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (22 issue-level).
  2. Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (15 issue-level).
  3. 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).

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

61 finding(s): 2 critical, 9 high, 36 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D31 · IaC & Container Security9.8 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

4 finding(s): 0 critical, 0 high, 1 medium, 3 low.

REDACTED
REDACTED

What to do

  1. Resolve the 3 Low IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 recommendation-level).
  2. Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D34 · Knowledge Freshness9.7 / 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 9.7 / 10 · rule-coverage 100% · ceiling Documented

31 of 1127 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is REDACTED. Counted over 1127 of the 1363 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×31REDACTED:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.7 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: bitmap.rs↔value.rs 93%; fixed_size_list.rs↔value.rs 87%; bitmap.rs↔fixed_size_list.rs 86%

Boundary-crossing change coupling: __init__.py ↔ index.rs · ×2python/python/lance/indices/__init__.py:1
Change coupling: fixed_size_list.rs ↔ value.rs · ×14rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs:1
Change-coupling hub: bitmap.rs → basic.rs, fixed_size_list.rs, encoder.rs, list.rs, value.rs · ×3rust/lance-encoding/src/array_encoding/physical/bitmap.rs

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with __init__.py (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 14 Change coupling finding(s) in Change Coupling — start with binary.rs (4), fixed_size_list.rs, encoder.rs. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with bitmap.rs, basic.rs, write.rs. — One of this dimension's main actionable groups (3 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — 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-Life10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

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

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

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

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

AC3 · Page structure7.8 / 10Strong✓ Tool-verified

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

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

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

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×4) — RUST_THIRD_PARTY_LICENSES.html:1, REDACTED:1, java/RUST_THIRD_PARTY_LICENSES.html:1, …
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×4) — RUST_THIRD_PARTY_LICENSES.html:1, REDACTED:1, java/RUST_THIRD_PARTY_LICENSES.html:1, …

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

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

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

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

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

  • `.ld-search__input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — docs/theme/assets/site.css:706

What to do

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

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

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

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

AX3 · Project dependency 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)9.8 / 10Exemplary✓ Tool-verified

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

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

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 accuracy10.0 / 10Exemplary○ Nothing flagged

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.

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.

  • `8. Run "cargo fmt --all" to ensure formatting is correct.` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:138
  • `- For formatting issues: Run "cargo fmt --all"` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:139
  • `- Run "cargo fmt --all" to ensure formatting is correct` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:143

What to do

  • Add `--check` to the cargo fmt step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
  • Add `--check` to the cargo fmt step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
  • Add `--check` to the cargo fmt step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
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.

  • 1 public type in `lance_core.cache.codec` is marked as implementation by its own namespace, folder or name: `CacheCodecImpl` (rust/lance-core/src/cache/codec.rs:220, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — rust/lance-core/src/cache/codec.rs:220

What to do

  • Hide `lance_core.cache.codec` (`CacheCodecImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports; Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability8.3 / 10Strong✓ Tool-verified

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

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

  • Only 16/21 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `memtest`, `protos/codegen`, `rust/lance-tools`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling8.0 / 10Strong✓ 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.

  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:2

What to do

  • Dependabot is configured but does not watch `github-actions`, `gitsubmodule` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

  • `urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:270
  • `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — python/python/lance/download.py:57, python/python/lance/download.py:86
  • `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — rust/lance-namespace-impls/src/credentials/azure.rs:231, rust/lance-namespace-impls/src/rest/tls.rs:136
  • `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — rust/lance-namespace-impls/src/rest/tls.rs:77

What to do

  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF1 · Benchmark discipline9.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

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

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

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

S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

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

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

  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (rust/lance-namespace-impls/src/rest_adapter.rs:203).
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (rust/lance-namespace-impls/src/rest_adapter.rs:203).

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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.

  • `count` is read from the bytes being parsed at line 1068 (`u32::from_le_bytes`), then used to size a `Vec::with_capacity` at line 1070 — and nowhere in its scope is `count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `count` against the bytes actually remaining and a maximum the format allows before allocating. — rust/lance-index/src/scalar/fmindex.rs:1070
  • `len` is read from the bytes being parsed at line 58 (`u64::from_le_bytes`), then used to size a `vec![…; n]` at line 59 — 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/lance-arrow/src/ipc.rs:59

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 an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. 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 logging5.4 / 10Adequate✓ 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.

  • `warn!` at line 529 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/lance-table/src/system_index/frag_reuse.rs:529
  • `debug!` at line 390 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/lance-table/src/io/commit.rs:390
  • `warn!` at line 392 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/lance-table/src/io/commit.rs:392
  • `warn!` at line 85 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/lance-table/src/io/commit/dynamodb.rs:85
  • `warn!` at line 122 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/lance-io/src/object_store/metrics.rs:122
  • `warn!` at line 1769 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/lance-index/src/scalar/bitmap.rs:1769
  • `warn!` at line 300 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/lance-core/src/memory/observer.rs:300
  • `warn!` at line 128 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/lance-core/src/memory/telemetry.rs:128
  • `warn!` at line 225 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/lance-core/src/memory/telemetry.rs:225
  • `warn!` at line 5310 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/lance/src/dataset.rs:5310
  • `warn!` at line 415 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/lance/src/index/vector/details.rs:415
  • `info!` at line 3059 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/lance/src/dataset/cleanup.rs:3059
  • `warn!` at line 551 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/lance/src/dataset/optimize/planning.rs:551
  • `warn!` at line 224 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/lance/src/dataset/mem_wal/memtable/flush.rs:224
  • `info!` at line 336 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/lance/src/dataset/mem_wal/memtable/flush.rs:336
  • `info!` at line 385 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/lance/src/dataset/mem_wal/memtable/flush.rs:385
  • `info!` at line 617 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/lance/src/dataset/mem_wal/memtable/flush.rs:617
  • `info!` at line 683 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/lance/src/dataset/mem_wal/memtable/flush.rs:683

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.

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

  • 0/22 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

What to do

  • Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).

WCAG coverage — what static analysis assessed

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health56%Adequate — gated by D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture94%ExemplarySolid.
Maturity82%StrongSolid.
Readiness72%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security63%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility76%StrongSolid.
Performance94%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.

  • X10 Duplicated predicate — 40 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.
  • X9 Subsumed condition operand — 1 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 — 57 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. 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 3% of this repository's production lines — rust (924,880 lines), python (33,179 lines), c (855 lines), cpp (376 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 image ran but published no HTTP port — nothing to crawl (EXPOSE the web port to unlock runtime evidence) 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.
  • D10 Test Quality — ~327369 lines of test source are present (.py, .rs, .java) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 2 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .java, .py, .rs source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — Rust suite
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (346 value object(s))
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • 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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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 3% of this repository's production lines — rust (924,880 lines), java (27,272 lines), c (855 lines), cpp (376 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 3% of this repository's production lines — rust (924,880 lines), java (27,272 lines), c (855 lines), cpp (376 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 3% of this repository's production lines — rust (924,880 lines), python (33,179 lines), c (855 lines), cpp (376 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 3% of this repository's production lines — rust (924,880 lines), python (33,179 lines), c (855 lines), cpp (376 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 — X19 reached only 6% of this repository's production lines — rust (924,880 lines), c (855 lines), cpp (376 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X2 Cancellation propagation — no C# was loaded; this repository's Java, Python and Rust were read, and no request in it can be cancelled by a caller — a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter; 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — X23 reached only 6% of this repository's production lines — rust (924,880 lines), c (855 lines), cpp (376 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — X25 reached only 6% of this repository's production lines — rust (924,880 lines), c (855 lines), cpp (376 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 6% of this repository's production lines — rust (924,880 lines), c (855 lines), cpp (376 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.

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 — 66 finding(s)
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
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×4
  • <html> without a lang RUST_THIRD_PARTY_LICENSES.html:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang REDACTED:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang java/RUST_THIRD_PARTY_LICENSES.html:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang python/RUST_THIRD_PARTY_LICENSES.html:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure · Document without a <title> · ×4
  • Document without a <title> RUST_THIRD_PARTY_LICENSES.html:1 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
  • Document without a <title> REDACTED:1 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
  • Document without a <title> java/RUST_THIRD_PARTY_LICENSES.html:1 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
  • Document without a <title> python/RUST_THIRD_PARTY_LICENSES.html:1 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: __init__.py ↔ index.rs python/python/lance/indices/__init__.py:1 — `python/python/lance/indices/__init__.py` (context python) and `rust/lance/src/index.rs` (context rust) sit in DIFFERENT parts of the tree yet 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 — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `f317dd18` feat!: migrate bitmap to index segment based (#6869); `8ada2e9a` refactor!: remove index segment builder (#6997); `8962655c` feat: support segmented inverted index build and search (#6305) — run `git show` on any of them.
  • Boundary-crossing change coupling: __init__.py ↔ dataset.rs python/python/lance/indices/__init__.py:1 — `python/python/lance/indices/__init__.py` (context python) and `rust/lance/src/dataset.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `f317dd18` feat!: migrate bitmap to index segment based (#6869); `57d2aad9` feat: support distributed bitmap index build (#6598); `1ef63109` refactor!: align distributed index build around segments (#6313) — run `git show` on any of them.
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 3971 finding(s)
D17 · Explicit Debt · TodoComment · ×273
  • TodoComment rust/lance-table/src/rowids.rs:15 — // TODO: replace this with Arrow BooleanBuffer. — 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/lance-table/src/rowids.rs:317 — // TODO: add other optimizations, such as combining two RangeWithHoles. — 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/lance-table/src/rowids.rs:832 — // TODO: Could probably optimize the sorted array case to be O(N) instead of O(N log N) — 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/lance-table/src/rowids.rs:981 — // TODO: Optimize this so we don't have to use skip — 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/lance-table/src/rowids.rs:1181 — // TODO: return an iterator. (with a good size hint?) — 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/lance-table/src/transaction/conflicts.rs:23 — // TODO: we can make it so the vecs are always constructed in order. — 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/lance-table/src/transaction/manifest_build.rs:1639 — // TODO(rmeng): check new file and fragment are the same length — 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/lance-table/src/transaction/proto.rs:126 — // TODO: handle metadata — 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/lance-table/src/transaction/proto.rs:203 — // TODO: handle metadata — 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/lance-table/src/transaction/proto.rs:558 — // TODO: handle metadata — 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/lance-table/src/transaction/proto.rs:614 — // TODO: handle metadata — 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/lance-table/src/transaction/row_version.rs:398 — // TODO: write to a separate file if large. Possibly share a file with other fragments. — 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/lance-table/src/transaction/validate.rs:740 — // TODO: add additional validation. Consider consolidating with various — 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/lance-table/src/rowids/segment.rs:393 — // TODO: we could write a more optimal version of this — 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/lance-table/src/rowids/segment.rs:776 — // TODO: can we enforce these assumptions? or make them safer? — 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/lance-table/src/rowids/serde.rs:191 — // TODO: why non-exhaustive? — 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/lance-table/src/rowids/serde.rs:249 — // TODO: shouldn't this enum be non-exhaustive? — 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/lance-table/src/io/commit.rs:932 — // TODO: pub(crate) — 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/lance-table/src/format/fragment.rs:499 — // TODO: pub(crate) — 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/lance-io/src/utils.rs:202 — // TODO: pub(crate) — 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/lance-index/src/vector/pq/utils.rs:56 — // TODO: pub(crate) — 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/lance-file/src/versions/v1/format/metadata.rs:127 — // TODO: pub(crate) — 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/lance-file/src/versions/v1/format/metadata.rs:168 — // TODO: pub(crate) — 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/lance-core/src/datatypes/schema.rs:369 — // TODO: pub(crate) — 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/lance-core/src/datatypes/schema.rs:778 — // TODO: pub(crate) — 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.
  • + 248 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×229
  • FileTooLong: vector/ivf.rs rust/lance/src/index/vector/ivf.rs — FileTooLong — 4570 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 4070 over it, 9.14× 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: index/fts.rs rust/lance/src/dataset/mem_wal/index/fts.rs — FileTooLong — 3490 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 2990 over it, 6.98× 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/dataset.rs python/src/dataset.rs — FileTooLong — 3427 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: Dataset (4 blocks, 313-4506). The bar is 500 significant lines; this is 2927 over it, 6.85× 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: inverted/compound.rs rust/lance-index/src/scalar/inverted/compound.rs — FileTooLong — 2999 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 2499 over it, 6.00× 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: dir/manifest.rs rust/lance-namespace-impls/src/dir/manifest.rs — FileTooLong — 2916 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 78% of them inside a single declaration: ManifestNamespace (4 blocks, 974-4454). The bar is 500 significant lines; this is 2416 over it, 5.83× 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: scalar/btree.rs rust/lance-index/src/scalar/btree.rs — FileTooLong — 2900 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 2400 over it, 5.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/dataset.rs rust/lance/src/dataset.rs — FileTooLong — 2811 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: Dataset (7 blocks, 256-5214). The bar is 500 significant lines; this is 2311 over it, 5.62× 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/namespace.rs java/lance-jni/src/namespace.rs — FileTooLong — 2798 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 132 free functions. The bar is 500 significant lines; this is 2298 over it, 5.60× 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: ivf/v2.rs rust/lance/src/index/vector/ivf/v2.rs — FileTooLong — 2733 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 2233 over it, 5.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: dataset/fragment.rs rust/lance/src/dataset/fragment.rs — FileTooLong — 2687 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 2187 over it, 5.37× 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: exec/filtered_read.rs rust/lance/src/io/exec/filtered_read.rs — FileTooLong — 2667 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 2167 over it, 5.33× 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: vector/builder.rs rust/lance/src/index/vector/builder.rs — FileTooLong — 2416 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 1916 over it, 4.83× 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: lance/dataset.py python/python/lance/dataset.py — FileTooLong — 2376 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1876 over it, 4.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: scalar/zonemap.rs rust/lance-index/src/scalar/zonemap.rs — FileTooLong — 2346 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 1846 over it, 4.69× 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: inverted/builder.rs rust/lance-index/src/scalar/inverted/builder.rs — FileTooLong — 2336 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 1836 over it, 4.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: bq/storage.rs rust/lance-index/src/vector/bq/storage.rs — FileTooLong — 2335 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 1835 over it, 4.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: dataset/cleanup.rs rust/lance/src/dataset/cleanup.rs — FileTooLong — 2239 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: CleanupTask (2 blocks, 428-3017). The bar is 500 significant lines; this is 1739 over it, 4.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/decoder.rs rust/lance-encoding/src/decoder.rs — FileTooLong — 2130 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 1630 over it, 4.26× 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: exec/knn.rs rust/lance/src/io/exec/knn.rs — FileTooLong — 2092 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 1592 over it, 4.18× 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: primitive/structural_encoder.rs rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs — FileTooLong — 2046 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 86% of them inside a single declaration: PrimitiveStructuralEncoder (3 blocks, 207-2979). The bar is 500 significant lines; this is 1546 over it, 4.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: physical/rle.rs rust/lance-encoding/src/encodings/physical/rle.rs — FileTooLong — 2043 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 1543 over it, 4.09× 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/repdef.rs rust/lance-encoding/src/repdef.rs — FileTooLong — 2012 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 1512 over it, 4.02× 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: scanner/fts.rs rust/lance/src/dataset/scanner/fts.rs — FileTooLong — 1989 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: Scanner (410-2892). The bar is 500 significant lines; this is 1489 over it, 3.98× 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/generator.rs rust/lance-datagen/src/generator.rs — FileTooLong — 1964 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 48 free functions. The bar is 500 significant lines; this is 1464 over it, 3.93× 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/transaction.rs java/lance-jni/src/transaction.rs — FileTooLong — 1921 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 32 free functions. The bar is 500 significant lines; this is 1421 over it, 3.84× 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.
  • + 204 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×157
  • MethodTooLong: Transaction.build_manifest_prepared rust/lance-table/src/transaction/manifest_build.rs:747 — MethodTooLong — build_manifest_prepared runs 964 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 864 over it, 9.64× 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: Wand.and_bulk_search rust/lance-index/src/scalar/inverted/wand/bulk_conjunction.rs:34 — MethodTooLong — and_bulk_search runs 592 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 492 over it, 5.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Operation.eq rust/lance-table/src/transaction/conflicts.rs:19 — MethodTooLong — eq runs 578 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 478 over it, 5.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: Wand.maxscore_search rust/lance-index/src/scalar/inverted/wand/maxscore.rs:180 — MethodTooLong — maxscore_search runs 462 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 362 over it, 4.62× 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: MergeInsertJob.update_fragments rust/lance/src/dataset/write/merge_insert/update_fragments.rs:146 — MethodTooLong — update_fragments runs 461 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 361 over it, 4.61× 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: CreateIndexBuilder.execute_uncommitted_impl rust/lance/src/index/create.rs:221 — MethodTooLong — execute_uncommitted_impl runs 394 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 294 over it, 3.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.
  • MethodTooLong: OrderableScalarValue.cmp rust/lance-index/src/scalar/btree.rs:197 — MethodTooLong — cmp runs 350 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Dataset.scanner python/src/dataset.rs:943 — MethodTooLong — scanner runs 336 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 236 over it, 3.36× 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: TransactionRebase.check_create_index_txn rust/lance/src/io/commit/conflict_resolver/check/create_index.rs:7 — MethodTooLong — check_create_index_txn runs 302 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 202 over it, 3.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CompoundQueryExec.execute rust/lance/src/io/exec/fts/compound.rs:1049 — MethodTooLong — execute runs 295 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 195 over it, 2.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: DefaultCompactionPlanner.plan_groups_with_budget rust/lance/src/dataset/optimize/planning.rs:954 — MethodTooLong — plan_groups_with_budget runs 280 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 180 over it, 2.80× 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: Transaction.try_from rust/lance-table/src/transaction/proto.rs:88 — MethodTooLong — try_from runs 277 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Scanner.vector_search rust/lance/src/dataset/scanner/vector.rs:145 — MethodTooLong — vector_search runs 269 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 169 over it, 2.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Dataset.open_vector_index_from_metadata_with_plan rust/lance/src/index/loading.rs:1007 — MethodTooLong — open_vector_index_from_metadata_with_plan runs 264 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 164 over it, 2.64× 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: MergeInsertJob.execute_uncommitted_impl rust/lance/src/dataset/write/merge_insert/job.rs:1458 — MethodTooLong — execute_uncommitted_impl runs 257 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 157 over it, 2.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Wand.complete_maxscore_single_essential rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1278 — MethodTooLong — complete_maxscore_single_essential 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: Planner.parse_sql_expr rust/lance-datafusion/src/planner.rs:840 — MethodTooLong — parse_sql_expr runs 241 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 141 over it, 2.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CleanupTask.delete_unreferenced_files rust/lance/src/dataset/cleanup.rs:1662 — MethodTooLong — delete_unreferenced_files runs 239 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 139 over it, 2.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: PyLance.into_pyobject python/src/transaction.rs:1005 — MethodTooLong — into_pyobject runs 231 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 131 over it, 2.31× 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: MergeInsertJob.create_indexed_scan_joined_stream rust/lance/src/dataset/write/merge_insert/job.rs:219 — MethodTooLong — create_indexed_scan_joined_stream runs 227 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 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PrimitiveStructuralEncoder.encode_dense_page rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2206 — MethodTooLong — encode_dense_page runs 226 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 126 over it, 2.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MergeInsertJob.analyze_report rust/lance/src/dataset/write/merge_insert/job.rs:2038 — MethodTooLong — analyze_report runs 223 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 123 over it, 2.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: CleanupTask.cleanup_file_if_not_referenced rust/lance/src/dataset/cleanup.rs:2278 — MethodTooLong — cleanup_file_if_not_referenced runs 221 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 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Transaction.try_from rust/lance-table/src/transaction/proto.rs:517 — MethodTooLong — try_from runs 209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Dataset.create_index python/src/dataset.rs:2451 — MethodTooLong — create_index runs 202 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 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 132 more in this group — see findings.md.
D2 · Cognitive Complexity · lance · ×117
  • lance::dataset::optimize::binary_copy::rewrite_files_binary_copy (cognitive 108) rust/lance/src/dataset/optimize/binary_copy.rs:135 — lance::dataset::optimize::binary_copy::rewrite_files_binary_copy has cognitive complexity 108 (threshold 15). Drivers by points: if/else 18 (61 pts), loops 11 (45 pts), boolean chains 2 (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::append::merge_indices_with_unindexed_frags (cognitive 98) rust/lance/src/index/append.rs:1696 — lance::index::append::merge_indices_with_unindexed_frags has cognitive complexity 98 (threshold 15). Drivers by points: if/else 31 (68 pts), boolean chains 13, loops 5 (11 pts), match/switch 2 (6 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::write::do_write_fragments_impl (cognitive 91) rust/lance/src/dataset/write.rs:938 — lance::dataset::write::do_write_fragments_impl has cognitive complexity 91 (threshold 15). Drivers by points: if/else 29 (79 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::frag_reuse::build_frag_reuse_rewrite_entry (cognitive 79) rust/lance/src/index/frag_reuse.rs:1720 — lance::index::frag_reuse::build_frag_reuse_rewrite_entry has cognitive complexity 79 (threshold 15). Drivers by points: if/else 26 (56 pts), loops 10 (14 pts), boolean chains 5, match/switch 2 (4 pts) (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.
  • lance::index::vector::ivf::v2::partition_search::search_partitions (cognitive 78) rust/lance/src/index/vector/ivf/v2/partition_search.rs:206 — lance::index::vector::ivf::v2::partition_search::search_partitions has cognitive complexity 78 (threshold 15). Drivers by points: if/else 20 (45 pts), match/switch 5 (14 pts), loops 6 (12 pts), boolean chains 7 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::io::commit::commit_transaction (cognitive 75) rust/lance/src/io/commit.rs:1777 — lance::io::commit::commit_transaction has cognitive complexity 75 (threshold 15). Drivers by points: if/else 26 (52 pts), match/switch 5 (13 pts), boolean chains 6, loops 2 (4 pts) (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.
  • lance::dataset::mem_wal::write::replay::replay_memtable_from_wal (cognitive 73) rust/lance/src/dataset/mem_wal/write/replay.rs:66 — lance::dataset::mem_wal::write::replay::replay_memtable_from_wal has cognitive complexity 73 (threshold 15). Drivers by points: if/else 14 (52 pts), loops 3 (12 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::optimize::commit::commit_compaction (cognitive 56) rust/lance/src/dataset/optimize/commit.rs:130 — lance::dataset::optimize::commit::commit_compaction has cognitive complexity 56 (threshold 15). Drivers by points: if/else 29 (40 pts), boolean chains 7, match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::io::commit::do_commit_new_dataset (cognitive 55) rust/lance/src/io/commit.rs:432 — lance::io::commit::do_commit_new_dataset has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (39 pts), loops 3 (9 pts), match/switch 4 (7 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.
  • lance::index::append::merge_scalar_indices (cognitive 54) rust/lance/src/index/append.rs:921 — lance::index::append::merge_scalar_indices has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 12, loops 2 (5 pts), match/switch 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::index::frag_reuse::compute_tagged_retention (cognitive 51) rust/lance/src/dataset/index/frag_reuse.rs:761 — lance::dataset::index::frag_reuse::compute_tagged_retention has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 10 (17 pts), match/switch 4 (7 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::optimize::execution::rewrite_files (cognitive 49) rust/lance/src/dataset/optimize/execution.rs:495 — lance::dataset::optimize::execution::rewrite_files has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 8, match/switch 4 (6 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::provenance::fresh_fragments (cognitive 48) rust/lance/src/index/provenance.rs:651 — lance::index::provenance::fresh_fragments has cognitive complexity 48 (threshold 15). Drivers by points: loops 8 (17 pts), match/switch 5 (17 pts), if/else 5 (14 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::io::exec::knn::batch_probe::late_search (cognitive 47) rust/lance/src/io/exec/knn/batch_probe.rs:373 — lance::io::exec::knn::batch_probe::late_search has cognitive complexity 47 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 9 (21 pts), boolean chains 5 (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.
  • lance::dataset::schema_evolution::alter_columns (cognitive 45) rust/lance/src/dataset/schema_evolution.rs:1107 — lance::dataset::schema_evolution::alter_columns has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::optimize::consolidate::validate_commit (cognitive 45) rust/lance/src/index/optimize/consolidate.rs:288 — lance::index::optimize::consolidate::validate_commit has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::provenance::prune_stale_segment_coverage (cognitive 45) rust/lance/src/index/provenance.rs:789 — lance::index::provenance::prune_stale_segment_coverage has cognitive complexity 45 (threshold 15). Drivers by points: if/else 6 (26 pts), loops 5 (12 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::vector::builder::merge_partitions (cognitive 45) rust/lance/src/index/vector/builder.rs:1832 — lance::index::vector::builder::merge_partitions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 3 (7 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::vector::ivf::train_weighted_hierarchical_kmeans (cognitive 44) rust/lance/src/index/vector/ivf.rs:5518 — lance::index::vector::ivf::train_weighted_hierarchical_kmeans has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 7 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::io::exec::count_pushdown::try_rewrite (cognitive 44) rust/lance/src/io/exec/count_pushdown.rs:107 — lance::io::exec::count_pushdown::try_rewrite has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (36 pts), match/switch 4, boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::scalar::index_matches_criteria (cognitive 42) rust/lance/src/index/scalar.rs:1122 — lance::index::scalar::index_matches_criteria has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::take::do_take_rows (cognitive 41) rust/lance/src/dataset/take.rs:134 — lance::dataset::take::do_take_rows has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::write::seeds::seed_writers_for (cognitive 41) rust/lance/src/dataset/write/seeds.rs:153 — lance::dataset::write::seeds::seed_writers_for has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 2 (7 pts), boolean chains 2, loops 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.
  • lance::dataset::schema_evolution::add_columns_impl (cognitive 39) rust/lance/src/dataset/schema_evolution.rs:842 — lance::dataset::schema_evolution::add_columns_impl has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::versions::check_manifest_storage_contract (cognitive 38) rust/lance/src/dataset/versions/mod.rs:442 — lance::dataset::versions::check_manifest_storage_contract has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 9, match/switch 3 (8 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 92 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×110
  • Duplicated block (6 lines × 2) java/lance-jni/src/namespace.rs:3509 — java/lance-jni/src/namespace.rs:3509-3514 | java/lance-jni/src/namespace.rs:3638-3643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/namespace.rs:3509` it begins part-way through the construct above it, so those exact lines 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) python/src/dataset/merge_insert.rs:255 — python/src/dataset/merge_insert.rs:255-260 | python/src/dataset/merge_insert.rs:300-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.
  • Duplicated block (6 lines × 2) rust/lance-core/src/levenshtein.rs:18 — rust/lance-core/src/levenshtein.rs:18-23 | rust/lance/src/dataset/mem_wal/index/fts.rs:669-674 — 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/lance-core/src/levenshtein.rs:18` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:863 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:863-868 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:873-878 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:863` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-encoding/src/encodings/physical/alp.rs:823 — rust/lance-encoding/src/encodings/physical/alp.rs:823-828 | rust/lance-encoding/src/encodings/physical/alp.rs:896-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/lance-encoding/src/encodings/physical/alp.rs:823` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:157 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:157-162 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:312-317 — both copies are in the same file, so extract the 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/lance-encoding/src/encodings/physical/alp/restore.rs:156` calls `wrapping_add` and `rust/lance-encoding/src/encodings/physical/alp/restore.rs:311` 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/lance-encoding/src/encodings/physical/alp/restore.rs:176 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:176-181 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:339-344 — both copies are in the same file, so extract the 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/lance-encoding/src/encodings/physical/bitpacking.rs:148 — rust/lance-encoding/src/encodings/physical/bitpacking.rs:148-153 | rust/lance-encoding/src/encodings/physical/bitpacking.rs:176-181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/bitpacking.rs:148` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/statistics.rs:282 — rust/lance-encoding/src/statistics.rs:282-287 | rust/lance-encoding/src/statistics.rs:292-297 — both copies are in the same file, so extract the 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/lance-file/src/concat.rs:426 — rust/lance-file/src/concat.rs:426-432 | rust/lance/src/dataset/blob/external.rs:255-260 — 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/lance-file/src/concat.rs:426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) rust/lance-file/src/reader.rs:1722 — rust/lance-file/src/reader.rs:1722-1727 | rust/lance-file/src/reader.rs:2148-2153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/reader.rs:1722` it does not close everything it opens, so those exact lines 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/lance-file/src/versions/v2_0/writer.rs:662 — rust/lance-file/src/versions/v2_0/writer.rs:662-667 | rust/lance-file/src/writer/structural.rs:290-295 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/versions/v2_0/writer.rs:662` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rust/lance-geo/src/rtree.rs:708 — rust/lance-geo/src/rtree.rs:708-713 | rust/lance-geo/src/rtree.rs:1375-1380 — both copies are in the same file, so extract the 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/lance-geo/src/rtree/sort/hilbert_sort.rs:212 — rust/lance-geo/src/rtree/sort/hilbert_sort.rs:212-217 | rust/lance-geo/src/rtree/sort/hilbert_sort.rs:221-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/lance-index/src/scalar/fmindex.rs:399 — rust/lance-index/src/scalar/fmindex.rs:399-404 | rust/lance-index/src/scalar/fmindex.rs:905-910 — both copies are in the same file, so extract the 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/lance-index/src/scalar/inverted/builder.rs:1881 — rust/lance-index/src/scalar/inverted/builder.rs:1881-1886 | rust/lance-index/src/scalar/inverted/builder.rs:1950-1955 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/builder.rs:1881` it does not close everything it opens, so those exact lines 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/lance-index/src/scalar/inverted/index/inverted_index.rs:392 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:392-397 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:462-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/inverted_index.rs:392` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/inverted/index/partition.rs:338 — rust/lance-index/src/scalar/inverted/index/partition.rs:338-343 | rust/lance-index/src/scalar/inverted/index/partition.rs:449-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) rust/lance-index/src/scalar/json.rs:930 — rust/lance-index/src/scalar/json.rs:930-935 | rust/lance-index/src/scalar/json.rs:1070-1075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/lance-index/src/scalar/label_list.rs:503 — rust/lance-index/src/scalar/label_list.rs:503-508 | rust/lance-index/src/scalar/label_list.rs:510-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/lance-index/src/vector/bq/dist_table_quant.rs:401 — rust/lance-index/src/vector/bq/dist_table_quant.rs:401-406 | rust/lance-index/src/vector/bq/dist_table_quant.rs:488-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/dist_table_quant.rs:401` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rust/lance-index/src/vector/bq/dist_table_quant.rs:436 — rust/lance-index/src/vector/bq/dist_table_quant.rs:436-441 | rust/lance-index/src/vector/bq/dist_table_quant.rs:529-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/dist_table_quant.rs:436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rust/lance-index/src/vector/bq/ex_dot.rs:687 — rust/lance-index/src/vector/bq/ex_dot.rs:687-692 | rust/lance-index/src/vector/bq/ex_dot.rs:753-758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/ex_dot.rs:687` it begins part-way through the construct above it, so those exact lines 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/lance-index/src/vector/bq/ex_dot.rs:1455 — rust/lance-index/src/vector/bq/ex_dot.rs:1455-1460 | rust/lance-index/src/vector/bq/ex_dot.rs:1518-1523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/ex_dot.rs:1455` it begins part-way through the construct above it, so those exact lines 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/lance-index/src/vector/bq/storage.rs:1648 — rust/lance-index/src/vector/bq/storage.rs:1648-1653 | rust/lance-index/src/vector/bq/storage.rs:2410-2415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/storage.rs:1648` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 85 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×100
  • Hotspot: rust/lance-table/src/transaction/manifest_build.rs rust/lance-table/src/transaction/manifest_build.rs:747 — rust/lance-table/src/transaction/manifest_build.rs changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 200 in Transaction::build_manifest_prepared at line 747. 27 of those changes were fix/bug commits, and the other 29 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-table/src/transaction/manifest_build.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: python/python/lance/dataset.py python/python/lance/dataset.py:3667 — python/python/lance/dataset.py changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in LanceDataset._create_index_impl at line 3667. 30 of those changes were fix/bug commits, and the other 53 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- python/python/lance/dataset.py`: 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: python/src/dataset.rs python/src/dataset.rs:943 — python/src/dataset.rs changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in Dataset::scanner at line 943. 9 of those changes were fix/bug commits, and the other 44 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- python/src/dataset.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/lance/src/index/append.rs rust/lance/src/index/append.rs:1696 — rust/lance/src/index/append.rs changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in lance::index::append::merge_indices_with_unindexed_frags at line 1696. 19 of those changes were fix/bug commits, and the other 25 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/index/append.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/lance/src/io/commit.rs rust/lance/src/io/commit.rs:1777 — rust/lance/src/io/commit.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in lance::io::commit::commit_transaction at line 1777. 26 of those changes were fix/bug commits, and the other 26 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/io/commit.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/lance/src/dataset/cleanup.rs rust/lance/src/dataset/cleanup.rs:2278 — rust/lance/src/dataset/cleanup.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in CleanupTask::cleanup_file_if_not_referenced at line 2278. 19 of those changes were fix/bug commits, and the other 20 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/cleanup.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/lance/src/dataset/scanner.rs rust/lance/src/dataset/scanner.rs:687 — rust/lance/src/dataset/scanner.rs changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in Dataset::count_indexed_rows at line 687. 34 of those changes were fix/bug commits, and the other 49 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/scanner.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/lance/src/dataset.rs rust/lance/src/dataset.rs:913 — rust/lance/src/dataset.rs changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Dataset::load_manifest at line 913. 37 of those changes were fix/bug commits, and the other 53 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset.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/lance/src/index/create.rs rust/lance/src/index/create.rs:221 — rust/lance/src/index/create.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in CreateIndexBuilder::execute_uncommitted_impl at line 221. 14 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/index/create.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/lance-index/src/scalar/zonemap.rs rust/lance-index/src/scalar/zonemap.rs:539 — rust/lance-index/src/scalar/zonemap.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in ZoneMapIndex::evaluate_zone_against_query at line 539. 5 of those changes were fix/bug commits, and the other 13 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-index/src/scalar/zonemap.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/lance-datafusion/src/planner.rs rust/lance-datafusion/src/planner.rs:840 — rust/lance-datafusion/src/planner.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in Planner::parse_sql_expr at line 840. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-datafusion/src/planner.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/lance/src/dataset/fragment.rs rust/lance/src/dataset/fragment.rs:2112 — rust/lance/src/dataset/fragment.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in FileFragment::validate at line 2112. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/fragment.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/lance/src/index/frag_reuse.rs rust/lance/src/index/frag_reuse.rs:1720 — rust/lance/src/index/frag_reuse.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in lance::index::frag_reuse::build_frag_reuse_rewrite_entry at line 1720. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/index/frag_reuse.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/lance/src/dataset/write.rs rust/lance/src/dataset/write.rs:938 — rust/lance/src/dataset/write.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in lance::dataset::write::do_write_fragments_impl at line 938. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/write.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/lance-table/src/transaction/conflicts.rs rust/lance-table/src/transaction/conflicts.rs:19 — rust/lance-table/src/transaction/conflicts.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 241 in Operation::eq at line 19. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-table/src/transaction/conflicts.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/lance/src/index/vector/ivf.rs rust/lance/src/index/vector/ivf.rs:5518 — rust/lance/src/index/vector/ivf.rs changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in lance::index::vector::ivf::train_weighted_hierarchical_kmeans at line 5518. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/index/vector/ivf.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/lance/src/dataset/schema_evolution.rs rust/lance/src/dataset/schema_evolution.rs:1107 — rust/lance/src/dataset/schema_evolution.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in lance::dataset::schema_evolution::alter_columns at line 1107. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/schema_evolution.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/lance-datafusion-exec/src/expr.rs rust/lance-datafusion-exec/src/expr.rs:112 — rust/lance-datafusion-exec/src/expr.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 211 in lance_datafusion_exec::expr::safe_coerce_scalar at line 112. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-datafusion-exec/src/expr.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/lance/src/io/exec/filtered_read.rs rust/lance/src/io/exec/filtered_read.rs:902 — rust/lance/src/io/exec/filtered_read.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in FilteredReadStream::plan_scan at line 902. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/io/exec/filtered_read.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/lance/src/index/vector.rs rust/lance/src/index/vector.rs:1341 — rust/lance/src/index/vector.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in lance::index::vector::build_vector_index_impl at line 1341. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/index/vector.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/lance-encoding/src/compression.rs rust/lance-encoding/src/compression.rs:1828 — rust/lance-encoding/src/compression.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in lance_encoding::compression::create_fixed_width_block_decompressor_inner at line 1828. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-encoding/src/compression.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/lance-index/src/vector/distributed/index_merger.rs rust/lance-index/src/vector/distributed/index_merger.rs:868 — rust/lance-index/src/vector/distributed/index_merger.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 127 in lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner at line 868. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-index/src/vector/distributed/index_merger.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/lance/src/index/scalar.rs rust/lance/src/index/scalar.rs:1122 — rust/lance/src/index/scalar.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in lance::index::scalar::index_matches_criteria at line 1122. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/index/scalar.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/lance/src/dataset/write/commit.rs rust/lance/src/dataset/write/commit.rs:378 — rust/lance/src/dataset/write/commit.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in CommitBuilder::execute_inner at line 378. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/write/commit.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/lance-index/src/scalar/inverted/wand.rs rust/lance-index/src/scalar/inverted/wand.rs:554 — rust/lance-index/src/scalar/inverted/wand.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Wand::search at line 554. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-index/src/scalar/inverted/wand.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.
  • + 75 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×97
  • FunctionTooLong: lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner rust/lance-index/src/vector/distributed/index_merger.rs:868 — FunctionTooLong — lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner runs 629 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 529 over it, 6.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::index::append::merge_indices_with_unindexed_frags rust/lance/src/index/append.rs:1696 — FunctionTooLong — lance::index::append::merge_indices_with_unindexed_frags runs 471 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 371 over it, 4.71× 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: lance_jni::transaction::convert_to_rust_operation java/lance-jni/src/transaction.rs:1761 — FunctionTooLong — lance_jni::transaction::convert_to_rust_operation runs 378 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 278 over it, 3.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.
  • FunctionTooLong: lance_datafusion_exec::expr::safe_coerce_scalar rust/lance-datafusion-exec/src/expr.rs:112 — FunctionTooLong — lance_datafusion_exec::expr::safe_coerce_scalar runs 367 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 267 over it, 3.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.
  • FunctionTooLong: lance::io::commit::commit_transaction rust/lance/src/io/commit.rs:1777 — FunctionTooLong — lance::io::commit::commit_transaction runs 318 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 218 over it, 3.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: lance::index::vector::build_distributed_vector_index rust/lance/src/index/vector.rs:852 — FunctionTooLong — lance::index::vector::build_distributed_vector_index runs 309 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 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance_jni::transaction::convert_to_java_operation_inner java/lance-jni/src/transaction.rs:890 — FunctionTooLong — lance_jni::transaction::convert_to_java_operation_inner runs 298 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 198 over it, 2.98× 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: lance::index::vector::build_vector_index_impl rust/lance/src/index/vector.rs:1341 — FunctionTooLong — lance::index::vector::build_vector_index_impl runs 298 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 198 over it, 2.98× 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: lance::dataset::optimize::execution::rewrite_files rust/lance/src/dataset/optimize/execution.rs:495 — FunctionTooLong — lance::dataset::optimize::execution::rewrite_files runs 280 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 180 over it, 2.80× 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: lance_tools::manifest::write_transaction_operation rust/lance-tools/src/manifest.rs:838 — FunctionTooLong — lance_tools::manifest::write_transaction_operation runs 272 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 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::dataset::optimize::commit::commit_compaction rust/lance/src/dataset/optimize/commit.rs:130 — FunctionTooLong — lance::dataset::optimize::commit::commit_compaction runs 260 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 160 over it, 2.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: lance::index::append::merge_scalar_indices rust/lance/src/index/append.rs:921 — FunctionTooLong — lance::index::append::merge_scalar_indices runs 260 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 160 over it, 2.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: lance_index::scalar::inverted::cross_column::cross_column_compound_search rust/lance-index/src/scalar/inverted/cross_column.rs:1357 — FunctionTooLong — lance_index::scalar::inverted::cross_column::cross_column_compound_search runs 245 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::io::commit::do_commit_new_dataset rust/lance/src/io/commit.rs:432 — FunctionTooLong — lance::io::commit::do_commit_new_dataset 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.
  • FunctionTooLong: lance::dataset::schema_evolution::alter_columns rust/lance/src/dataset/schema_evolution.rs:1107 — FunctionTooLong — lance::dataset::schema_evolution::alter_columns runs 239 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 139 over it, 2.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: lance::index::vector::ivf::optimize_vector_indices_v2 rust/lance/src/index/vector/ivf.rs:1098 — FunctionTooLong — lance::index::vector::ivf::optimize_vector_indices_v2 runs 236 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 136 over it, 2.36× 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: lance::index::vector::builder::merge_partitions rust/lance/src/index/vector/builder.rs:1832 — FunctionTooLong — lance::index::vector::builder::merge_partitions runs 217 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 117 over it, 2.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: lance::index::vector::build_vector_index_incremental rust/lance/src/index/vector.rs:1721 — FunctionTooLong — lance::index::vector::build_vector_index_incremental 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.
  • FunctionTooLong: lance::index::vector::ivf::v2::partition_search::search_partitions rust/lance/src/index/vector/ivf/v2/partition_search.rs:206 — FunctionTooLong — lance::index::vector::ivf::v2::partition_search::search_partitions 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.
  • FunctionTooLong: lance::index::frag_reuse::build_frag_reuse_rewrite_entry rust/lance/src/index/frag_reuse.rs:1720 — FunctionTooLong — lance::index::frag_reuse::build_frag_reuse_rewrite_entry runs 215 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 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::dataset::optimize::binary_copy::rewrite_files_binary_copy rust/lance/src/dataset/optimize/binary_copy.rs:135 — FunctionTooLong — lance::dataset::optimize::binary_copy::rewrite_files_binary_copy runs 211 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 111 over it, 2.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: lance_jni::blocking_scanner::build_scanner_with_options java/lance-jni/src/blocking_scanner.rs:353 — FunctionTooLong — lance_jni::blocking_scanner::build_scanner_with_options runs 202 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 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance_index::scalar::inverted::index::flat_search::tokenize_and_count rust/lance-index/src/scalar/inverted/index/flat_search.rs:234 — FunctionTooLong — lance_index::scalar::inverted::index::flat_search::tokenize_and_count 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.
  • FunctionTooLong: lance::index::vector::ivf::train_streaming_coreset_ivf_model_with_algorithm rust/lance/src/index/vector/ivf.rs:5819 — FunctionTooLong — lance::index::vector::ivf::train_streaming_coreset_ivf_model_with_algorithm runs 187 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 87 over it, 1.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: lance::io::commit::do_commit_detached_transaction rust/lance/src/io/commit.rs:1311 — FunctionTooLong — lance::io::commit::do_commit_detached_transaction runs 185 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 85 over it, 1.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.
  • + 72 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×82
  • Duplicated block (8 lines × 2) java/lance-jni/src/blocking_scanner.rs:501 — java/lance-jni/src/blocking_scanner.rs:501-508 | java/lance-jni/src/utils.rs:312-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) java/lance-jni/src/otel.rs:110 — java/lance-jni/src/otel.rs:110-117 | python/src/otel.rs:158-165 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `java/lance-jni/src/otel.rs:110` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) java/lance-jni/src/otel.rs:395 — java/lance-jni/src/otel.rs:395-402 | python/src/otel.rs:348-355 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) java/lance-jni/src/vector_trainer.rs:116 — java/lance-jni/src/vector_trainer.rs:116-123 | java/lance-jni/src/vector_trainer.rs:179-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/vector_trainer.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 (8 lines × 2) python/src/fragment.rs:253 — python/src/fragment.rs:253-260 | python/src/fragment.rs:281-288 — both copies are in the same file, so extract the 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, `python/src/fragment.rs:290` calls `iter` and `python/src/fragment.rs:262` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:226 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:226-233 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:239-246 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `delta` to `DataType` in one and `uint32x4_t` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) rust/lance-core/src/datatypes/schema.rs:247 — rust/lance-core/src/datatypes/schema.rs:247-254 | rust/lance-core/src/datatypes/schema.rs:742-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-core/src/datatypes/schema.rs:247` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/logical/fixed_size_list.rs:470 — rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:470-477 | rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:525-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:470` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/blob.rs:413 — rust/lance-encoding/src/encodings/logical/primitive/blob.rs:413-420 | rust/lance-encoding/src/encodings/logical/primitive/blob.rs:427-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:753 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:753-760 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:768-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:753` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:801 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:801-808 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:816-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:801` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:849 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:849-856 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:864-871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:849` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:897 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:897-904 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:912-919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:897` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:980 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:980-987 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:995-1002 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:980` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:1103 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:1103-1110 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:1118-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:1103` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/packed.rs:688 — rust/lance-encoding/src/encodings/physical/packed.rs:688-695 | rust/lance-encoding/src/encodings/physical/packed.rs:698-705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/packed.rs:688` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/statistics.rs:186 — rust/lance-encoding/src/statistics.rs:186-193 | rust/lance-encoding/src/statistics.rs:323-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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/lance-file/src/versions/v2_0/writer.rs:409 — rust/lance-file/src/versions/v2_0/writer.rs:409-416 | rust/lance-file/src/writer/structural.rs:583-590 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/versions/v2_0/writer.rs:409` it does not close everything it opens, so those 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/lance-file/src/versions/v2_0/writer.rs:417` calls `default` and `rust/lance-file/src/writer/structural.rs:591` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:667 — rust/lance-index/src/scalar/bloomfilter.rs:667-674 | rust/lance-index/src/scalar/bloomfilter.rs:681-688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/bloomfilter.rs:667` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/inverted/cross_column.rs:196 — rust/lance-index/src/scalar/inverted/cross_column.rs:196-203 | rust/lance-index/src/scalar/inverted/wand/doc_source.rs:164-171 — 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 (8 lines × 2) rust/lance-index/src/scalar/inverted/index/cache.rs:511 — rust/lance-index/src/scalar/inverted/index/cache.rs:511-518 | rust/lance-index/src/scalar/inverted/index/cache.rs:542-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/cache.rs:511` it begins part-way through the construct above it, so those exact lines 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/lance-index/src/vector/bq/rotation.rs:36 — rust/lance-index/src/vector/bq/rotation.rs:36-43 | rust/lance-index/src/vector/bq/rotation.rs:119-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/rotation.rs:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:501 — rust/lance-index/src/vector/distributed/index_merger.rs:501-508 | rust/lance-index/src/vector/distributed/index_merger.rs:536-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/lance-index/src/vector/distributed/index_merger.rs:501` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/vector/hnsw/builder.rs:880 — rust/lance-index/src/vector/hnsw/builder.rs:880-887 | rust/lance-index/src/vector/hnsw/online.rs:312-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/hnsw/builder.rs:880` it does not close everything it opens, so those exact lines 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/lance-io/src/object_store/providers.rs:165 — rust/lance-io/src/object_store/providers.rs:165-172 | rust/lance-io/src/object_store/providers.rs:562-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-io/src/object_store/providers.rs:165` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 57 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×81
  • ClassTooLong: Dataset python/src/dataset.rs:313 — ClassTooLong — 2787 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 136 methods, 4 blocks, lines 313-4506. The bar is 400 significant lines; this is 2387 over it, 6.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: ManifestNamespace rust/lance-namespace-impls/src/dir/manifest.rs:974 — ClassTooLong — 2276 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 72 methods, 4 blocks, lines 974-4454. The bar is 400 significant lines; this is 1876 over it, 5.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: Dataset rust/lance/src/dataset.rs:256 — ClassTooLong — 2254 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 185 methods, 7 blocks, lines 256-5214. The bar is 400 significant lines; this is 1854 over it, 5.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: PrimitiveStructuralEncoder rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:207 — ClassTooLong — 1751 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 38 methods, 3 blocks, lines 207-2979. The bar is 400 significant lines; this is 1351 over it, 4.38× 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: CleanupTask rust/lance/src/dataset/cleanup.rs:428 — ClassTooLong — 1524 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 428-3017. The bar is 400 significant lines; this is 1124 over it, 3.81× 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: IVFIndex rust/lance/src/index/vector/ivf/v2.rs:1541 — ClassTooLong — 1386 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 6 blocks, lines 1541-3819. The bar is 400 significant lines; this is 986 over it, 3.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.
  • ClassTooLong: FileFragment rust/lance/src/dataset/fragment.rs:142 — ClassTooLong — 1294 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 64 methods, 2 blocks, lines 142-3340. The bar is 400 significant lines; this is 894 over it, 3.24× 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: IvfQuantizationStorage rust/lance-index/src/vector/storage.rs:1375 — ClassTooLong — 1199 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 69 methods, 3 blocks, lines 1375-3173. The bar is 400 significant lines; this is 799 over it, 3.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: FtsMemIndex rust/lance/src/dataset/mem_wal/index/fts.rs:1334 — ClassTooLong — 1129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 52 methods, 5 blocks, lines 1334-5303. The bar is 400 significant lines; this is 729 over it, 2.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: JavaLanceNamespace java/lance-jni/src/namespace.rs:159 — ClassTooLong — 981 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 5 blocks, lines 159-1520. The bar is 400 significant lines; this is 581 over it, 2.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RestNamespace rust/lance-namespace-impls/src/rest.rs:627 — 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, 5 blocks, lines 627-1900. 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: FileReader rust/lance-file/src/reader.rs:460 — ClassTooLong — 955 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 52 methods, 3 blocks, lines 460-2450. The bar is 400 significant lines; this is 555 over it, 2.39× 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: ObjectStore rust/lance-io/src/object_store.rs:261 — ClassTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 64 methods, 6 blocks, lines 261-2573. The bar is 400 significant lines; this is 549 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ShardWriter rust/lance/src/dataset/mem_wal/write/writer.rs:894 — ClassTooLong — 905 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 2 blocks, lines 894-2637. The bar is 400 significant lines; this is 505 over it, 2.26× 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: BTreeIndex rust/lance-index/src/scalar/btree.rs:2001 — ClassTooLong — 874 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 6 blocks, lines 2001-3463. The bar is 400 significant lines; this is 474 over it, 2.19× 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: RabitDistCalculator rust/lance-index/src/vector/bq/storage.rs:1012 — ClassTooLong — 827 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 4 blocks, lines 1012-2348. The bar is 400 significant lines; this is 427 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FullSchemaMergeInsertExec rust/lance/src/dataset/write/merge_insert/exec/write.rs:279 — ClassTooLong — 825 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 4 blocks, lines 279-1490. The bar is 400 significant lines; this is 425 over it, 2.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FilteredReadExec rust/lance/src/io/exec/filtered_read.rs:2378 — ClassTooLong — 819 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 4 blocks, lines 2378-4165. The bar is 400 significant lines; this is 419 over it, 2.05× 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: FilteredReadStream rust/lance/src/io/exec/filtered_read.rs:497 — ClassTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 3 blocks, lines 497-1839. The bar is 400 significant lines; this is 411 over it, 2.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.
  • ClassTooLong: BlobPreprocessor rust/lance/src/dataset/blob/write.rs:207 — ClassTooLong — 794 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 207-1403. The bar is 400 significant lines; this is 394 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: InvertedIndex rust/lance-index/src/scalar/inverted/index/inverted_index.rs:23 — ClassTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 64 methods, 9 blocks, lines 23-1201. The bar is 400 significant lines; this is 383 over it, 1.96× 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: DecodeMiniBlockTask rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:76 — ClassTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 3 blocks, lines 76-1156. The bar is 400 significant lines; this is 364 over it, 1.91× 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: Field rust/lance-core/src/datatypes/field.rs:137 — ClassTooLong — 757 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 48 methods, 5 blocks, lines 137-1363. The bar is 400 significant lines; this is 357 over it, 1.89× 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: MinHashLshIndex rust/lance-index/src/scalar/minhash_lsh/index.rs:174 — ClassTooLong — 751 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 7 blocks, lines 174-1768. The bar is 400 significant lines; this is 351 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: RleEncoder rust/lance-encoding/src/encodings/physical/rle.rs:468 — ClassTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 5 blocks, lines 468-1447. The bar is 400 significant lines; this is 318 over it, 1.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.
  • + 56 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×79
  • Duplicated block (10 lines × 2) java/lance-jni/src/mem_wal.rs:780 — java/lance-jni/src/mem_wal.rs:780-789 | java/lance-jni/src/mem_wal.rs:905-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.
  • Duplicated block (10 lines × 2) java/lance-jni/src/optimize.rs:106 — java/lance-jni/src/optimize.rs:106-115 | java/lance-jni/src/optimize.rs:207-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/optimize.rs:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `java/lance-jni/src/optimize.rs:217` calls `null` and `java/lance-jni/src/optimize.rs:116` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) java/lance-jni/src/otel.rs:316 — java/lance-jni/src/otel.rs:316-325 | java/lance-jni/src/utils.rs:633-642 — 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 `java/lance-jni/src/otel.rs:316` it does not close everything it opens, so those 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, `java/lance-jni/src/otel.rs:326` calls `delete_local_ref` and `java/lance-jni/src/utils.rs:643` 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) python/src/mem_wal.rs:262 — python/src/mem_wal.rs:262-271 | python/src/mem_wal.rs:287-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 `python/src/mem_wal.rs:262` it does not close everything it opens, so those exact lines 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) python/src/mem_wal.rs:755 — python/src/mem_wal.rs:755-764 | python/src/mem_wal.rs:829-838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) python/src/scanner.rs:277 — python/src/scanner.rs:277-286 | python/src/scanner.rs:299-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/scanner.rs:277` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rust/arrow-scalar/src/serde.rs:210 — rust/arrow-scalar/src/serde.rs:210-219 | rust/arrow-scalar/src/serde.rs:223-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.
  • Duplicated block (10 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:413 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:413-422 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:474-483 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:413` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:506 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:506-515 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:567-576 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.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.
  • Duplicated block (10 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:612 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:612-621 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:673-682 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:612` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:632 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:632-641 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:693-702 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:632` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-arrow/src/json.rs:506 — rust/lance-arrow/src/json.rs:506-515 | rust/lance-arrow/src/json.rs:524-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-arrow/src/json.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.
  • Duplicated block (10 lines × 2) rust/lance-datafusion-exec/src/exec.rs:403 — rust/lance-datafusion-exec/src/exec.rs:403-412 | rust/lance/src/dataset/write/merge_insert.rs:1022-1031 — 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/lance-datafusion-exec/src/exec.rs:403` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact 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 `output` to `&mut Vec<OperatorMetrics>` in one and `&mut Vec<MergeInsertJoin>` 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/lance-datafusion/src/planner.rs:1039 — rust/lance-datafusion/src/planner.rs:1039-1048 | rust/lance-datafusion/src/planner.rs:1052-1061 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-datafusion/src/planner.rs:1039` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-encoding/src/array_encoding/logical/struct.rs:306 — rust/lance-encoding/src/array_encoding/logical/struct.rs:306-315 | rust/lance-encoding/src/encodings/logical/struct.rs:222-231 — before extracting anything, compare `rust/lance-encoding/src/array_encoding/logical/struct.rs` and `rust/lance-encoding/src/encodings/logical/struct.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-encoding/src/array_encoding/logical/struct.rs:306` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/array_encoding/strategy.rs:347 — rust/lance-encoding/src/array_encoding/strategy.rs:347-356 | rust/lance-encoding/src/array_encoding/strategy.rs:359-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/array_encoding/strategy.rs:347` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/dict.rs:334 — rust/lance-encoding/src/encodings/logical/primitive/dict.rs:334-343 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:444-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/dict.rs:334` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:2025 — rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:2025-2034 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:2130-2139 — both copies are in the same file, so extract the 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/lance-encoding/src/encodings/physical/alp.rs:1398 — rust/lance-encoding/src/encodings/physical/alp.rs:1398-1407 | rust/lance-encoding/src/encodings/physical/alp.rs:1522-1531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:1398` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-encoding/src/encodings/physical/byte_stream_split.rs:572 — rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:572-581 | rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:588-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/byte_stream_split.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 (10 lines × 2) rust/lance-file/src/reader/structural.rs:287 — rust/lance-file/src/reader/structural.rs:287-296 | rust/lance-file/src/versions/v2_0/reader.rs:245-254 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/reader/structural.rs:287` it does not close everything it opens, so those exact lines 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/lance-file/src/writer/structural.rs:637 — rust/lance-file/src/writer/structural.rs:637-646 | rust/lance-file/src/writer/structural.rs:696-705 — both copies are in the same file, so extract the 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/lance-index/src/scalar/fmindex.rs:586 — rust/lance-index/src/scalar/fmindex.rs:586-595 | rust/lance-index/src/scalar/fmindex.rs:615-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/fmindex.rs:586` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/inverted.rs:675 — rust/lance-index/src/scalar/inverted.rs:675-684 | rust/lance-index/src/scalar/inverted.rs:700-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted.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.
  • Duplicated block (10 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:3263 — rust/lance-index/src/scalar/inverted/builder.rs:3263-3272 | rust/lance-index/src/scalar/inverted/builder.rs:3286-3295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 54 more in this group — see findings.md.
D1 · Cyclomatic Complexity · lance · ×56
  • lance::index::append::merge_indices_with_unindexed_frags (cyclomatic 46) rust/lance/src/index/append.rs:1696 — lance::index::append::merge_indices_with_unindexed_frags 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.
  • lance::index::frag_reuse::build_frag_reuse_rewrite_entry (cyclomatic 42) rust/lance/src/index/frag_reuse.rs:1720 — lance::index::frag_reuse::build_frag_reuse_rewrite_entry has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • lance::index::vector::ivf::v2::partition_search::search_partitions (cyclomatic 42) rust/lance/src/index/vector/ivf/v2/partition_search.rs:206 — lance::index::vector::ivf::v2::partition_search::search_partitions has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • lance::io::commit::commit_transaction (cyclomatic 37) rust/lance/src/io/commit.rs:1777 — lance::io::commit::commit_transaction 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.
  • lance::index::append::merge_scalar_indices (cyclomatic 35) rust/lance/src/index/append.rs:921 — lance::index::append::merge_scalar_indices 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.
  • lance::io::exec::count_pushdown::try_rewrite (cyclomatic 34) rust/lance/src/io/exec/count_pushdown.rs:107 — lance::io::exec::count_pushdown::try_rewrite 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.
  • lance::dataset::optimize::commit::commit_compaction (cyclomatic 33) rust/lance/src/dataset/optimize/commit.rs:130 — lance::dataset::optimize::commit::commit_compaction 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.
  • lance::dataset::optimize::execution::rewrite_files (cyclomatic 32) rust/lance/src/dataset/optimize/execution.rs:495 — lance::dataset::optimize::execution::rewrite_files 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.
  • lance::dataset::write::do_write_fragments_impl (cyclomatic 31) rust/lance/src/dataset/write.rs:938 — lance::dataset::write::do_write_fragments_impl 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.
  • lance::dataset::versions::check_manifest_storage_contract (cyclomatic 28) rust/lance/src/dataset/versions/mod.rs:442 — lance::dataset::versions::check_manifest_storage_contract 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.
  • lance::index::optimize::consolidate::plan_index (cyclomatic 28) rust/lance/src/index/optimize/consolidate.rs:51 — lance::index::optimize::consolidate::plan_index 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.
  • lance::dataset::blob::external::collect_external_blob_uris (cyclomatic 27) rust/lance/src/dataset/blob/external.rs:121 — lance::dataset::blob::external::collect_external_blob_uris 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.
  • lance::dataset::optimize::binary_copy::rewrite_files_binary_copy (cyclomatic 27) rust/lance/src/dataset/optimize/binary_copy.rs:135 — lance::dataset::optimize::binary_copy::rewrite_files_binary_copy 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.
  • lance::dataset::schema_evolution::alter_columns (cyclomatic 27) rust/lance/src/dataset/schema_evolution.rs:1107 — lance::dataset::schema_evolution::alter_columns 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.
  • lance::index::vector::build_vector_index_impl (cyclomatic 27) rust/lance/src/index/vector.rs:1341 — lance::index::vector::build_vector_index_impl 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.
  • lance::io::commit::do_commit_new_dataset (cyclomatic 27) rust/lance/src/io/commit.rs:432 — lance::io::commit::do_commit_new_dataset 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.
  • lance::dataset::mem_wal::write::replay::replay_memtable_from_wal (cyclomatic 25) rust/lance/src/dataset/mem_wal/write/replay.rs:66 — lance::dataset::mem_wal::write::replay::replay_memtable_from_wal 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.
  • lance::index::vector::ivf::train_weighted_hierarchical_kmeans (cyclomatic 25) rust/lance/src/index/vector/ivf.rs:5518 — lance::index::vector::ivf::train_weighted_hierarchical_kmeans 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.
  • lance::dataset::index::frag_reuse::compute_tagged_retention (cyclomatic 24) rust/lance/src/dataset/index/frag_reuse.rs:761 — lance::dataset::index::frag_reuse::compute_tagged_retention 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.
  • lance::index::vector::build_distributed_vector_index (cyclomatic 24) rust/lance/src/index/vector.rs:852 — lance::index::vector::build_distributed_vector_index 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.
  • lance::io::exec::filtered_read_proto::fr_options_from_proto (cyclomatic 23) rust/lance/src/io/exec/filtered_read_proto.rs:381 — lance::io::exec::filtered_read_proto::fr_options_from_proto has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • lance::index::scalar::index_matches_criteria (cyclomatic 22) rust/lance/src/index/scalar.rs:1122 — lance::index::scalar::index_matches_criteria 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.
  • lance::io::exec::knn::batch_probe::late_search (cyclomatic 22) rust/lance/src/io/exec/knn/batch_probe.rs:373 — lance::io::exec::knn::batch_probe::late_search 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.
  • lance::blob::validate_prepared_blob_value_array (cyclomatic 21) rust/lance/src/blob.rs:484 — lance::blob::validate_prepared_blob_value_array 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.
  • lance::index::frag_reuse_with_stable_row_ids::history::validate_frag_reuse_history (cyclomatic 21) rust/lance/src/index/frag_reuse_with_stable_row_ids/history.rs:82 — lance::index::frag_reuse_with_stable_row_ids::history::validate_frag_reuse_history 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.
  • + 31 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×56
  • Edited copy of a member (7 corresponding lines) python/src/namespace.rs:477 — python/src/namespace.rs:477-483 | python/src/namespace.rs:1224-1230 — 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) python/src/namespace.rs:489 — python/src/namespace.rs:489-495 | python/src/namespace.rs:1236-1242 — 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) python/src/namespace.rs:527 — python/src/namespace.rs:527-533 | python/src/namespace.rs:1274-1280 — 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) python/src/namespace.rs:539 — python/src/namespace.rs:539-545 | python/src/namespace.rs:1286-1292 — 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) python/src/namespace.rs:553 — python/src/namespace.rs:553-559 | python/src/namespace.rs:1300-1306 — 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) python/src/namespace.rs:565 — python/src/namespace.rs:565-571 | python/src/namespace.rs:1312-1318 — 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) python/src/namespace.rs:591 — python/src/namespace.rs:591-597 | python/src/namespace.rs:1338-1344 — 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) python/src/namespace.rs:605 — python/src/namespace.rs:605-611 | python/src/namespace.rs:1352-1358 — 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) python/src/namespace.rs:617 — python/src/namespace.rs:617-623 | python/src/namespace.rs:1364-1370 — 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) python/src/namespace.rs:629 — python/src/namespace.rs:629-635 | python/src/namespace.rs:1376-1382 — 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) python/src/namespace.rs:641 — python/src/namespace.rs:641-647 | python/src/namespace.rs:1388-1394 — 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) python/src/namespace.rs:673 — python/src/namespace.rs:673-679 | python/src/namespace.rs:1420-1426 — 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) python/src/namespace.rs:685 — python/src/namespace.rs:685-691 | python/src/namespace.rs:1432-1438 — 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) python/src/namespace.rs:697 — python/src/namespace.rs:697-703 | python/src/namespace.rs:1444-1450 — 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) python/src/namespace.rs:733 — python/src/namespace.rs:733-739 | python/src/namespace.rs:1489-1495 — 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) python/src/namespace.rs:747 — python/src/namespace.rs:747-753 | python/src/namespace.rs:1503-1509 — 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) python/src/namespace.rs:759 — python/src/namespace.rs:759-765 | python/src/namespace.rs:1515-1521 — 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) python/src/namespace.rs:771 — python/src/namespace.rs:771-777 | python/src/namespace.rs:1527-1533 — 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) python/src/namespace.rs:783 — python/src/namespace.rs:783-789 | python/src/namespace.rs:1539-1545 — 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) python/src/namespace.rs:795 — python/src/namespace.rs:795-801 | python/src/namespace.rs:1551-1557 — 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) python/src/namespace.rs:211 — python/src/namespace.rs:211-217 | python/src/namespace.rs:958-964 — 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) python/src/namespace.rs:223 — python/src/namespace.rs:223-229 | python/src/namespace.rs:970-976 — 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) python/src/namespace.rs:245 — python/src/namespace.rs:245-251 | python/src/namespace.rs:992-998 — 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) python/src/namespace.rs:257 — python/src/namespace.rs:257-263 | python/src/namespace.rs:1004-1010 — 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) python/src/namespace.rs:269 — python/src/namespace.rs:269-275 | python/src/namespace.rs:1016-1022 — 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.
  • + 31 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×56
  • Duplicated block (9 lines × 2) java/lance-jni/src/otel.rs:161 — java/lance-jni/src/otel.rs:161-169 | python/src/otel.rs:214-222 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (9 lines × 2) python/src/dataset.rs:1195 — python/src/dataset.rs:1195-1203 | python/src/fragment.rs:409-417 — before extracting anything, compare `python/src/dataset.rs` and `python/src/fragment.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/dataset.rs:1195` it does not close everything it opens, so those exact lines 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) python/src/dataset.rs:2016 — python/src/dataset.rs:2016-2024 | python/src/dataset.rs:2048-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 `python/src/dataset.rs:2016` it begins part-way through the construct above it, so those exact lines 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) python/src/dataset.rs:3555 — python/src/dataset.rs:3555-3563 | python/src/dataset.rs:3583-3591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/dataset.rs:3555` it does not close everything it opens, so those exact 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 `field_updates` to `HashMap<u32, HashMap<String, Option<String>>>` in one and `HashMap<String, HashMap<String, Option<String>>>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) rust/lance-datafusion-exec/src/udf/json.rs:488 — rust/lance-datafusion-exec/src/udf/json.rs:488-496 | rust/lance-datafusion-exec/src/udf/json.rs:771-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-datafusion-exec/src/udf/json.rs:488` it does not close everything it opens, so those exact lines 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/lance-datafusion-exec/src/udf/json.rs:659 — rust/lance-datafusion-exec/src/udf/json.rs:659-667 | rust/lance-datafusion-exec/src/udf/json.rs:929-937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-datafusion-exec/src/udf/json.rs:659` it does not close everything it opens, so those exact lines 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/lance-encoding/src/array_encoding/logical/struct.rs:210 — rust/lance-encoding/src/array_encoding/logical/struct.rs:210-218 | rust/lance-encoding/src/encodings/logical/struct.rs:146-154 — before extracting anything, compare `rust/lance-encoding/src/array_encoding/logical/struct.rs` and `rust/lance-encoding/src/encodings/logical/struct.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/lance-encoding/src/array_encoding/logical/struct.rs:219` calls `pop` and `rust/lance-encoding/src/encodings/logical/struct.rs:155` 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/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1036 — rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1036-1044 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1074-1082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1036` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/packed.rs:867 — rust/lance-encoding/src/encodings/physical/packed.rs:867-875 | rust/lance-encoding/src/encodings/physical/packed.rs:885-893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/packed.rs:867` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/versions/v1/mod.rs:108 — rust/lance-file/src/versions/v1/mod.rs:108-116 | rust/lance-file/src/versions/v2_0/mod.rs:74-82 — `rust/lance-file/src/versions/v1/mod.rs` and `rust/lance-file/src/versions/v2_0/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 × 2) rust/lance-file/src/versions/v2_0/writer.rs:132 — rust/lance-file/src/versions/v2_0/writer.rs:132-140 | rust/lance-file/src/writer/structural.rs:115-123 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/versions/v2_0/writer.rs:132` it does not close everything it opens, so those exact lines 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/lance-index/src/scalar/inverted/index/doc_set.rs:728 — rust/lance-index/src/scalar/inverted/index/doc_set.rs:728-736 | rust/lance-index/src/scalar/inverted/index/doc_set.rs:741-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 × 2) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:90 — rust/lance-index/src/scalar/inverted/wand/maxscore.rs:90-98 | rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1107-1115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/wand/maxscore.rs:90` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/json.rs:1240 — rust/lance-index/src/scalar/json.rs:1240-1248 | rust/lance-index/src/scalar/list_element.rs:627-635 — 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 (9 lines × 2) rust/lance-index/src/vector/bq/storage.rs:2402 — rust/lance-index/src/vector/bq/storage.rs:2402-2410 | rust/lance-index/src/vector/storage.rs:233-241 — 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/lance-index/src/vector/bq/storage.rs:2402` it does not close everything it opens, so those exact lines 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/lance-index/src/vector/bq/storage.rs:2934 — rust/lance-index/src/vector/bq/storage.rs:2934-2942 | rust/lance-index/src/vector/bq/storage.rs:3090-3098 — both copies are in the same file, so extract the 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/lance-index/src/vector/distributed/index_merger.rs:116 — rust/lance-index/src/vector/distributed/index_merger.rs:116-124 | rust/lance-index/src/vector/distributed/index_merger.rs:134-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/distributed/index_merger.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1616 — rust/lance-index/src/vector/distributed/index_merger.rs:1616-1624 | rust/lance-index/src/vector/distributed/index_merger.rs:1665-1673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/distributed/index_merger.rs:1616` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/vector/hnsw/index.rs:286 — rust/lance-index/src/vector/hnsw/index.rs:286-294 | rust/lance/src/index/vector/ivf/v2.rs:3351-3359 — 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/lance-index/src/vector/hnsw/index.rs:286` it begins part-way through the construct above it, so those exact lines 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/lance-io/src/lib.rs:234 — rust/lance-io/src/lib.rs:234-242 | rust/lance-io/src/lib.rs:289-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-io/src/lib.rs:234` it does not close everything it opens, so those exact lines 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/lance-jsonb/src/core/ser.rs:75 — rust/lance-jsonb/src/core/ser.rs:75-83 | rust/lance-jsonb/src/core/ser.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/lance-jsonb/src/core/ser.rs:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rust/lance-linalg/src/distance/hamming.rs:1190 — rust/lance-linalg/src/distance/hamming.rs:1190-1198 | rust/lance-linalg/src/distance/hamming.rs:1226-1234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-linalg/src/distance/hamming.rs:1190` it begins part-way through the construct above it, so those exact lines 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/lance-linalg/src/simd/f32.rs:736 — rust/lance-linalg/src/simd/f32.rs:736-744 | rust/lance-linalg/src/simd/f64.rs:581-589 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 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/lance-linalg/src/simd/f32.rs:736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `ptr` to `*const f32` in one and `*const f64` 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/lance-linalg/src/simd/f32.rs:756 — rust/lance-linalg/src/simd/f32.rs:756-764 | rust/lance-linalg/src/simd/f32.rs:778-786 — both copies are in the same file, so extract the 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/lance-table/src/format/clustering.rs:344 — rust/lance-table/src/format/clustering.rs:344-352 | rust/lance-table/src/format/clustering.rs:384-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/format/clustering.rs:344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 31 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×55
  • Duplicated block (11 lines × 2) python/src/dataset.rs:2404 — python/src/dataset.rs:2404-2414 | python/src/dataset.rs:4411-4421 — both copies are in the same file, so extract the 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) python/src/mem_wal.rs:534 — python/src/mem_wal.rs:534-544 | python/src/mem_wal.rs:692-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/mem_wal.rs:534` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rust/arrow-stats/src/lib.rs:181 — rust/arrow-stats/src/lib.rs:181-191 | rust/arrow-stats/src/lib.rs:239-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/arrow-stats/src/lib.rs:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rust/compression/fsst/src/fsst.rs:657 — rust/compression/fsst/src/fsst.rs:657-667 | rust/compression/fsst/src/fsst.rs:698-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/compression/fsst/src/fsst.rs:657` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/logical/fixed_size_list.rs:493 — rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:493-503 | rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:548-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:493` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/sparse.rs:73 — rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:73-83 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:441-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:2099 — rust/lance-encoding/src/encodings/physical/alp.rs:2099-2109 | rust/lance-encoding/src/encodings/physical/alp.rs:2151-2161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:2099` it does not close everything it opens, so those exact lines 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/lance-encoding/src/repdef.rs:2543 — rust/lance-encoding/src/repdef.rs:2543-2553 | rust/lance-encoding/src/repdef.rs:2564-2574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/repdef.rs:2543` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-file/src/reader.rs:1489 — rust/lance-file/src/reader.rs:1489-1499 | rust/lance-file/src/reader.rs:1574-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/reader.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.
  • Duplicated block (11 lines × 2) rust/lance-file/src/versions/v1/writer/statistics.rs:66 — rust/lance-file/src/versions/v1/writer/statistics.rs:66-76 | rust/lance-file/src/versions/v1/writer/statistics.rs:118-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v1/writer/statistics.rs:66` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/versions/v2_0/writer.rs:110 — rust/lance-file/src/versions/v2_0/writer.rs:110-120 | rust/lance-file/src/writer/structural.rs:93-103 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (11 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:483 — rust/lance-file/src/versions/v2_0/writer.rs:483-493 | rust/lance-file/src/writer/structural.rs:643-653 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) rust/lance-index/src/scalar/inverted/cross_column.rs:1629 — rust/lance-index/src/scalar/inverted/cross_column.rs:1629-1639 | rust/lance-index/src/scalar/inverted/cross_column.rs:1645-1655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/cross_column.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 (11 lines × 2) rust/lance-index/src/scalar/inverted/index/token_set.rs:75 — rust/lance-index/src/scalar/inverted/index/token_set.rs:75-85 | rust/lance-index/src/scalar/inverted/index/token_set.rs:340-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) rust/lance-index/src/vector/bq/builder.rs:837 — rust/lance-index/src/vector/bq/builder.rs:837-847 | rust/lance-index/src/vector/bq/builder.rs:912-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-index/src/vector/bq/builder.rs:911` calls `rabit_ex_bits` and `rust/lance-index/src/vector/bq/builder.rs:834` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) rust/lance-index/src/vector/bq/ex_dot.rs:815 — rust/lance-index/src/vector/bq/ex_dot.rs:815-825 | rust/lance-index/src/vector/bq/ex_dot.rs:1568-1578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/ex_dot.rs:815` it begins part-way through the construct above it, so those exact lines 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/lance-index/src/vector/pq/distance.rs:60 — rust/lance-index/src/vector/pq/distance.rs:60-70 | rust/lance-index/src/vector/pq/distance.rs:135-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/pq/distance.rs:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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/lance-io/src/object_store/providers/oss.rs:54 — rust/lance-io/src/object_store/providers/oss.rs:54-64 | rust/lance-io/src/object_store/providers/tos.rs:61-71 — before extracting anything, compare `rust/lance-io/src/object_store/providers/oss.rs` and `rust/lance-io/src/object_store/providers/tos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/lance-io/src/object_store/providers/oss.rs:54` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-jsonb/src/functions/scalar.rs:503 — rust/lance-jsonb/src/functions/scalar.rs:503-513 | rust/lance-jsonb/src/functions/scalar.rs:594-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/functions/scalar.rs:503` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rust/lance-jsonb/src/jsonpath/parser.rs:86 — rust/lance-jsonb/src/jsonpath/parser.rs:86-96 | rust/lance-jsonb/src/jsonpath/parser.rs:128-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/jsonpath/parser.rs:86` it does not close everything it opens, so those exact lines 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/lance-jsonb/src/jsonpath/selector.rs:403 — rust/lance-jsonb/src/jsonpath/selector.rs:403-413 | rust/lance-jsonb/src/jsonpath/selector.rs:415-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-jsonb/src/jsonpath/selector.rs:401` calls `Owned` and `rust/lance-jsonb/src/jsonpath/selector.rs:413` 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/lance-namespace-impls/src/dir/manifest.rs:650 — rust/lance-namespace-impls/src/dir/manifest.rs:650-660 | rust/lance-namespace-impls/src/dir/manifest.rs:732-742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:650` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:3180 — rust/lance-namespace-impls/src/dir/manifest.rs:3180-3190 | rust/lance-namespace-impls/src/dir/manifest.rs:3775-3785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:3180` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-namespace-impls/src/dir/manifest.rs:3413 — rust/lance-namespace-impls/src/dir/manifest.rs:3413-3423 | rust/lance-namespace-impls/src/dir/manifest.rs:4060-4071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:3413` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/mem_wal/hnsw/graph.rs:496 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:496-506 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:533-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.
  • + 30 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×55
  • Duplicated block (7 lines × 2) java/lance-jni/src/session.rs:370 — java/lance-jni/src/session.rs:370-376 | java/lance-jni/src/session.rs:413-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) python/src/dataset.rs:3327 — python/src/dataset.rs:3327-3333 | python/src/dataset.rs:3363-3369 — both copies are in the same file, so extract the 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, `python/src/dataset.rs:3370` calls `parse_str`, `map_err`, `new_err` and `python/src/dataset.rs:3334` 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) python/src/dataset/merge_insert.rs:411 — python/src/dataset/merge_insert.rs:411-417 | python/src/dataset/sql.rs:216-222 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) python/src/dataset/optimize.rs:529 — python/src/dataset/optimize.rs:529-535 | python/src/dataset/optimize.rs:563-569 — both copies are in the same file, so extract the 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) python/src/mem_wal.rs:526 — python/src/mem_wal.rs:526-532 | python/src/mem_wal.rs:547-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/lance-encoding/src/array_encoding/logical/list.rs:1340 — rust/lance-encoding/src/array_encoding/logical/list.rs:1340-1346 | rust/lance-encoding/src/array_encoding/logical/list.rs:1349-1355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/array_encoding/logical/list.rs:1340` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/decoder.rs:1410 — rust/lance-encoding/src/decoder.rs:1410-1416 | rust/lance-encoding/src/decoder.rs:1476-1482 — both copies are in the same file, so extract the 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/lance-encoding/src/encodings/logical/primitive/sparse/dictionary.rs:258 — rust/lance-encoding/src/encodings/logical/primitive/sparse/dictionary.rs:258-264 | rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:777-783 — 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/lance-encoding/src/encodings/logical/primitive/sparse/dictionary.rs:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust/lance-encoding/src/statistics.rs:560 — rust/lance-encoding/src/statistics.rs:560-566 | rust/lance-encoding/src/statistics.rs:575-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/statistics.rs:560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust/lance-file/src/versions/v1/encoding/binary.rs:74 — rust/lance-file/src/versions/v1/encoding/binary.rs:74-80 | rust/lance-file/src/versions/v1/writer/mod.rs:566-572 — 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/lance-file/src/versions/v1/encoding/binary.rs:74` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/versions/v2_0/writer.rs:899 — rust/lance-file/src/versions/v2_0/writer.rs:899-905 | rust/lance-file/src/writer/structural.rs:879-886 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/versions/v2_0/writer.rs:899` it begins part-way through the construct above it, so those exact lines 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/lance-geo/src/rtree/sort/hilbert_sort.rs:218 — rust/lance-geo/src/rtree/sort/hilbert_sort.rs:218-224 | rust/lance-geo/src/rtree/sort/hilbert_sort.rs:227-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:658 — rust/lance-index/src/scalar/bloomfilter.rs:658-664 | rust/lance-index/src/scalar/zonemap.rs:1406-1412 — before extracting anything, compare `rust/lance-index/src/scalar/bloomfilter.rs` and `rust/lance-index/src/scalar/zonemap.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/lance-index/src/scalar/bloomfilter.rs:658` it does not close everything it opens, so those exact lines 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/lance-index/src/scalar/btree.rs:1033 — rust/lance-index/src/scalar/btree.rs:1033-1039 | rust/lance-index/src/scalar/btree.rs:1055-1061 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/btree.rs:1033` it does not close everything it opens, so those exact lines 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/lance-index/src/scalar/inverted/cross_column.rs:221 — rust/lance-index/src/scalar/inverted/cross_column.rs:221-227 | rust/lance-index/src/scalar/inverted/wand/doc_source.rs:186-192 — 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/lance-index/src/scalar/inverted/cross_column.rs:221` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/inverted/index/flat_search.rs:62 — rust/lance-index/src/scalar/inverted/index/flat_search.rs:62-68 | rust/lance-index/src/scalar/inverted/index/flat_search.rs:88-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/flat_search.rs:62` it does not close everything it opens, so those exact lines 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/lance-index/src/vector/bq/dist_table_quant.rs:73 — rust/lance-index/src/vector/bq/dist_table_quant.rs:73-82 | rust/lance-index/src/vector/bq/dist_table_quant.rs:110-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `quantized_dist_table` to `&mut Vec<u8>` in one and `&mut Vec<u16>` 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/lance-index/src/vector/graph.rs:627 — rust/lance-index/src/vector/graph.rs:627-633 | rust/lance-index/src/vector/graph.rs:656-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/lance-index/src/vector/kmeans.rs:1878 — rust/lance-index/src/vector/kmeans.rs:1878-1884 | rust/lance-index/src/vector/kmeans.rs:1998-2004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/kmeans.rs:1998` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/vector/pq/storage.rs:325 — rust/lance-index/src/vector/pq/storage.rs:325-332 | rust/lance-index/src/vector/pq/storage.rs:696-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/pq/storage.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 (7 lines × 2) rust/lance-linalg/src/distance/hamming.rs:799 — rust/lance-linalg/src/distance/hamming.rs:799-805 | rust/lance-linalg/src/distance/hamming.rs:881-887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-linalg/src/distance/hamming.rs:799` it does not close everything it opens, so those exact lines 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/lance-namespace-impls/src/dir/manifest.rs:1361 — rust/lance-namespace-impls/src/dir/manifest.rs:1361-1367 | rust/lance-namespace-impls/src/dir/manifest.rs:1469-1475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:1361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:1904 — rust/lance-namespace-impls/src/dir/manifest.rs:1904-1910 | rust/lance-namespace-impls/src/dir/manifest.rs:1946-1952 — both copies are in the same file, so extract the 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/lance-namespace-impls/src/dir/manifest.rs:2509 — rust/lance-namespace-impls/src/dir/manifest.rs:2509-2515 | rust/lance-namespace-impls/src/dir/manifest.rs:2887-2893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:2509` it does not close everything it opens, so those exact lines 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/lance-select/src/mask.rs:684 — rust/lance-select/src/mask.rs:684-690 | rust/lance-select/src/mask.rs:1232-1238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-select/src/mask.rs:684` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 30 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×52
  • TooManyMethods: Dataset java/src/main/java/org/lance/Dataset.java:91 — TooManyMethods — 229 methods. The bar is 30 methods; this is 199 over it, 7.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Dataset rust/lance/src/dataset.rs:256 — TooManyMethods — 185 methods, declared across 9 files: src/dataset.rs (160), index/loading.rs (10), dataset/deletions.rs (3), dataset/files.rs (3), +5 more file(s). The bar is 30 methods; this is 155 over it, 6.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Scanner rust/lance/src/dataset/scanner.rs:494 — TooManyMethods — 177 methods, declared across 8 files: scanner/builder.rs (66), scanner/plan.rs (28), scanner/fts.rs (26), scanner/source.rs (25), +4 more file(s). The bar is 30 methods; this is 147 over it, 5.90× 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: Dataset python/src/dataset.rs:313 — TooManyMethods — 136 methods. The bar is 30 methods; this is 106 over it, 4.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DirectoryNamespace java/src/main/java/org/lance/namespace/DirectoryNamespace.java:238 — TooManyMethods — 112 methods. The bar is 30 methods; this is 82 over it, 3.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: RestNamespace java/src/main/java/org/lance/namespace/RestNamespace.java:154 — TooManyMethods — 111 methods. The bar is 30 methods; this is 81 over it, 3.70× 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: LanceDataset python/python/lance/dataset.py:145 — TooManyMethods — 102 methods. The bar is 30 methods; this is 72 over it, 3.40× 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: ManifestNamespace rust/lance-namespace-impls/src/dir/manifest.rs:974 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× 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: IvfQuantizationStorage rust/lance-index/src/vector/storage.rs:1375 — TooManyMethods — 69 methods, declared across 2 files: vector/storage.rs (68), storage/prewarm.rs (1). The bar is 30 methods; this is 39 over it, 2.30× 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: DirectoryNamespace rust/lance-namespace-impls/src/dir.rs:169 — TooManyMethods — 67 methods, declared across 7 files: dir/resolve.rs (37), dir/versions.rs (9), dir/transactions.rs (6), dir/index_params.rs (5), +3 more file(s). The bar is 30 methods; this is 37 over it, 2.23× 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: InvertedIndex rust/lance-index/src/scalar/inverted/index/inverted_index.rs:23 — TooManyMethods — 64 methods, declared across 2 files: index/inverted_index.rs (35), index/search.rs (29). The bar is 30 methods; this is 34 over it, 2.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ObjectStore rust/lance-io/src/object_store.rs:261 — TooManyMethods — 64 methods, declared across 3 files: src/object_store.rs (60), object_store/local_staging.rs (2), object_store/read_dir.rs (2). The bar is 30 methods; this is 34 over it, 2.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FileFragment rust/lance/src/dataset/fragment.rs:142 — TooManyMethods — 64 methods, declared across 2 files: dataset/fragment.rs (59), fragment/aligned_update.rs (5). The bar is 30 methods; this is 34 over it, 2.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DirectoryNamespace python/python/lance/namespace.py:275 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RestNamespace python/python/lance/namespace.py:970 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PyDirectoryNamespace python/src/namespace.rs:122 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PyRestNamespace python/src/namespace.rs:872 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PostingListReader rust/lance-index/src/scalar/inverted/index/posting_reader.rs:83 — TooManyMethods — 55 methods, declared across 2 files: index/posting_reader.rs (31), index/posting_prewarm.rs (24). The bar is 30 methods; this is 25 over it, 1.83× 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: Wand rust/lance-index/src/scalar/inverted/wand.rs:266 — TooManyMethods — 55 methods, declared across 7 files: wand/disjunction.rs (23), inverted/wand.rs (12), wand/conjunction.rs (9), wand/phrase.rs (4), +3 more file(s). The bar is 30 methods; this is 25 over it, 1.83× 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: MemTable rust/lance/src/dataset/mem_wal/memtable.rs:64 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.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: FileReader rust/lance-file/src/reader.rs:460 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FtsMemIndex rust/lance/src/dataset/mem_wal/index/fts.rs:1334 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Schema rust/lance-core/src/datatypes/schema.rs:30 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Field rust/lance-core/src/datatypes/field.rs:137 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MemTableScanner rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:533 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 27 more in this group — see findings.md.
D2 · Cognitive Complexity · lance_index · ×48
  • lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cognitive 308) rust/lance-index/src/vector/distributed/index_merger.rs:868 — lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner has cognitive complexity 308 (threshold 15). Drivers by points: if/else 101 (257 pts), match/switch 8 (21 pts), loops 8 (16 pts), boolean chains 14 (nesting depth added 177). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::graph::beam_search_acorn (cognitive 89) rust/lance-index/src/vector/graph.rs:590 — lance_index::vector::graph::beam_search_acorn has cognitive complexity 89 (threshold 15). Drivers by points: if/else 22 (71 pts), loops 6 (15 pts), boolean chains 3 (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.
  • lance_index::scalar::zonemap::validate_seed (cognitive 51) rust/lance-index/src/scalar/zonemap.rs:3362 — lance_index::scalar::zonemap::validate_seed has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 10, match/switch 3 (5 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.
  • lance_index::vector::bq::ex_dot::unpack_group (cognitive 36) rust/lance-index/src/vector/bq/ex_dot.rs:215 — lance_index::vector::bq::ex_dot::unpack_group has cognitive complexity 36 (threshold 15). Drivers by points: loops 13 (33 pts), if/else 1 (2 pts), match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal (cognitive 36) rust/lance-index/src/vector/distributed/index_merger.rs:107 — lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::inverted::combined::maxscore::combined_maxscore (cognitive 35) rust/lance-index/src/scalar/inverted/combined/maxscore.rs:60 — lance_index::scalar::inverted::combined::maxscore::combined_maxscore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::inverted::index::flat_search::tokenize_and_count (cognitive 35) rust/lance-index/src/scalar/inverted/index/flat_search.rs:234 — lance_index::scalar::inverted::index::flat_search::tokenize_and_count has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 7 (10 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::flat::index::search_candidates_with_scratch (cognitive 32) rust/lance-index/src/vector/flat/index.rs:110 — lance_index::vector::flat::index::search_candidates_with_scratch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (12 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.
  • lance_index::scalar::inverted::cross_column::collect_local_generator_candidates (cognitive 31) rust/lance-index/src/scalar/inverted/cross_column.rs:952 — lance_index::scalar::inverted::cross_column::collect_local_generator_candidates has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 3 (6 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.
  • lance_index::scalar::zonemap::parse_seed_for_binary_copy (cognitive 30) rust/lance-index/src/scalar/zonemap.rs:3016 — lance_index::scalar::zonemap::parse_seed_for_binary_copy has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 3, match/switch 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::distributed::index_merger::read_shard_window_partitions (cognitive 30) rust/lance-index/src/vector/distributed/index_merger.rs:728 — lance_index::vector::distributed::index_merger::read_shard_window_partitions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config (cognitive 29) rust/lance-index/src/scalar/fmindex.rs:1781 — lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (8 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.
  • lance_index::scalar::tuple::planner::plan (cognitive 29) rust/lance-index/src/scalar/tuple/planner.rs:178 — lance_index::scalar::tuple::planner::plan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 4, match/switch 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::bq::transform::compute_raw_query_factors (cognitive 29) rust/lance-index/src/vector/bq/transform.rs:301 — lance_index::vector::bq::transform::compute_raw_query_factors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::inverted::cross_column::score_generator_candidates (cognitive 28) rust/lance-index/src/scalar/inverted/cross_column.rs:1064 — lance_index::scalar::inverted::cross_column::score_generator_candidates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::inverted::wand::bounds::exclusive_partial_score_limit (cognitive 28) rust/lance-index/src/scalar/inverted/wand/bounds.rs:67 — lance_index::scalar::inverted::wand::bounds::exclusive_partial_score_limit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::hnsw::remap::remap_graph_batch (cognitive 28) rust/lance-index/src/vector/hnsw/remap.rs:129 — lance_index::vector::hnsw::remap::remap_graph_batch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::inverted::cross_column::score_cross_column_sources (cognitive 26) rust/lance-index/src/scalar/inverted/cross_column.rs:1180 — lance_index::scalar::inverted::cross_column::score_cross_column_sources has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 6 (8 pts), match/switch 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::bq::dist_table_quant::min_max_fold (cognitive 26) rust/lance-index/src/vector/bq/dist_table_quant.rs:207 — lance_index::vector::bq::dist_table_quant::min_max_fold has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::hnsw::remap::fill_holes (cognitive 26) rust/lance-index/src/vector/hnsw/remap.rs:353 — lance_index::vector::hnsw::remap::fill_holes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::pairwise::collect_pairs (cognitive 26) rust/lance-index/src/vector/pairwise.rs:247 — lance_index::vector::pairwise::collect_pairs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (9 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.
  • lance_index::vector::hnsw::builder::connect_stranded_level0 (cognitive 25) rust/lance-index/src/vector/hnsw/builder.rs:1034 — lance_index::vector::hnsw::builder::connect_stranded_level0 has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (9 pts), match/switch 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.
  • lance_index::scalar::inverted::index::flat_search::tokenize_and_count_list (cognitive 23) rust/lance-index/src/scalar/inverted/index/flat_search.rs:478 — lance_index::scalar::inverted::index::flat_search::tokenize_and_count_list has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::inverted::wand::phrase::exact_phrase_scan (cognitive 22) rust/lance-index/src/scalar/inverted/wand/phrase.rs:148 — lance_index::scalar::inverted::wand::phrase::exact_phrase_scan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 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.
  • lance_index::scalar::tuple::planner::key_ranges (cognitive 22) rust/lance-index/src/scalar/tuple/planner.rs:305 — lance_index::scalar::tuple::planner::key_ranges has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (9 pts), loops 3 (7 pts), if/else 2 (5 pts), boolean chains 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.
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×47
  • Duplicated block (5 lines × 2) java/lance-jni/src/blocking_dataset/refs.rs:212 — java/lance-jni/src/blocking_dataset/refs.rs:212-216 | java/lance-jni/src/blocking_dataset/refs.rs:509-514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/blocking_dataset/refs.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.
  • Duplicated block (5 lines × 2) java/lance-jni/src/blocking_dataset/refs.rs:263 — java/lance-jni/src/blocking_dataset/refs.rs:263-267 | java/lance-jni/src/blocking_dataset/refs.rs:433-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/blocking_dataset/refs.rs:263` it begins part-way through the construct above it, so those exact lines 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) python/src/dataset/merge_insert.rs:205 — python/src/dataset/merge_insert.rs:205-210 | python/src/dataset/merge_insert.rs:289-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/dataset/merge_insert.rs:205` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-core/src/cache/telemetry.rs:763 — rust/lance-core/src/cache/telemetry.rs:763-767 | rust/lance-core/src/cache/telemetry.rs:786-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/lance-core/src/cache/telemetry.rs:763` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rust/lance-datagen/src/generator.rs:2753 — rust/lance-datagen/src/generator.rs:2753-2757 | rust/lance-datagen/src/generator.rs:2781-2785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-datagen/src/generator.rs:2753` it does not close everything it opens, so those 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/lance-datagen/src/generator.rs:2758` calls `new_known_size` and `rust/lance-datagen/src/generator.rs:2786` 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/lance-encoding/src/encodings/physical/fsst.rs:341 — rust/lance-encoding/src/encodings/physical/fsst.rs:341-345 | rust/lance-encoding/src/encodings/physical/fsst.rs:348-352 — both copies are in the same file, so extract the 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/lance-index/src/scalar/fmindex.rs:1111 — rust/lance-index/src/scalar/fmindex.rs:1111-1115 | rust/lance-index/src/scalar/fmindex.rs:2175-2179 — both copies are in the same file, so extract the 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/lance-index/src/scalar/ngram.rs:1670 — rust/lance-index/src/scalar/ngram.rs:1670-1674 | rust/lance-index/src/scalar/ngram.rs:1677-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.
  • Duplicated block (5 lines × 2) rust/lance-index/src/scalar/zonemap.rs:2746 — rust/lance-index/src/scalar/zonemap.rs:2746-2750 | rust/lance-index/src/scalar/zonemap.rs:3249-3253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/zonemap.rs:2746` it does not close everything it opens, so those exact 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/lance-index/src/vector/bq/dist_table_quant.rs:398 — rust/lance-index/src/vector/bq/dist_table_quant.rs:398-402 | rust/lance-index/src/vector/bq/dist_table_quant.rs:433-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/lance-index/src/vector/storage.rs:238 — rust/lance-index/src/vector/storage.rs:238-242 | rust/lance-index/src/vector/storage.rs:277-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/storage.rs:238` it begins part-way through the construct above it, so those exact lines 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/lance-jsonb/src/core/ser.rs:100 — rust/lance-jsonb/src/core/ser.rs:100-104 | rust/lance-jsonb/src/core/ser.rs:173-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/core/ser.rs:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:889 — rust/lance-linalg/src/simd/dist_table.rs:889-895 | rust/lance-linalg/src/simd/dist_table.rs:900-904 — both copies are in the same file, so extract the 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/lance-linalg/src/simd/f32.rs:437 — rust/lance-linalg/src/simd/f32.rs:437-441 | rust/lance-linalg/src/simd/f32.rs:947-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-linalg/src/simd/f32.rs:437` it begins part-way through the construct above it, so those exact lines 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/lance-linalg/src/simd/f64.rs:287 — rust/lance-linalg/src/simd/f64.rs:287-291 | rust/lance-linalg/src/simd/f64.rs:740-744 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-linalg/src/simd/f64.rs:287` it begins part-way through the construct above it, so those exact lines 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/lance-namespace-impls/src/dir/manifest.rs:2466 — rust/lance-namespace-impls/src/dir/manifest.rs:2466-2470 | rust/lance-namespace-impls/src/dir/manifest.rs:2846-2850 — both copies are in the same file, so extract the 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/lance-select/src/mask/nullable.rs:297 — rust/lance-select/src/mask/nullable.rs:297-301 | rust/lance-select/src/mask/nullable.rs:308-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-select/src/mask/nullable.rs:297` it does not close everything it opens, so those exact lines 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/lance-select/src/mask/nullable.rs:345 — rust/lance-select/src/mask/nullable.rs:345-350 | rust/lance-select/src/mask/nullable.rs:359-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-select/src/mask/nullable.rs:345` it does not close everything it opens, so those exact lines 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/lance-table/src/rowids/segment.rs:695 — rust/lance-table/src/rowids/segment.rs:695-699 | rust/lance-table/src/rowids/segment.rs:734-738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/rowids/segment.rs:695` it does not close everything it opens, so those exact lines 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/lance-table/src/rowids/serde.rs:212 — rust/lance-table/src/rowids/serde.rs:212-216 | rust/lance-table/src/rowids/serde.rs:229-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/rowids/serde.rs:212` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) rust/lance/src/dataset.rs:1033 — rust/lance/src/dataset.rs:1033-1037 | rust/lance/src/dataset.rs:1065-1069 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset.rs:1033` it does not close everything it opens, so those exact lines 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/lance/src/dataset/mem_wal/scanner/builder.rs:923 — rust/lance/src/dataset/mem_wal/scanner/builder.rs:923-927 | rust/lance/src/dataset/mem_wal/scanner/exec/pk_block_filter.rs:206-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/scanner/builder.rs:923` it does not close everything it opens, so those exact lines 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/lance/src/dataset/mem_wal/scanner/fts_search.rs:1330 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1330-1337 | rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1453-1457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1330` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/dataset/optimize/binary_copy/seed_carry.rs:67 — rust/lance/src/dataset/optimize/binary_copy/seed_carry.rs:67-75 | rust/lance/src/dataset/write/seeds.rs:175-179 — 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/lance/src/dataset/optimize/binary_copy/seed_carry.rs:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) rust/lance/src/dataset/update_join.rs:280 — rust/lance/src/dataset/update_join.rs:280-284 | rust/lance/src/dataset/update_join.rs:360-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/update_join.rs:280` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×45
  • Duplicated block (13 lines × 2) java/lance-jni/src/file_reader.rs:114 — java/lance-jni/src/file_reader.rs:114-126 | java/lance-jni/src/file_writer.rs:97-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/file_reader.rs:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) java/lance-jni/src/namespace.rs:1914 — java/lance-jni/src/namespace.rs:1914-1926 | java/lance-jni/src/namespace.rs:2865-2877 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/namespace.rs:1914` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/array_encoding/logical/list.rs:1155 — rust/lance-encoding/src/array_encoding/logical/list.rs:1155-1167 | rust/lance-encoding/src/array_encoding/logical/list.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/lance-encoding/src/array_encoding/logical/list.rs:1155` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:274 — rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:274-286 | rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:316-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:274` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:176 — rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:176-188 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:209-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:176` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:936 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:936-948 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1025-1037 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:936` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/binary.rs:760 — rust/lance-encoding/src/encodings/physical/binary.rs:760-772 | rust/lance-encoding/src/encodings/physical/binary.rs:807-819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/binary.rs:760` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/binary.rs:1039 — rust/lance-encoding/src/encodings/physical/binary.rs:1039-1051 | rust/lance-encoding/src/encodings/physical/binary.rs:1082-1094 — both copies are in the same file, so extract the 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/lance-encoding/src/encodings/physical/byte_stream_split.rs:510 — rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:510-522 | rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:624-636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:510` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/rle.rs:1305 — rust/lance-encoding/src/encodings/physical/rle.rs:1305-1317 | rust/lance-encoding/src/encodings/physical/rle.rs:1378-1390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/rle.rs:1305` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-file/src/reader.rs:1533 — rust/lance-file/src/reader.rs:1533-1545 | rust/lance-file/src/reader.rs:1612-1624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/reader.rs:1533` it does not close everything it opens, so those exact lines 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/lance-file/src/reader.rs:1693 — rust/lance-file/src/reader.rs:1693-1705 | rust/lance-file/src/reader.rs:2114-2126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/reader.rs:1693` it does not close everything it opens, so those exact lines 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/lance-file/src/versions/v2_0/writer.rs:907 — rust/lance-file/src/versions/v2_0/writer.rs:907-919 | rust/lance-file/src/writer/structural.rs:888-900 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:1917 — rust/lance-index/src/scalar/inverted/builder.rs:1917-1929 | rust/lance-index/src/scalar/inverted/builder.rs:1958-1970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/builder.rs:1917` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) rust/lance-index/src/scalar/inverted/compound.rs:181 — rust/lance-index/src/scalar/inverted/compound.rs:181-193 | rust/lance-index/src/scalar/inverted/wand/bounds.rs:173-185 — 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 (13 lines × 2) rust/lance-index/src/vector.rs:523 — rust/lance-index/src/vector.rs:523-535 | rust/lance/src/index/vector/ivf/v2/partition_search.rs:222-234 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:304 — rust/lance-index/src/vector/distributed/index_merger.rs:304-316 | rust/lance-index/src/vector/distributed/index_merger.rs:345-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/distributed/index_merger.rs:304` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-io/src/object_store/providers/azure.rs:204 — rust/lance-io/src/object_store/providers/azure.rs:204-216 | rust/lance-io/src/object_store/providers/gcp.rs:286-298 — before extracting anything, compare `rust/lance-io/src/object_store/providers/azure.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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/lance-io/src/object_store/providers/azure.rs:204` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-io/src/object_store/providers/azure.rs:320 — rust/lance-io/src/object_store/providers/azure.rs:320-332 | rust/lance-io/src/object_store/providers/gcp.rs:358-370 — before extracting anything, compare `rust/lance-io/src/object_store/providers/azure.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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/lance-io/src/object_store/providers/azure.rs:320` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-linalg/src/simd/f32.rs:225 — rust/lance-linalg/src/simd/f32.rs:225-237 | rust/lance-linalg/src/simd/f64.rs:118-130 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 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/lance-linalg/src/simd/f32.rs:225` it begins part-way through the construct above it, so those exact 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 `ptr` to `*const f32` in one and `*const f64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:3252 — rust/lance-namespace-impls/src/dir/manifest.rs:3252-3264 | rust/lance-namespace-impls/src/dir/manifest.rs:3374-3386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:3252` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-table/src/format/fragment.rs:470 — rust/lance-table/src/format/fragment.rs:470-482 | rust/lance-table/src/format/fragment.rs:932-944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/format/fragment.rs:470` it begins part-way through the construct above it, so those exact lines 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/lance-table/src/transaction/manifest_build.rs:948 — rust/lance-table/src/transaction/manifest_build.rs:948-960 | rust/lance-table/src/transaction/manifest_build.rs:1234-1246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1310 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1310-1322 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:692-704 — 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 lines × 2) rust/lance/src/dataset/mem_wal/scanner/projection.rs:109 — rust/lance/src/dataset/mem_wal/scanner/projection.rs:109-121 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:171-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/scanner/projection.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.
  • + 20 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×43
  • Duplicated block (12 lines × 2) python/src/indices.rs:462 — python/src/indices.rs:462-473 | python/src/indices.rs:644-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/lance-encoding/src/data.rs:1158 — rust/lance-encoding/src/data.rs:1158-1169 | rust/lance-encoding/src/data.rs:1374-1385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:190 — rust/lance-encoding/src/encodings/logical/primitive/blob.rs:190-201 | rust/lance-encoding/src/encodings/logical/primitive/blob.rs:540-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:326 — rust/lance-encoding/src/encodings/logical/primitive/dict.rs:326-337 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:594-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/dict.rs:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1900 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1900-1911 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1930-1941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1900` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1996 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1996-2007 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2012-2023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1996` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:688 — rust/lance-encoding/src/encodings/physical/alp.rs:688-699 | rust/lance-encoding/src/encodings/physical/alp.rs:715-726 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) rust/lance-encoding/src/encodings/physical/delta.rs:81 — rust/lance-encoding/src/encodings/physical/delta.rs:81-92 | rust/lance-encoding/src/encodings/physical/delta.rs:102-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/delta.rs:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/rle.rs:1883 — rust/lance-encoding/src/encodings/physical/rle.rs:1883-1894 | rust/lance-encoding/src/encodings/physical/rle.rs:2072-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/lance-encoding/src/encodings/physical/rle.rs:1883` it does not close everything it opens, so those exact lines 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/lance-file/src/reader/structural.rs:232 — rust/lance-file/src/reader/structural.rs:232-243 | rust/lance-file/src/versions/v2_0/reader.rs:189-200 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (12 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:78 — rust/lance-file/src/versions/v2_0/writer.rs:78-89 | rust/lance-file/src/writer/structural.rs:61-72 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (12 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:96 — rust/lance-file/src/versions/v2_0/writer.rs:96-107 | rust/lance-file/src/writer/structural.rs:79-90 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (12 lines × 2) rust/lance-file/src/versions/v2_1/reader.rs:168 — rust/lance-file/src/versions/v2_1/reader.rs:168-179 | rust/lance-file/src/versions/v2_2/reader.rs:170-181 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) rust/lance-index/src/scalar/inverted/wand/posting.rs:1094 — rust/lance-index/src/scalar/inverted/wand/posting.rs:1094-1105 | rust/lance-index/src/scalar/inverted/wand/posting.rs:1140-1151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/wand/posting.rs:1094` it does not close everything it opens, so those exact 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 `self` to `super) fn next(&mut` in one and `super) fn next_doc_id(&mut` 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/lance-index/src/vector/bq/storage.rs:836 — rust/lance-index/src/vector/bq/storage.rs:836-847 | rust/lance-index/src/vector/bq/storage.rs:875-886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/storage.rs:836` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rust/lance-index/src/vector/flat/index.rs:263 — rust/lance-index/src/vector/flat/index.rs:263-274 | rust/lance-index/src/vector/flat/index.rs:448-459 — both copies are in the same file, so extract the 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/lance-index/src/vector/flat/index.rs:275` calls `with_capacity` and `rust/lance-index/src/vector/flat/index.rs:460` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) rust/lance-index/src/vector/hnsw/builder.rs:672 — rust/lance-index/src/vector/hnsw/builder.rs:672-683 | rust/lance-index/src/vector/hnsw/builder.rs:686-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/hnsw/builder.rs:672` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-io/src/object_store.rs:1751 — rust/lance-io/src/object_store.rs:1751-1762 | rust/lance-io/src/object_store.rs:1881-1892 — both copies are in the same file, so extract the 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/lance-io/src/object_store.rs:1750` calls `current`, `record` and `rust/lance-io/src/object_store.rs:1880` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) rust/lance-linalg/src/kernels.rs:359 — rust/lance-linalg/src/kernels.rs:359-370 | rust/lance-linalg/src/kernels.rs:373-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) rust/lance-linalg/src/simd/f32.rs:307 — rust/lance-linalg/src/simd/f32.rs:307-318 | rust/lance-linalg/src/simd/f32.rs:800-811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-linalg/src/simd/f32.rs:307` it begins part-way through the construct above it, so those exact lines 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/lance-namespace-impls/src/dir/manifest.rs:156 — rust/lance-namespace-impls/src/dir/manifest.rs:156-167 | rust/lance-namespace-impls/src/dir/manifest.rs:194-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2923 — rust/lance-namespace-impls/src/dir/manifest.rs:2923-2934 | rust/lance-namespace-impls/src/dir/manifest.rs:2959-2970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:3192 — rust/lance-namespace-impls/src/dir/manifest.rs:3192-3203 | rust/lance-namespace-impls/src/dir/manifest.rs:3787-3798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:3192` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/lance-namespace-impls/src/dir/manifest.rs:3206` calls `get_string_column` and `rust/lance-namespace-impls/src/dir/manifest.rs:3801` 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/lance-table/src/format/key_existence.rs:453 — rust/lance-table/src/format/key_existence.rs:453-464 | rust/lance-table/src/format/key_existence.rs:467-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/format/key_existence.rs:453` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/datafusion/dataframe.rs:206 — rust/lance/src/datafusion/dataframe.rs:206-217 | REDACTED:105-116 — 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/lance/src/datafusion/dataframe.rs:206` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×37
  • Edited copy of a member (9 corresponding lines) python/src/dataset.rs:802 — python/src/dataset.rs:802-815 | python/src/dataset.rs:3440-3448 — 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/lance-index/src/vector/bq/ex_dot.rs:1022 — rust/lance-index/src/vector/bq/ex_dot.rs:1022-1030 | rust/lance-index/src/vector/bq/ex_dot.rs:1630-1638 — 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/lance/src/io/exec/utils.rs:697 — rust/lance/src/io/exec/utils.rs:697-705 | rust/lance/src/io/exec/utils.rs:725-733 — 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) java/lance-jni/src/blocking_blob.rs:180 — java/lance-jni/src/blocking_blob.rs:180-188 | java/lance-jni/src/blocking_blob.rs:207-215 — 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/lance-core/src/cache/telemetry.rs:805 — rust/lance-core/src/cache/telemetry.rs:805-815 | rust/lance-core/src/cache/telemetry.rs:823-831 — 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/lance-index/src/scalar/inverted/encoding.rs:297 — rust/lance-index/src/scalar/inverted/encoding.rs:297-306 | rust/lance-index/src/scalar/inverted/encoding.rs:318-326 — 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/lance-namespace-impls/src/rest.rs:1070 — rust/lance-namespace-impls/src/rest.rs:1070-1078 | rust/lance-namespace-impls/src/rest.rs:1140-1148 — 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/lance-index/src/scalar/inverted/encoding.rs:1182 — rust/lance-index/src/scalar/inverted/encoding.rs:1182-1191 | rust/lance-index/src/scalar/inverted/encoding.rs:1197-1205 — 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/lance/src/dataset/mem_wal/scanner/projection.rs:67 — rust/lance/src/dataset/mem_wal/scanner/projection.rs:67-75 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:82-90 — 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/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1028 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1028-1036 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:878-887 — 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) java/src/main/java/org/lance/ipc/FullTextQuery.java:417 — java/src/main/java/org/lance/ipc/FullTextQuery.java:417-425 | java/src/main/java/org/lance/ipc/FullTextQuery.java:513-521 — 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) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:923 — java/src/main/java/org/lance/namespace/DirectoryNamespace.java:923-931 | java/src/main/java/org/lance/namespace/RestNamespace.java:830-838 — 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/lance-io/src/object_store/providers/oss.rs:98 — rust/lance-io/src/object_store/providers/oss.rs:98-106 | rust/lance-io/src/object_store/providers/tos.rs:104-112 — 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/lance-index/src/scalar/btree.rs:2626 — rust/lance-index/src/scalar/btree.rs:2626-2635 | rust/lance-index/src/scalar/zonemap.rs:842-850 — 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/lance-index/src/scalar/inverted/query.rs:1215 — rust/lance-index/src/scalar/inverted/query.rs:1215-1223 | rust/lance-index/src/scalar/inverted/query.rs:1229-1245 — 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) java/src/main/java/org/lance/index/optimize/OptimizeIndexMerge.java:56 — java/src/main/java/org/lance/index/optimize/OptimizeIndexMerge.java:56-64 | java/src/main/java/org/lance/index/optimize/OptimizeIndices.java:95-104 — 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/lance/src/bin/fm_contains_bench.rs:165 — rust/lance/src/bin/fm_contains_bench.rs:165-173 | rust/lance/src/bin/fm_index_tool.rs:54-62 — 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/lance/src/dataset/fragment.rs:2541 — rust/lance/src/dataset/fragment.rs:2541-2552 | rust/lance/src/dataset/fragment/session.rs:73-81 — 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/lance-index/src/scalar/inverted/cross_column.rs:195 — rust/lance-index/src/scalar/inverted/cross_column.rs:195-203 | rust/lance-index/src/scalar/inverted/wand/doc_source.rs:163-171 — 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/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:66 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:66-74 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:60-68 — 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) python/src/dataset/optimize.rs:301 — python/src/dataset/optimize.rs:301-312 | python/src/dataset/optimize_indices.rs:133-141 — 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/lance-index/src/scalar/inverted/compound.rs:1873 — rust/lance-index/src/scalar/inverted/compound.rs:1873-1887 | rust/lance-index/src/scalar/inverted/wand.rs:353-361 — 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) java/lance-jni/src/mem_wal.rs:415 — java/lance-jni/src/mem_wal.rs:415-424 | java/lance-jni/src/mem_wal.rs:532-540 — 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) java/src/main/java/org/lance/memwal/ShardWriter.java:65 — java/src/main/java/org/lance/memwal/ShardWriter.java:65-73 | java/src/main/java/org/lance/memwal/LsmScanner.java:61-69 — 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/lance/src/dataset/mem_wal/index/fts.rs:1776 — rust/lance/src/dataset/mem_wal/index/fts.rs:1776-1786 | rust/lance/src/dataset/mem_wal/index/fts.rs:1791-1799 — 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.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×37
  • Duplicated block (14 lines × 2) java/lance-jni/src/otel.rs:88 — java/lance-jni/src/otel.rs:88-101 | python/src/otel.rs:135-148 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (14 lines × 2) python/src/dataset.rs:999 — python/src/dataset.rs:999-1012 | python/src/fragment.rs:331-344 — before extracting anything, compare `python/src/dataset.rs` and `python/src/fragment.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/dataset.rs:999` it begins part-way through the construct above it, so those exact lines 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/compression/fsst/src/fsst.rs:86 — rust/compression/fsst/src/fsst.rs:86-99 | rust/compression/fsst/src/fsst.rs:104-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) rust/lance-core/src/cache/mod.rs:960 — rust/lance-core/src/cache/mod.rs:960-973 | rust/lance-core/src/cache/mod.rs:1107-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/lance-core/src/cache/mod.rs:960` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) rust/lance-core/src/utils/row_addr_remap.rs:582 — rust/lance-core/src/utils/row_addr_remap.rs:582-595 | rust/lance-core/src/utils/row_addr_remap.rs:603-616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-core/src/utils/row_addr_remap.rs:582` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact 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 `groups` to `impl IntoIterator<Item = GroupInput>` in one and `impl IntoIterator<Item = GroupInputWithLayout>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (14 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:416 — rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:416-429 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:1760-1773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) rust/lance-encoding/src/encodings/physical/binary.rs:774 — rust/lance-encoding/src/encodings/physical/binary.rs:774-787 | rust/lance-encoding/src/encodings/physical/binary.rs:821-834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/binary.rs:774` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/packed.rs:771 — rust/lance-encoding/src/encodings/physical/packed.rs:771-784 | rust/lance-encoding/src/encodings/physical/packed.rs:810-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/packed.rs:771` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-file/src/reader.rs:1386 — rust/lance-file/src/reader.rs:1386-1399 | rust/lance-file/src/reader.rs:1826-1839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/reader.rs:1386` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:713 — rust/lance-index/src/scalar/inverted/builder.rs:713-726 | rust/lance-index/src/scalar/inverted/builder.rs:798-811 — both copies are in the same file, so extract the 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/lance-index/src/scalar/inverted/index/partition.rs:904 — rust/lance-index/src/scalar/inverted/index/partition.rs:904-917 | rust/lance-index/src/scalar/inverted/index/partition.rs:942-955 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/partition.rs:904` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-index/src/scalar/inverted/wand/maxscore.rs:1439 — rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1439-1452 | rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1486-1499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1439` it begins part-way through the construct above it, so those exact lines 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/lance-index/src/vector/distributed/index_merger.rs:1596 — rust/lance-index/src/vector/distributed/index_merger.rs:1596-1609 | rust/lance-index/src/vector/distributed/index_merger.rs:1626-1639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/distributed/index_merger.rs:1596` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) rust/lance-index/src/vector/hnsw/builder.rs:428 — rust/lance-index/src/vector/hnsw/builder.rs:428-441 | rust/lance-index/src/vector/hnsw/builder.rs:608-621 — both copies are in the same file, so extract the 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/lance-index/src/vector/pq/distance.rs:36 — rust/lance-index/src/vector/pq/distance.rs:36-49 | rust/lance-index/src/vector/pq/distance.rs:114-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/pq/distance.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 (14 lines × 2) rust/lance-jsonb/src/jsonpath/selector.rs:282 — rust/lance-jsonb/src/jsonpath/selector.rs:282-295 | rust/lance-jsonb/src/jsonpath/selector.rs:736-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/jsonpath/selector.rs:282` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-linalg/src/simd/f64.rs:234 — rust/lance-linalg/src/simd/f64.rs:234-247 | rust/lance-linalg/src/simd/f64.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/lance-linalg/src/simd/f64.rs:234` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-linalg/src/simd/f64.rs:681` calls `vminq_f64` and `rust/lance-linalg/src/simd/f64.rs:233` 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/lance/src/bin/fm_contains_bench.rs:218 — rust/lance/src/bin/fm_contains_bench.rs:218-231 | rust/lance/src/bin/fm_index_tool.rs:70-83 — 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/lance/src/bin/fm_contains_bench.rs:218` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/dataset/blob/external.rs:155 — rust/lance/src/dataset/blob/external.rs:155-168 | rust/lance/src/dataset/blob/write.rs:1237-1250 — 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/lance/src/dataset/blob/managed.rs:87 — rust/lance/src/dataset/blob/managed.rs:87-100 | rust/lance/src/dataset/blob/managed.rs:103-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/blob/managed.rs:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/dataset/mem_wal/hnsw/graph.rs:897 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:897-910 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:986-999 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/hnsw/graph.rs:897` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) rust/lance/src/dataset/mem_wal/index/btree.rs:366 — rust/lance/src/dataset/mem_wal/index/btree.rs:366-379 | rust/lance/src/dataset/mem_wal/index/btree.rs:583-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/index/btree.rs:366` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/dataset/mem_wal/scanner/collector.rs:317 — rust/lance/src/dataset/mem_wal/scanner/collector.rs:317-330 | rust/lance/src/dataset/mem_wal/scanner/collector.rs:358-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/scanner/collector.rs:317` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/mem_wal/wal.rs:1315 — rust/lance/src/dataset/mem_wal/wal.rs:1315-1328 | rust/lance/src/dataset/mem_wal/wal.rs:1405-1418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/wal.rs:1315` it does not close everything it opens, so those exact lines 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/lance/src/dataset/optimize/planning.rs:1211 — rust/lance/src/dataset/optimize/planning.rs:1211-1224 | rust/lance/src/dataset/optimize/planning.rs:1563-1576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/optimize/planning.rs:1211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×35
  • Edited copy of a member (12 corresponding lines) rust/lance-file/src/versions/v1/encoding/binary.rs:417 — rust/lance-file/src/versions/v1/encoding/binary.rs:417-428 | rust/lance-file/src/versions/v1/encoding/plain.rs:428-439 — 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) java/src/main/java/org/lance/ipc/FullTextQuery.java:382 — java/src/main/java/org/lance/ipc/FullTextQuery.java:382-393 | java/src/main/java/org/lance/ipc/FullTextQuery.java:475-489 — 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/lance-index-core/src/scalar.rs:287 — rust/lance-index-core/src/scalar.rs:287-298 | rust/lance-index/src/scalar/lance_format.rs:238-255 — 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) java/src/main/java/org/lance/operation/UpdateConfig.java:181 — java/src/main/java/org/lance/operation/UpdateConfig.java:181-192 | java/src/main/java/org/lance/operation/UpdateConfig.java:218-229 — 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/lance-index/src/vector/bq/ex_dot.rs:183 — rust/lance-index/src/vector/bq/ex_dot.rs:183-194 | rust/lance-index/src/vector/bq/ex_dot.rs:198-211 — 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/compression/fsst/src/fsst.rs:284 — rust/compression/fsst/src/fsst.rs:284-295 | rust/compression/fsst/src/fsst.rs:299-310 — 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/lance-arrow/src/schema.rs:146 — rust/lance-arrow/src/schema.rs:146-157 | rust/lance-arrow/src/schema.rs:163-174 — 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/lance-core/src/cache/telemetry.rs:492 — rust/lance-core/src/cache/telemetry.rs:492-503 | rust/lance-core/src/cache/telemetry.rs:505-518 — 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/lance-index/src/scalar/inverted.rs:673 — rust/lance-index/src/scalar/inverted.rs:673-684 | rust/lance-index/src/scalar/inverted.rs:697-709 — 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/lance-namespace-impls/src/rest_adapter.rs:1155 — rust/lance-namespace-impls/src/rest_adapter.rs:1155-1166 | rust/lance-namespace-impls/src/rest_adapter.rs:1279-1290 — 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/lance-io/src/object_reader.rs:294 — rust/lance-io/src/object_reader.rs:294-305 | rust/lance-io/src/object_reader.rs:307-327 — 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) java/lance-jni/src/optimize_indices.rs:127 — java/lance-jni/src/optimize_indices.rs:127-138 | java/lance-jni/src/optimize_indices.rs:159-170 — 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/lance-index/src/scalar/fmindex.rs:2139 — rust/lance-index/src/scalar/fmindex.rs:2139-2150 | rust/lance-index/src/scalar/zonemap.rs:3735-3748 — 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) python/src/dataset/merge_insert.rs:347 — python/src/dataset/merge_insert.rs:347-358 | python/src/dataset/merge_insert.rs:360-371 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) rust/lance-index/src/scalar/inverted/wand.rs:519 — rust/lance-index/src/scalar/inverted/wand.rs:519-535 | rust/lance-index/src/scalar/inverted/wand.rs:539-550 — 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/lance-index/src/scalar/zonemap.rs:2209 — rust/lance-index/src/scalar/zonemap.rs:2209-2220 | rust/lance-index/src/scalar/zonemap.rs:2233-2248 — 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) python/src/mem_wal.rs:597 — python/src/mem_wal.rs:597-609 | python/src/mem_wal.rs:631-642 — 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/lance-core/src/container/list.rs:188 — rust/lance-core/src/container/list.rs:188-199 | rust/lance-core/src/container/list.rs:226-237 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) java/lance-jni/src/mem_wal.rs:1195 — java/lance-jni/src/mem_wal.rs:1195-1206 | python/src/mem_wal.rs:960-971 — 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/lance-table/src/format/fragment.rs:322 — rust/lance-table/src/format/fragment.rs:322-333 | rust/lance-table/src/format/fragment.rs:436-447 — 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/lance/src/io/exec/fts/compound.rs:976 — rust/lance/src/io/exec/fts/compound.rs:976-987 | rust/lance/src/io/exec/fts/compound.rs:1629-1640 — 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/lance-index/src/scalar/inverted/compound.rs:3111 — rust/lance-index/src/scalar/inverted/compound.rs:3111-3122 | rust/lance-index/src/scalar/inverted/compound.rs:3238-3249 — 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/lance/src/index/vector/ivf/v2.rs:3169 — rust/lance/src/index/vector/ivf/v2.rs:3169-3186 | rust/lance/src/index/vector/ivf/v2.rs:3194-3205 — 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/lance-io/src/object_reader.rs:233 — rust/lance-io/src/object_reader.rs:233-244 | rust/lance-io/src/object_reader.rs:611-622 — 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/lance-index/src/scalar/inverted/compound.rs:1006 — rust/lance-index/src/scalar/inverted/compound.rs:1006-1021 | rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:491-502 — 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.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×34
  • Duplicated block (16 lines × 2) java/lance-jni/src/mem_wal.rs:922 — java/lance-jni/src/mem_wal.rs:922-937 | python/src/mem_wal.rs:851-866 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `java/lance-jni/src/mem_wal.rs:922` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) rust/lance-arrow/src/json.rs:635 — rust/lance-arrow/src/json.rs:635-650 | rust/lance-arrow/src/json.rs:665-680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-arrow/src/json.rs:635` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/compression.rs:2219 — rust/lance-encoding/src/compression.rs:2219-2234 | rust/lance-encoding/src/compression.rs:2247-2262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/compression.rs:2219` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/logical/primitive/all_null.rs:909 — rust/lance-encoding/src/encodings/logical/primitive/all_null.rs:909-924 | rust/lance-encoding/src/encodings/logical/primitive/constant.rs:341-356 — 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 (16 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:886 — rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:886-901 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:928-943 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:886` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact 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 `self` to `crate) fn skip_validity(&mut` in one and `crate) fn unravel_validity(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:927` calls `append_to` and `rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:885` 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 (16 lines × 2) rust/lance-encoding/src/encodings/logical/struct.rs:537 — rust/lance-encoding/src/encodings/logical/struct.rs:537-552 | rust/lance-encoding/src/encodings/logical/struct.rs:616-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/struct.rs:537` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:1069 — rust/lance-encoding/src/encodings/physical/alp.rs:1069-1084 | rust/lance-encoding/src/encodings/physical/alp.rs:1142-1157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:1069` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:1236 — rust/lance-encoding/src/encodings/physical/alp.rs:1236-1251 | rust/lance-encoding/src/encodings/physical/alp.rs:1291-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:1236` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-encoding/src/encodings/physical/rle.rs:1853 — rust/lance-encoding/src/encodings/physical/rle.rs:1853-1868 | rust/lance-encoding/src/encodings/physical/rle.rs:2044-2059 — both copies are in the same file, so extract the 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/lance-file/src/reader/structural.rs:81 — rust/lance-file/src/reader/structural.rs:81-96 | rust/lance-file/src/versions/v2_0/reader.rs:76-91 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/reader/structural.rs:81` it does not close everything it opens, so those exact lines 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/lance-file/src/reader/structural.rs:125 — rust/lance-file/src/reader/structural.rs:125-140 | rust/lance-file/src/versions/v2_0/reader.rs:104-119 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/reader/structural.rs:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) rust/lance-file/src/versions/v1/writer/mod.rs:522 — rust/lance-file/src/versions/v1/writer/mod.rs:522-537 | rust/lance-file/src/versions/v1/writer/mod.rs:571-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v1/writer/mod.rs:522` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-geo/src/query.rs:131 — rust/lance-geo/src/query.rs:131-146 | rust/lance-geo/src/query.rs:148-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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/lance-index/src/scalar/inverted/index/partition.rs:1132 — rust/lance-index/src/scalar/inverted/index/partition.rs:1132-1147 | rust/lance-index/src/scalar/inverted/index/partition.rs:1260-1275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/partition.rs:1132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/lance-index/src/scalar/inverted/index/partition.rs:1278` calls `new_with_block_size` and `rust/lance-index/src/scalar/inverted/index/partition.rs:1150` 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/lance-index/src/vector/flat/storage.rs:172 — rust/lance-index/src/vector/flat/storage.rs:172-187 | rust/lance-index/src/vector/flat/storage.rs:348-363 — both copies are in the same file, so extract the 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/lance-index/src/vector/flat/storage.rs:188` calls `cosine_norms_cache` and `rust/lance-index/src/vector/flat/storage.rs:364` 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 (16 lines × 2) rust/lance-io/src/scheduler.rs:206 — rust/lance-io/src/scheduler.rs:206-221 | rust/lance-io/src/scheduler/lite.rs:336-351 — 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 (16 lines × 2) rust/lance-io/src/uring/current_thread.rs:451 — rust/lance-io/src/uring/current_thread.rs:451-466 | rust/lance-io/src/uring/reader.rs:300-315 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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/lance-linalg/src/distance/dot.rs:130 — rust/lance-linalg/src/distance/dot.rs:130-145 | rust/lance-linalg/src/distance/l2.rs:1008-1023 — 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 (16 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:1099 — rust/lance-linalg/src/simd/dist_table.rs:1099-1114 | rust/lance-linalg/src/simd/dist_table.rs:1349-1364 — both copies are in the same file, so extract the 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/lance-linalg/src/simd/f32.rs:705 — rust/lance-linalg/src/simd/f32.rs:705-720 | rust/lance-linalg/src/simd/f64.rs:550-565 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 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/lance-linalg/src/simd/f32.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `ptr` to `*const f32` in one and `*const f64` 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/lance-namespace-impls/src/dir/manifest.rs:1984 — rust/lance-namespace-impls/src/dir/manifest.rs:1984-1999 | rust/lance-namespace-impls/src/dir/manifest.rs:2008-2023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:1984` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-table/src/rowids/index.rs:1171 — rust/lance-table/src/rowids/index.rs:1171-1186 | rust/lance-table/src/rowids/index.rs:1231-1246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) rust/lance/src/dataset/builder.rs:330 — rust/lance/src/dataset/builder.rs:330-345 | rust/lance/src/dataset/builder.rs:360-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/builder.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 (16 lines × 2) rust/lance/src/dataset/cleanup.rs:2806 — rust/lance/src/dataset/cleanup.rs:2806-2821 | rust/lance/src/index/frag_reuse.rs:2529-2544 — 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/lance/src/dataset/cleanup.rs:2806` it does not close everything it opens, so those exact lines 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/lance/src/dataset/mem_wal/index/fts.rs:2389 — rust/lance/src/dataset/mem_wal/index/fts.rs:2389-2404 | rust/lance/src/dataset/mem_wal/index/fts.rs:2482-2497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×33
  • Edited copy of a member (11 corresponding lines) rust/lance/src/dataset/update_join.rs:1111 — rust/lance/src/dataset/update_join.rs:1111-1126 | rust/lance/src/dataset/update_join.rs:1132-1142 — 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/lance-encoding/src/encodings/physical/alp/restore.rs:150 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:150-164 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:173-183 — 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/lance-table/src/rowids/encoded_array.rs:37 — rust/lance-table/src/rowids/encoded_array.rs:37-47 | rust/lance-table/src/rowids/encoded_array.rs:243-253 — 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/lance-io/src/object_store/metrics.rs:565 — rust/lance-io/src/object_store/metrics.rs:565-581 | rust/lance/src/dataset/mem_wal/scanner/exec/generation_tag.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/lance/src/dataset/blob/locate.rs:459 — rust/lance/src/dataset/blob/locate.rs:459-469 | rust/lance/src/dataset/blob/locate.rs:482-492 — 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) java/src/main/java/org/lance/Dataset.java:2119 — java/src/main/java/org/lance/Dataset.java:2119-2129 | java/src/main/java/org/lance/Dataset.java:2138-2150 — 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) python/src/namespace.rs:1456 — python/src/namespace.rs:1456-1467 | python/src/namespace.rs:1473-1483 — 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/lance/src/dataset/mem_wal/index/fts.rs:4021 — rust/lance/src/dataset/mem_wal/index/fts.rs:4021-4031 | rust/lance/src/dataset/mem_wal/index/fts.rs:4082-4097 — 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/lance-namespace-impls/src/rest_adapter.rs:551 — rust/lance-namespace-impls/src/rest_adapter.rs:551-561 | rust/lance-namespace-impls/src/rest_adapter.rs:639-649 — 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) python/src/dataset/merge_insert.rs:86 — python/src/dataset/merge_insert.rs:86-96 | python/src/dataset/merge_insert.rs:117-127 — 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/lance-index/src/scalar/inverted/index/search_candidates.rs:229 — rust/lance-index/src/scalar/inverted/index/search_candidates.rs:229-239 | rust/lance-index/src/scalar/inverted/index/search_candidates.rs:246-256 — 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/lance-index/src/scalar/bloomfilter.rs:865 — rust/lance-index/src/scalar/bloomfilter.rs:865-875 | rust/lance-index/src/scalar/zonemap.rs:1696-1707 — 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/lance-select/src/mask/nullable.rs:191 — rust/lance-select/src/mask/nullable.rs:191-201 | rust/lance-select/src/mask/nullable.rs:205-216 — 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/lance/src/dataset/mem_wal/sharding.rs:280 — rust/lance/src/dataset/mem_wal/sharding.rs:280-290 | rust/lance/src/dataset/mem_wal/sharding.rs:292-302 — 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/lance/src/blob.rs:198 — rust/lance/src/blob.rs:198-208 | rust/lance/src/blob.rs:246-256 — 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/lance-core/src/cache/mod.rs:349 — rust/lance-core/src/cache/mod.rs:349-359 | rust/lance-core/src/cache/mod.rs:368-378 — 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) python/src/file.rs:760 — python/src/file.rs:760-770 | python/src/file.rs:791-803 — 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/lance-jsonb/src/core/de.rs:549 — rust/lance-jsonb/src/core/de.rs:549-559 | rust/lance-jsonb/src/core/de.rs:844-858 — 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/lance-linalg/src/kernels.rs:281 — rust/lance-linalg/src/kernels.rs:281-291 | rust/lance-linalg/src/kernels.rs:343-353 — 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/lance-core/src/memory/telemetry.rs:159 — rust/lance-core/src/memory/telemetry.rs:159-170 | rust/lance-core/src/memory/telemetry.rs:173-183 — 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) java/lance-jni/src/blocking_dataset/read.rs:492 — java/lance-jni/src/blocking_dataset/read.rs:492-502 | java/lance-jni/src/blocking_dataset/read.rs:684-694 — 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) java/lance-jni/src/otel.rs:75 — java/lance-jni/src/otel.rs:75-85 | python/src/otel.rs:119-130 — 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/lance-index/src/scalar/label_list.rs:137 — rust/lance-index/src/scalar/label_list.rs:137-147 | rust/lance-index/src/scalar/label_list.rs:156-167 — 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/lance-io/src/object_reader.rs:624 — rust/lance-io/src/object_reader.rs:624-634 | rust/lance-io/src/object_reader.rs:636-646 — 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/lance-core/src/datatypes/field.rs:524 — rust/lance-core/src/datatypes/field.rs:524-534 | rust/lance-core/src/datatypes/field.rs:536-546 — 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×32
  • Edited copy of a member (13 corresponding lines) java/lance-jni/src/mem_wal.rs:170 — java/lance-jni/src/mem_wal.rs:170-182 | java/lance-jni/src/mem_wal.rs:193-205 — 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/lance-geo/src/rtree.rs:796 — rust/lance-geo/src/rtree.rs:796-808 | rust/lance-index/src/scalar/btree.rs:2885-2897 — 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/lance/src/dataset/refs.rs:208 — rust/lance/src/dataset/refs.rs:208-220 | rust/lance/src/dataset/refs.rs:639-651 — 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) java/src/main/java/org/lance/Dataset.java:1857 — java/src/main/java/org/lance/Dataset.java:1857-1869 | java/src/main/java/org/lance/Dataset.java:1883-1896 — 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) java/lance-jni/src/namespace.rs:107 — java/lance-jni/src/namespace.rs:107-119 | java/lance-jni/src/utils.rs:612-627 — 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/lance-core/src/cache/telemetry.rs:762 — rust/lance-core/src/cache/telemetry.rs:762-777 | rust/lance-core/src/cache/telemetry.rs:785-797 — 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/lance-index/src/scalar/btree.rs:1032 — rust/lance-index/src/scalar/btree.rs:1032-1044 | rust/lance-index/src/scalar/btree.rs:1054-1066 — 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/lance/src/dataset/write/merge_insert/exec/in_place.rs:83 — rust/lance/src/dataset/write/merge_insert/exec/in_place.rs:83-96 | rust/lance/src/dataset/write/merge_insert/logical_plan.rs:82-94 — 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/lance-encoding/src/repdef.rs:2605 — rust/lance-encoding/src/repdef.rs:2605-2617 | rust/lance-encoding/src/repdef.rs:2621-2636 — 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) python/src/dataset/merge_insert.rs:377 — python/src/dataset/merge_insert.rs:377-389 | python/src/dataset/merge_insert.rs:391-404 — 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/lance/src/dataset/mem_wal/scanner/point_lookup.rs:357 — rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:357-371 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:532-544 — 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/lance-namespace-datafusion/src/catalog.rs:39 — rust/lance-namespace-datafusion/src/catalog.rs:39-51 | rust/lance-namespace-datafusion/src/catalog.rs:98-110 — 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/lance-io/src/spill.rs:191 — rust/lance-io/src/spill.rs:191-203 | rust/lance-io/src/spill.rs:221-235 — 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/lance-datafusion/src/substrait.rs:57 — rust/lance-datafusion/src/substrait.rs:57-69 | rust/lance/src/dataset/updater/blanks.rs:740-752 — 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) python/src/dataset.rs:4087 — python/src/dataset.rs:4087-4099 | python/src/dataset.rs:4137-4156 — 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/lance-core/src/utils/deletion.rs:84 — rust/lance-core/src/utils/deletion.rs:84-97 | rust/lance-core/src/utils/deletion.rs:360-372 — 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/lance-io/src/utils/tracking_store.rs:363 — rust/lance-io/src/utils/tracking_store.rs:363-375 | rust/lance-io/src/utils/tracking_store.rs:377-389 — 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:589 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:589-601 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:650-662 — 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/lance-datafusion/src/spill.rs:84 — rust/lance-datafusion/src/spill.rs:84-96 | rust/lance-datafusion/src/spill.rs:109-121 — 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/lance/src/io/exec/table_identifier.rs:21 — rust/lance/src/io/exec/table_identifier.rs:21-33 | rust/lance/src/io/exec/table_identifier.rs:40-53 — 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/lance-index/src/scalar/inverted/compound.rs:150 — rust/lance-index/src/scalar/inverted/compound.rs:150-162 | rust/lance-index/src/scalar/inverted/compound.rs:164-177 — 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) java/lance-jni/src/schema.rs:15 — java/lance-jni/src/schema.rs:15-32 | java/lance-jni/src/schema.rs:78-90 — 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/lance-datafusion/src/projection.rs:464 — rust/lance-datafusion/src/projection.rs:464-476 | rust/lance-datafusion/src/projection.rs:479-491 — 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/lance-datagen/src/generator.rs:2641 — rust/lance-datagen/src/generator.rs:2641-2653 | rust/lance-datagen/src/generator.rs:2676-2688 — 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/lance-jsonb/src/parser.rs:189 — rust/lance-jsonb/src/parser.rs:189-201 | rust/lance-jsonb/src/parser.rs:204-216 — 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.
  • + 7 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×30
  • Repeated repair: rust/lance/src/io/commit/conflict_resolver.rs rust/lance/src/io/commit/conflict_resolver.rs:430 — rust/lance/src/io/commit/conflict_resolver.rs changed 43 times in last 90 days and 27 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is UntaggedReuse::withdraw_folded_overlays at line 430), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(index): use read snapshot for cleanup coverage checks (#10916)”; “fix(clustering): restore brings back the target's definitions, keeping only the allocation mark (#10629)”; “fix(index): withdraw stale coverage after transaction cleanup (#10663)”; “fix: reject primary-key inserts with missing transaction history (#10665)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/io/commit/conflict_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.
  • Repeated repair: rust/lance-index/src/scalar/expression.rs rust/lance-index/src/scalar/expression.rs:976 — rust/lance-index/src/scalar/expression.rs changed 17 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is LabelListQueryParser::visit_scalar_function at line 976), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(index): keep FM substring queries correct for NUL and space patterns (#10794)”; “fix(index): recheck contains_tokens rows from an FTS index and skip queries it cannot narrow (#10571)”; “fix: ignore zero and NaN sign bits in filters”; “fix: return every non-null row for contains(col, '') with an FM index (#10275)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-index/src/scalar/expression.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.
  • Repeated repair: rust/lance-linalg/src/distance.rs rust/lance-linalg/src/distance.rs:117 — rust/lance-linalg/src/distance.rs changed 14 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is lance_linalg::distance::half_backend at line 117), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linalg): unify Arrow distance dispatch (#10085)”; “fix(linalg): point length-contract panics at the distance function (#8864)”; “fix(linalg): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): reject a null Int8 query instead of panicking (#8884)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-linalg/src/distance.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.
  • Repeated repair: rust/lance/src/dataset/fragment/write.rs rust/lance/src/dataset/fragment/write.rs:46 — rust/lance/src/dataset/fragment/write.rs changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is lance::dataset::fragment::write::generate_random_filename at line 46), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(compaction): avoid materializing blob payload batches (#10696)”; “fix(blob): promote legacy blob input to v2 on fragment and update writes (#10586)”; “fix: start a new data file before a dictionary outgrows its key type (#10368)”; “fix: delete files written by merge_insert analyze_plan (#9869)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/fragment/write.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.
  • Repeated repair: rust/lance-encoding/src/encodings/logical/struct.rs rust/lance-encoding/src/encodings/logical/struct.rs:265 — rust/lance-encoding/src/encodings/logical/struct.rs changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is StructuralStructDecoder::field_to_decoder at line 265), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(encoding): count validity per list, not per item, when a batch spans pages (#10338)”; “fix(encoding): auto-batch top-level primitive and struct dictionaries”; “fix(dataset): validate nested schema names and stored system columns (#9499)”; “fix: write nullable structs that contain a Null-typed field (#9579)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-encoding/src/encodings/logical/struct.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.
  • Repeated repair: rust/lance-io/src/object_writer.rs rust/lance-io/src/object_writer.rs:400 — rust/lance-io/src/object_writer.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ObjectWriter::poll_tasks at line 400), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(io): add optional local fsync and identify corrupt files (#9609)”; “fix(io): remove dependency on unreleased object_store (#10363)”; “fix(io): avoid hanging and spurious Pending in ObjectWriter::poll_write (#9996)”; “fix(io): reject zero multipart upload concurrency (#9756)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-io/src/object_writer.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.
  • Repeated repair: rust/lance-tokenizer/src/stop_word_filter.rs rust/lance-tokenizer/src/stop_word_filter.rs:188 — rust/lance-tokenizer/src/stop_word_filter.rs changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is StopWordFilterStream::advance at line 188), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fts): preserve Greek content and polarity (#10050)”; “fix(fts): preserve Korean content and numeric tokens (#10048)”; “fix(fts): preserve Tamil content and numeric terms (#10052)”; “fix(fts): preserve Russian content and numeric terms (#10051)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-tokenizer/src/stop_word_filter.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.
  • Repeated repair: rust/lance-table/src/transaction/operation.rs rust/lance-table/src/transaction/operation.rs:422 — rust/lance-table/src/transaction/operation.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is RewriteGroup::eq at line 422), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: prevent metadata loss from concurrent column projections (#10512)”; “fix: move inline transaction to a new manifest field (#9482)”; “fix: assign fragment and row ids to new fragments in Merge commits (#7706)”; “fix: preserve fragment reuse mappings across concurrent maintenance (#9620)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-table/src/transaction/operation.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.
  • Repeated repair: rust/lance-encoding/src/encodings/logical/primitive/field.rs rust/lance-encoding/src/encodings/logical/primitive/field.rs:581 — rust/lance-encoding/src/encodings/logical/primitive/field.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is lance_encoding::encodings::logical::primitive::field::for_each_page_range at line 581), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(file): return errors instead of panicking on malformed files (#10334)”; “fix(encoding): auto-batch top-level primitive and struct dictionaries”; “fix(encoding): restore 2.0 scan speed by sending indirect reads early (#9903)”; “fix(encoding): sort a lone unsorted batched read (#10036)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-encoding/src/encodings/logical/primitive/field.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.
  • Repeated repair: rust/lance-index/src/scalar/inverted/query.rs rust/lance-index/src/scalar/inverted/query.rs:1302 — rust/lance-index/src/scalar/inverted/query.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is lance_index::scalar::inverted::query::fill_fts_query_column at line 1302), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fts): require all ngrams in AND queries (#10476)”; “fix: make MultiMatchQuery serde lossless (#9753)”; “fix(fts): prevent overflow for unordered token positions (#9017)”; “fix(fts): validate JSON index queries and targets (#8813)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-index/src/scalar/inverted/query.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.
  • Repeated repair: rust/lance-io/src/object_store/providers/local.rs rust/lance-io/src/object_store/providers/local.rs:76 — rust/lance-io/src/object_store/providers/local.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is lance_io::object_store::providers::local::windows::extract_unc_path at line 76), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cleanup): remove orphaned local staging files (#10591)”; “fix(dataset): clean deleted branches from shared directories (#10489)”; “fix(io): add optional local fsync and identify corrupt files (#9609)”; “fix(io): remove dependency on unreleased object_store (#10363)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-io/src/object_store/providers/local.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.
  • Repeated repair: rust/lance-linalg/src/distance/cosine.rs rust/lance-linalg/src/distance/cosine.rs:345 — rust/lance-linalg/src/distance/cosine.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is lance_linalg::distance::cosine::cosine_batch_f32_portable at line 345), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(scanner): support fragment-scoped vector search with postfilters”; “fix(linalg): unify Arrow distance dispatch (#10085)”; “fix(linalg): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): reject a null Int8 query instead of panicking (#8884)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-linalg/src/distance/cosine.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.
  • Repeated repair: rust/lance/src/dataset/write/insert.rs rust/lance/src/dataset/write/insert.rs:340 — rust/lance/src/dataset/write/insert.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is InsertBuilder::validate_write at line 340), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(compaction): avoid materializing blob payload batches (#10696)”; “fix: start a new data file before a dictionary outgrows its key type (#10368)”; “fix: delete files written by merge_insert analyze_plan (#9869)”; “fix(dataset): validate nested schema names and stored system columns (#9499)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/write/insert.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.
  • Repeated repair: rust/lance-encoding/src/array_encoding/logical/primitive.rs rust/lance-encoding/src/array_encoding/logical/primitive.rs:380 — rust/lance-encoding/src/array_encoding/logical/primitive.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is PrimitiveFieldDecoder::max_rows_to_drain at line 380), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(encoding): account for compacted slices in page buffers (#10344)”; “fix(encoding): auto-batch top-level primitive and struct dictionaries”; “fix(encoding): restore 2.0 scan speed by sending indirect reads early (#9903)”; “fix(encoding): split legacy decode batches before i32 offset overflow (#9225)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-encoding/src/array_encoding/logical/primitive.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.
  • Repeated repair: rust/lance/src/dataset/mem_wal/hnsw/graph.rs rust/lance/src/dataset/mem_wal/hnsw/graph.rs:1023 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is HnswGraph::visit_published_neighbors at line 1023), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: align mem-wal HNSW construction (#8238)”; “fix(mem_wal): give the memtable graph the beam a refined search gives a flushed generation (#10185)”; “fix(mem_wal): keep repeated vectors reachable in the memtable HNSW graph (#10186)”; “fix(hnsw): make a persisted HNSW cover its rows and reject invalid ones (#8834)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/mem_wal/hnsw/graph.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.
  • Repeated repair: rust/lance-encoding/src/encoder.rs rust/lance-encoding/src/encoder.rs:416 — rust/lance-encoding/src/encoder.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is lance_encoding::encoder::encode_batch at line 416), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(encoding): reject fixed-size lists of strings and binaries instead of panicking (#10460)”; “fix(encoding): account for compacted slices in page buffers (#10344)”; “fix: reject lossy null structs in v2.0 (#8507)”; “fix(encoding): validate variable-width Arrow offsets (#8382)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-encoding/src/encoder.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.
  • Repeated repair: rust/lance-linalg/src/simd/i32.rs rust/lance-linalg/src/simd/i32.rs:232 — rust/lance-linalg/src/simd/i32.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is i32x8::find at line 232), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linalg): make SIMD slice conversions baseline-safe (#8874)”; “fix(linalg): build on architectures without SIMD kernels (#9446)”; “fix(linalg): use a lane-wise intrinsic for i32x8 multiplication on x86 (#8579)”; “fix(linalg): validate slice lengths before SIMD loads (#8593)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-linalg/src/simd/i32.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.
  • Repeated repair: rust/lance/src/dataset/metadata.rs rust/lance/src/dataset/metadata.rs:73 — rust/lance/src/dataset/metadata.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is UpdateMetadataBuilder::into_future at line 73), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: apply chained field metadata updates for one field in order (#11033)”; “fix(table): detect schema-metadata conflicts per key (#9975)”; “fix: validate primary key nullability on every path that can change it (#8101)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/metadata.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.
  • Repeated repair: rust/lance-encoding/src/array_encoding/logical/list.rs rust/lance-encoding/src/array_encoding/logical/list.rs:214 — rust/lance-encoding/src/array_encoding/logical/list.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is lance_encoding::array_encoding::logical::list::decode_offsets at line 214), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(encoding): restore 2.0 scan speed by sending indirect reads early (#9903)”; “fix: return actionable errors for binary/string offset overflow (#9403)”; “fix(encoding): split legacy decode batches before i32 offset overflow (#9225)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-encoding/src/array_encoding/logical/list.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.
  • Repeated repair: rust/lance-table/src/format/overlay/staleness.rs rust/lance-table/src/format/overlay/staleness.rs:35 — rust/lance-table/src/format/overlay/staleness.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is lance_table::format::overlay::staleness::overlay_exclusion_offsets at line 35), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(index): unify snapshot-scoped overlay visibility”; “fix(index): include covering fields in index dependency checks (#10345)”; “fix(commit): let a deferred rewrite exempt a reindex across processes on untagged FRI tables (#9808)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-table/src/format/overlay/staleness.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.
  • Repeated repair: python/python/lance/sampler.py python/python/lance/sampler.py:117 — python/python/lance/sampler.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is sampler._filtered_efficient_sample at line 117), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(python): correct sampling and bound selection memory (#10845)”; “fix(python): honor set_epoch in sharded samplers (#9636)”; “fix(python): make maybe_sample return the requested number of rows (#9637)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- python/python/lance/sampler.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: rust/lance/src/dataset/hash_joiner.rs rust/lance/src/dataset/hash_joiner.rs:60 — rust/lance/src/dataset/hash_joiner.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is HashJoiner::try_new_impl at line 60), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: reject a merge or update whose right side has only the join key (#11030)”; “fix(dataset): reject duplicate right-side merge keys”; “fix: reject unsupported nulls in the `add_columns` stream path (#9239)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance/src/dataset/hash_joiner.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.
  • Repeated repair: rust/lance-index/src/vector/ivf/shuffler.rs rust/lance-index/src/vector/ivf/shuffler.rs:655 — rust/lance-index/src/vector/ivf/shuffler.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is IvfShuffler::shuffle_to_partitions at line 655), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(index): reject a zero target partition size and out-of-range precomputed partition ids (#10322)”; “fix(index): keep the trailing rows when shuffling a v2 buffer (#9246)”; “fix(index): make IVF buffer setter safe (#8602)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-index/src/vector/ivf/shuffler.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.
  • Repeated repair: rust/lance-namespace-impls/src/dir/resolve.rs rust/lance-namespace-impls/src/dir/resolve.rs:131 — rust/lance-namespace-impls/src/dir/resolve.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is DirectoryNamespace::apply_pagination at line 131), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: stop opening a damaged manifest as an empty dataset (#10585)”; “fix(dataset): reserve branch names before cloning”; “fix(namespace): honor the requested branch in directory table operations”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-namespace-impls/src/dir/resolve.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.
  • Repeated repair: rust/lance-encoding/src/array_encoding/logical/struct.rs rust/lance-encoding/src/array_encoding/logical/struct.rs:433 — rust/lance-encoding/src/array_encoding/logical/struct.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is ChildState::max_rows_to_drain at line 433), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(encoding): auto-batch top-level primitive and struct dictionaries”; “fix(encoding): merge page dictionaries exactly when a batch spans pages (#10286)”; “fix(encoding): split legacy decode batches before i32 offset overflow (#9225)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 18:27:54 +01:00' --until='2026-11-14 18:27:54 +01:00' --full-history --no-merges -- rust/lance-encoding/src/array_encoding/logical/struct.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.
  • + 5 more in this group — see findings.md.
D2 · Cognitive Complexity · lance_encoding · ×30
  • lance_encoding::encodings::physical::alp::encode_chunk_f64_rd (cognitive 55) rust/lance-encoding/src/encodings/physical/alp.rs:1644 — lance_encoding::encodings::physical::alp::encode_chunk_f64_rd has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 11 (26 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::logical::primitive::fullzip_decode::structure::read_row (cognitive 54) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode/structure.rs:201 — lance_encoding::encodings::logical::primitive::fullzip_decode::structure::read_row has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (44 pts), boolean chains 6, match/switch 1 (3 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::physical::axis_delta::x86_64::transform_width (cognitive 50) rust/lance-encoding/src/encodings/physical/axis_delta/x86_64.rs:90 — lance_encoding::encodings::physical::axis_delta::x86_64::transform_width has cognitive complexity 50 (threshold 15). Drivers by points: loops 10 (29 pts), if/else 10 (18 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 28). 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.
  • lance_encoding::encodings::logical::primitive::sparse::planar::encode (cognitive 44) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:249 — lance_encoding::encodings::logical::primitive::sparse::planar::encode has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 9, match/switch 3 (5 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_encoding::encodings::physical::alp::transform_chunk_f32_avx2 (cognitive 44) rust/lance-encoding/src/encodings/physical/alp.rs:797 — lance_encoding::encodings::physical::alp::transform_chunk_f32_avx2 has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 6 (14 pts), boolean chains 4 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::transform_chunk_f64_avx2) 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.
  • lance_encoding::encodings::physical::alp::transform_chunk_f64_avx2 (cognitive 44) rust/lance-encoding/src/encodings/physical/alp.rs:1031 — lance_encoding::encodings::physical::alp::transform_chunk_f64_avx2 has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 6 (14 pts), boolean chains 4 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::transform_chunk_f32_avx2) 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.
  • lance_encoding::encodings::logical::primitive::dict::dict_encode_variable_width (cognitive 39) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:267 — lance_encoding::encodings::logical::primitive::dict::dict_encode_variable_width has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (31 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::logical::primitive::sparse::select_position_set (cognitive 38) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:1724 — lance_encoding::encodings::logical::primitive::sparse::select_position_set has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (12 pts), match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock_range (cognitive 29) rust/lance-encoding/src/encodings/physical/binary.rs:692 — lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock_range has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6, loops 2 (4 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.
  • lance_encoding::encodings::logical::primitive::dict::dict_encode_fixed_scalar (cognitive 28) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:404 — lance_encoding::encodings::logical::primitive::dict::dict_encode_fixed_scalar has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::logical::primitive::planar::validate_page (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/planar.rs:277 — lance_encoding::encodings::logical::primitive::planar::validate_page has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::logical::primitive::sparse::writer::plan (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs:237 — lance_encoding::encodings::logical::primitive::sparse::writer::plan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (4 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.
  • lance_encoding::encodings::logical::primitive::dict::encode_fixed_rows (cognitive 25) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:566 — lance_encoding::encodings::logical::primitive::dict::encode_fixed_rows has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::compression::create_fixed_width_block_decompressor_inner (cognitive 24) rust/lance-encoding/src/compression.rs:1828 — lance_encoding::compression::create_fixed_width_block_decompressor_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (5 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.
  • lance_encoding::encodings::physical::alp::pack_chunk_f32_into (cognitive 24) rust/lance-encoding/src/encodings/physical/alp.rs:1330 — lance_encoding::encodings::physical::alp::pack_chunk_f32_into has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 5 (8 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::pack_chunk_f64_into) 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.
  • lance_encoding::encodings::physical::alp::pack_chunk_f64_into (cognitive 24) rust/lance-encoding/src/encodings/physical/alp.rs:1455 — lance_encoding::encodings::physical::alp::pack_chunk_f64_into has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 5 (8 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::pack_chunk_f32_into) 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.
  • lance_encoding::repdef::build_control_word_iterator (cognitive 22) rust/lance-encoding/src/repdef.rs:2775 — lance_encoding::repdef::build_control_word_iterator has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18 (21 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_encoding::encodings::logical::primitive::field::for_each_page_range (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive/field.rs:581 — lance_encoding::encodings::logical::primitive::field::for_each_page_range has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::physical::axis_delta::try_tensor_per_value (cognitive 19) rust/lance-encoding/src/encodings/physical/axis_delta.rs:374 — lance_encoding::encodings::physical::axis_delta::try_tensor_per_value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, loops 2 (3 pts), match/switch 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::physical::binary::build_generic_chunks (cognitive 19) rust/lance-encoding/src/encodings/physical/binary.rs:349 — lance_encoding::encodings::physical::binary::build_generic_chunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::physical::sequence::select_block_codec (cognitive 19) rust/lance-encoding/src/encodings/physical/sequence.rs:149 — lance_encoding::encodings::physical::sequence::select_block_codec has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::compression::try_variable_width_per_value (cognitive 18) rust/lance-encoding/src/compression.rs:999 — lance_encoding::compression::try_variable_width_per_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::logical::primitive::miniblock_decode::structure::read_chunks (cognitive 18) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode/structure.rs:13 — lance_encoding::encodings::logical::primitive::miniblock_decode::structure::read_chunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_encoding::encodings::physical::binary::chunk_offsets (cognitive 18) rust/lance-encoding/src/encodings/physical/binary.rs:90 — lance_encoding::encodings::physical::binary::chunk_offsets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_encoding::encodings::physical::sequence::symbolic_family (cognitive 18) rust/lance-encoding/src/encodings/physical/sequence.rs:231 — lance_encoding::encodings::physical::sequence::symbolic_family has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1, match/switch 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (inspect). 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.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×25
  • Edited copy of a member (10 corresponding lines) python/src/dataset.rs:2263 — python/src/dataset.rs:2263-2276 | python/src/dataset.rs:2278-2287 — 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/lance-index/src/scalar/inverted/cross_column.rs:215 — rust/lance-index/src/scalar/inverted/cross_column.rs:215-227 | rust/lance-index/src/scalar/inverted/wand/doc_source.rs:183-192 — 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) java/src/main/java/org/lance/index/vector/VectorTrainer.java:62 — java/src/main/java/org/lance/index/vector/VectorTrainer.java:62-71 | java/src/main/java/org/lance/index/vector/VectorTrainer.java:98-107 — 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/lance-linalg/src/distance/dot.rs:148 — rust/lance-linalg/src/distance/dot.rs:148-157 | rust/lance-linalg/src/distance/l2.rs:1034-1043 — 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/lance-encoding/src/encoder/structural.rs:142 — rust/lance-encoding/src/encoder/structural.rs:142-151 | rust/lance-encoding/src/encoder/structural.rs:159-168 — 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/lance-core/src/datatypes/schema.rs:1004 — rust/lance-core/src/datatypes/schema.rs:1004-1013 | rust/lance-core/src/datatypes/schema.rs:1055-1064 — 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/lance-linalg/src/distance/dot_u8.rs:199 — rust/lance-linalg/src/distance/dot_u8.rs:199-208 | rust/lance-linalg/src/distance/l2_u8.rs:206-215 — 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:224 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:224-233 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:237-246 — 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) python/src/dataset/merge_insert.rs:453 — python/src/dataset/merge_insert.rs:453-462 | python/src/dataset/merge_insert.rs:469-478 — 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/lance-encoding/src/encodings/logical/primitive/all_null.rs:1040 — rust/lance-encoding/src/encodings/logical/primitive/all_null.rs:1040-1053 | rust/lance-encoding/src/encodings/logical/primitive/constant.rs:461-470 — 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) java/src/main/java/org/lance/memwal/ShardWriter.java:92 — java/src/main/java/org/lance/memwal/ShardWriter.java:92-101 | java/src/main/java/org/lance/memwal/ShardWriter.java:120-129 — 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/lance-index-core/src/scalar.rs:868 — rust/lance-index-core/src/scalar.rs:868-877 | rust/lance-index/src/vector.rs:730-743 — 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/lance-index/src/vector/graph/builder.rs:36 — rust/lance-index/src/vector/graph/builder.rs:36-45 | rust/lance-index/src/vector/hnsw/online.rs:69-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/compression/bitpacking/src/simd_x86.rs:588 — rust/compression/bitpacking/src/simd_x86.rs:588-599 | rust/compression/bitpacking/src/simd_x86.rs:603-612 — 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/lance/src/io/exec/fts/query_tokens.rs:44 — rust/lance/src/io/exec/fts/query_tokens.rs:44-53 | rust/lance/src/io/exec/fts/query_tokens.rs:97-112 — 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) java/lance-jni/src/mem_wal.rs:1182 — java/lance-jni/src/mem_wal.rs:1182-1192 | python/src/mem_wal.rs:948-957 — 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) java/lance-jni/src/namespace.rs:1613 — java/lance-jni/src/namespace.rs:1613-1622 | java/lance-jni/src/namespace.rs:2564-2573 — 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/lance-table/src/io/commit/external_manifest.rs:746 — rust/lance-table/src/io/commit/external_manifest.rs:746-756 | rust/lance-table/src/io/commit.rs:1006-1015 — 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) memtest/src/allocator.rs:251 — memtest/src/allocator.rs:251-260 | memtest/src/allocator.rs:411-424 — 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/lance-namespace-impls/src/connect.rs:88 — rust/lance-namespace-impls/src/connect.rs:88-98 | rust/lance-namespace-impls/src/rest.rs:88-97 — 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) java/lance-jni/src/fragment.rs:1180 — java/lance-jni/src/fragment.rs:1180-1189 | java/lance-jni/src/utils.rs:694-703 — 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/lance-file/src/versions/v2_0/writer.rs:276 — rust/lance-file/src/versions/v2_0/writer.rs:276-296 | rust/lance-file/src/writer/structural.rs:247-256 — 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/lance-index/src/scalar/btree.rs:4439 — rust/lance-index/src/scalar/btree.rs:4439-4448 | rust/lance-index/src/scalar/ngram.rs:2076-2085 — 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/lance-index/src/vector/bq/builder.rs:1075 — rust/lance-index/src/vector/bq/builder.rs:1075-1085 | rust/lance-index/src/vector/bq/storage.rs:339-348 — 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/lance-index/src/vector/flat/index.rs:682 — rust/lance-index/src/vector/flat/index.rs:682-691 | rust/lance-index/src/vector/sq.rs:233-242 — 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.
D2 · Cognitive Complexity · Scanner · ×23
  • Scanner::vector_search (cognitive 106) rust/lance/src/dataset/scanner/vector.rs:145 — Scanner::vector_search has cognitive complexity 106 (threshold 15). Drivers by points: if/else 42 (83 pts), match/switch 5 (16 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::prefilter_source (cognitive 45) rust/lance/src/dataset/scanner/vector.rs:1565 — Scanner::prefilter_source has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 9 (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.
  • Scanner::plan_compound_scorer (cognitive 37) rust/lance/src/dataset/scanner/fts.rs:1175 — Scanner::plan_compound_scorer has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 8, 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.
  • Scanner::create_plan_impl (cognitive 37) rust/lance/src/dataset/scanner/plan.rs:827 — Scanner::create_plan_impl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 7, match/switch 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::plan_phrase_query (cognitive 32) rust/lance/src/dataset/scanner/fts.rs:1654 — Scanner::plan_phrase_query has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 4 (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.
  • Scanner::nearest (cognitive 30) rust/lance/src/dataset/scanner/builder.rs:828 — Scanner::nearest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (3 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.
  • Scanner::plan_match_query (cognitive 30) rust/lance/src/dataset/scanner/fts.rs:2016 — Scanner::plan_match_query has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (6 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::create_filter_plan (cognitive 30) rust/lance/src/dataset/scanner/plan.rs:560 — Scanner::create_filter_plan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::validate_options (cognitive 27) rust/lance/src/dataset/scanner/plan.rs:453 — Scanner::validate_options has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6 (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.
  • Scanner::knn_combined (cognitive 27) rust/lance/src/dataset/scanner/vector.rs:891 — Scanner::knn_combined has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::plan_corpus_query (cognitive 26) rust/lance/src/dataset/scanner/fts.rs:1835 — Scanner::plan_corpus_query has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 5 (7 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::plan_combined_fields_query (cognitive 26) rust/lance/src/dataset/scanner/fts.rs:2353 — Scanner::plan_combined_fields_query has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (15 pts), match/switch 3 (5 pts), loops 2 (4 pts), boolean chains 2 (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.
  • Scanner::fts_rerank (cognitive 26) rust/lance/src/dataset/scanner/fts.rs:2790 — Scanner::fts_rerank has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (2 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.
  • Scanner::calculate_final_projection (cognitive 26) rust/lance/src/dataset/scanner/plan.rs:153 — Scanner::calculate_final_projection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::legacy_filtered_read (cognitive 26) rust/lance/src/dataset/scanner/source.rs:226 — Scanner::legacy_filtered_read has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::new_filtered_read (cognitive 25) rust/lance/src/dataset/scanner/source.rs:400 — Scanner::new_filtered_read has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Scanner::scalar_indexed_scan (cognitive 20) rust/lance/src/dataset/scanner/source.rs:847 — Scanner::scalar_indexed_scan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Scanner::flat_knn (cognitive 20) rust/lance/src/dataset/scanner/vector.rs:1136 — Scanner::flat_knn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::fts_document_granularity (cognitive 19) rust/lance/src/dataset/scanner/fts.rs:815 — Scanner::fts_document_granularity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 7). None of this is in the body itself: all 19 points belong to 2 function items inside it that branch (visit, add_leaf). 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.
  • Scanner::plan_fts (cognitive 18) rust/lance/src/dataset/scanner/fts.rs:1417 — Scanner::plan_fts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::with_refine_column (cognitive 16) rust/lance/src/dataset/scanner/builder.rs:1159 — Scanner::with_refine_column has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Scanner::fragments_covered_by_fts_query_helper (cognitive 16) rust/lance/src/dataset/scanner/fts.rs:707 — Scanner::fragments_covered_by_fts_query_helper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 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.
  • Scanner::list_structure_modes (cognitive 16) rust/lance/src/dataset/scanner/list_structure.rs:114 — Scanner::list_structure_modes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 3). Of this number, 9 points are the body's own statements and 7 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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×23
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • 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 (14 corresponding lines) · ×23
  • Edited copy of a member (14 corresponding lines) rust/lance/src/index/vector.rs:2560 — rust/lance/src/index/vector.rs:2560-2575 | rust/lance/src/index/vector/ivf/v2.rs:2847-2860 — 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/lance-encoding/src/data.rs:1883 — rust/lance-encoding/src/data.rs:1883-1896 | rust/lance-encoding/src/data.rs:1917-1930 — 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) python/src/dataset/blob.rs:81 — python/src/dataset/blob.rs:81-94 | python/src/dataset/blob.rs:109-123 — 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/lance-arrow/src/json.rs:49 — rust/lance-arrow/src/json.rs:49-62 | rust/lance-arrow/src/json.rs:65-78 — 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) python/src/transaction.rs:222 — python/src/transaction.rs:222-235 | python/src/transaction.rs:414-427 — 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/lance-namespace-impls/src/rest_adapter.rs:1200 — rust/lance-namespace-impls/src/rest_adapter.rs:1200-1213 | rust/lance-namespace-impls/src/rest_adapter.rs:1334-1353 — 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) python/src/dataset.rs:295 — python/src/dataset.rs:295-308 | python/src/fragment.rs:842-857 — 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) java/lance-jni/src/transaction.rs:1624 — java/lance-jni/src/transaction.rs:1624-1640 | rust/lance-table/src/transaction/validate.rs:365-378 — 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/lance-table/src/io/commit/external_manifest.rs:172 — rust/lance-table/src/io/commit/external_manifest.rs:172-185 | rust/lance-table/src/io/commit/external_manifest.rs:200-217 — 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/lance/src/dataset/mem_wal/index/btree.rs:454 — rust/lance/src/dataset/mem_wal/index/btree.rs:454-467 | rust/lance/src/dataset/mem_wal/index/btree.rs:671-684 — 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/lance/src/index/vector/ivf.rs:277 — rust/lance/src/index/vector/ivf.rs:277-290 | rust/lance/src/index/vector/ivf/v2.rs:1647-1660 — 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) java/lance-jni/src/blocking_blob.rs:79 — java/lance-jni/src/blocking_blob.rs:79-95 | java/lance-jni/src/traits.rs:126-139 — 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) java/src/main/java/org/lance/Dataset.java:2809 — java/src/main/java/org/lance/Dataset.java:2809-2824 | java/src/main/java/org/lance/Dataset.java:2923-2936 — 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) python/src/dataset/write.rs:460 — python/src/dataset/write.rs:460-473 | python/src/dataset/write.rs:501-514 — 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/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2779 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2779-2792 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2814-2827 — 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/lance-index/src/scalar/inverted/index/inverted_index.rs:1101 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:1101-1114 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:1174-1187 — 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/lance/src/io/exec/utils.rs:473 — rust/lance/src/io/exec/utils.rs:473-486 | rust/lance/src/io/exec/utils.rs:499-512 — 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/lance-index/src/vector/bq/storage.rs:2170 — rust/lance-index/src/vector/bq/storage.rs:2170-2183 | rust/lance-index/src/vector/bq/storage/scan.rs:289-305 — 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/lance-datafusion-exec/src/exec.rs:483 — rust/lance-datafusion-exec/src/exec.rs:483-496 | rust/lance-datafusion-exec/src/exec.rs:498-513 — 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/lance/src/dataset/blob/read.rs:1092 — rust/lance/src/dataset/blob/read.rs:1092-1105 | rust/lance/src/dataset/blob/read.rs:1118-1131 — 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/lance-index/src/scalar/fmindex.rs:2313 — rust/lance-index/src/scalar/fmindex.rs:2313-2326 | rust/lance-index/src/scalar/ngram.rs:2035-2048 — 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/lance-encoding/src/compression.rs:952 — rust/lance-encoding/src/compression.rs:952-965 | rust/lance-encoding/src/compression.rs:972-986 — 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/lance-linalg/src/simd/u8.rs:130 — rust/lance-linalg/src/simd/u8.rs:130-143 | rust/lance-linalg/src/simd/u8.rs:146-159 — 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 (15 corresponding lines) · ×22
  • Edited copy of a member (15 corresponding lines) java/lance-jni/src/otel.rs:103 — java/lance-jni/src/otel.rs:103-117 | python/src/otel.rs:151-165 — 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/lance-namespace-impls/src/rest.rs:970 — rust/lance-namespace-impls/src/rest.rs:970-984 | rust/lance-namespace-impls/src/rest.rs:992-1006 — 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/lance-encoding/src/encodings/physical/general.rs:371 — rust/lance-encoding/src/encodings/physical/general.rs:371-386 | rust/lance-encoding/src/encodings/physical/general.rs:393-407 — 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/lance/src/dataset/mem_wal/index/arena_skiplist.rs:384 — rust/lance/src/dataset/mem_wal/index/arena_skiplist.rs:384-398 | rust/lance/src/dataset/mem_wal/index/arena_skiplist.rs:401-415 — 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/lance/src/io/exec/fts/compound.rs:271 — rust/lance/src/io/exec/fts/compound.rs:271-287 | rust/lance/src/io/exec/fts/compound.rs:1611-1625 — 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/lance-file/src/versions/v2_0/writer.rs:131 — rust/lance-file/src/versions/v2_0/writer.rs:131-145 | rust/lance-file/src/writer/structural.rs:114-129 — 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) python/src/executor.rs:61 — python/src/executor.rs:61-75 | python/src/executor.rs:162-178 — 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/lance/src/index/vector/ivf/v2/partition_search.rs:138 — rust/lance/src/index/vector/ivf/v2/partition_search.rs:138-156 | rust/lance/src/io/exec/knn/warp.rs:538-552 — 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/lance-encoding/src/encodings/logical/blob.rs:47 — rust/lance-encoding/src/encodings/logical/blob.rs:47-71 | rust/lance-encoding/src/encodings/logical/blob.rs:238-252 — 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/lance-io/src/object_store.rs:2263 — rust/lance-io/src/object_store.rs:2263-2277 | rust/lance-io/src/object_store.rs:2282-2297 — 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/lance/src/index/vector/ivf/v2.rs:1029 — rust/lance/src/index/vector/ivf/v2.rs:1029-1043 | rust/lance/src/index/vector/ivf/v2.rs:1586-1600 — 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) python/src/dataset.rs:2127 — python/src/dataset.rs:2127-2141 | python/src/dataset.rs:2152-2166 — 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/lance-encoding/src/array_encoding/logical/struct.rs:301 — rust/lance-encoding/src/array_encoding/logical/struct.rs:301-315 | rust/lance-encoding/src/encodings/logical/struct.rs:215-231 — 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) java/lance-jni/src/transaction.rs:1698 — java/lance-jni/src/transaction.rs:1698-1712 | rust/lance-core/src/datatypes/schema.rs:1124-1139 — 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) java/lance-jni/src/otel.rs:87 — java/lance-jni/src/otel.rs:87-101 | python/src/otel.rs:132-148 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) rust/lance-table/src/format/overlay/staleness.rs:134 — rust/lance-table/src/format/overlay/staleness.rs:134-148 | rust/lance-table/src/format/overlay/staleness.rs:162-176 — 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/lance-io/src/scheduler/lite.rs:157 — rust/lance-io/src/scheduler/lite.rs:157-171 | rust/lance-io/src/scheduler/lite.rs:173-198 — 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/lance-index/src/scalar/inverted/wand/posting.rs:632 — rust/lance-index/src/scalar/inverted/wand/posting.rs:632-646 | rust/lance-index/src/scalar/inverted/wand/posting.rs:653-667 — 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/lance-io/src/object_store/storage_options.rs:354 — rust/lance-io/src/object_store/storage_options.rs:354-368 | rust/lance-io/src/object_store/storage_options.rs:400-414 — 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) java/lance-jni/src/fragment.rs:840 — java/lance-jni/src/fragment.rs:840-854 | java/lance-jni/src/transaction.rs:274-289 — 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) java/lance-jni/src/blocking_dataset/read.rs:102 — java/lance-jni/src/blocking_dataset/read.rs:102-116 | java/lance-jni/src/blocking_dataset/read.rs:717-733 — 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/lance-index/src/scalar/inverted/documents.rs:177 — rust/lance-index/src/scalar/inverted/documents.rs:177-191 | rust/lance-index/src/scalar/inverted/index/doc_set.rs:767-781 — 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 · Duplicated block (15 lines × 2) · ×22
  • Duplicated block (15 lines × 2) java/lance-jni/src/mem_wal.rs:1090 — java/lance-jni/src/mem_wal.rs:1090-1104 | python/src/dataset.rs:3792-3806 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:830 — rust/lance-encoding/src/encodings/physical/alp.rs:830-844 | rust/lance-encoding/src/encodings/physical/alp.rs:903-917 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:830` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/fsst.rs:237 — rust/lance-encoding/src/encodings/physical/fsst.rs:237-251 | rust/lance-encoding/src/encodings/physical/fsst.rs:256-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/fsst.rs:237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/rle.rs:1019 — rust/lance-encoding/src/encodings/physical/rle.rs:1019-1033 | rust/lance-encoding/src/encodings/physical/rle.rs:1100-1114 — both copies are in the same file, so extract the 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/lance-file/src/reader.rs:2662 — rust/lance-file/src/reader.rs:2662-2676 | rust/lance-file/src/reader.rs:2711-2725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/reader.rs:2662` it does not close everything it opens, so those exact lines 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/lance-index/src/vector/pq/storage.rs:840 — rust/lance-index/src/vector/pq/storage.rs:840-854 | rust/lance-index/src/vector/pq/storage.rs:857-871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/pq/storage.rs:840` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-io/src/object_store.rs:1163 — rust/lance-io/src/object_store.rs:1163-1177 | rust/lance-io/src/object_store.rs:1228-1242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-io/src/object_store.rs:1163` it begins part-way through the construct above it, so those exact lines 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/lance-jsonb/src/extension.rs:107 — rust/lance-jsonb/src/extension.rs:107-121 | rust/lance-jsonb/src/extension.rs:129-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) rust/lance-jsonb/src/jsonpath/selector.rs:780 — rust/lance-jsonb/src/jsonpath/selector.rs:780-794 | rust/lance-jsonb/src/jsonpath/selector.rs:797-811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/jsonpath/selector.rs:780` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/mem_wal/hnsw/graph.rs:913 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:913-927 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:1002-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:116 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:116-130 | rust/lance/src/io/exec/pushdown_scan.rs:139-153 — 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/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.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 (15 lines × 2) rust/lance/src/index/append.rs:2125 — rust/lance/src/index/append.rs:2125-2139 | rust/lance/src/index/append.rs:2164-2178 — both copies are in the same file, so extract the 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/lance/src/index/scalar/bitmap.rs:99 — rust/lance/src/index/scalar/bitmap.rs:99-113 | rust/lance/src/index/scalar/btree.rs:141-155 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/btree.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/lance/src/io/exec/filtered_read.rs:3721 — rust/lance/src/io/exec/filtered_read.rs:3721-3735 | rust/lance/src/io/exec/filtered_read.rs:3748-3762 — both copies are in the same file, so extract the 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/lance/src/io/exec/fts/compound.rs:1218 — rust/lance/src/io/exec/fts/compound.rs:1218-1232 | rust/lance/src/io/exec/fts/compound.rs:1243-1257 — both copies are in the same file, so extract the 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) java/lance-jni/src/blocking_scanner.rs:153 — java/lance-jni/src/blocking_scanner.rs:153-167 | java/lance-jni/src/blocking_scanner.rs:178-192 — both copies are in the same file, so extract the 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) python/src/scanner.rs:327 — python/src/scanner.rs:327-341 | python/src/scanner.rs:352-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/scanner.rs:327` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/concat.rs:415 — rust/lance-file/src/concat.rs:415-429 | rust/lance-file/src/concat.rs:433-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/concat.rs:415` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) java/lance-jni/src/mem_wal.rs:1165 — java/lance-jni/src/mem_wal.rs:1165-1179 | python/src/mem_wal.rs:1104-1118 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `manifest` to `ShardManifest` in one and `lance_index::mem_wal::ShardManifest` 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) java/lance-jni/src/dispatcher.rs:108 — java/lance-jni/src/dispatcher.rs:108-124 | java/lance-jni/src/dispatcher.rs:137-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/dispatcher.rs:108` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2489 — rust/lance-namespace-impls/src/dir/manifest.rs:2489-2503 | rust/lance-namespace-impls/src/dir/manifest.rs:2867-2881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:2489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) java/src/main/java/org/lance/Dataset.java:169 — java/src/main/java/org/lance/Dataset.java:169-183 | java/src/main/java/org/lance/Dataset.java:311-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×21
  • Edited copy of a member (21 corresponding lines) rust/lance-linalg/src/simd/f32.rs:434 — rust/lance-linalg/src/simd/f32.rs:434-454 | rust/lance-linalg/src/simd/f32.rs:943-967 — 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/lance-linalg/src/simd/f64.rs:284 — rust/lance-linalg/src/simd/f64.rs:284-304 | rust/lance-linalg/src/simd/f64.rs:736-760 — 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/lance-encoding/src/encodings/logical/primitive/dict.rs:92 — rust/lance-encoding/src/encodings/logical/primitive/dict.rs:92-112 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:151-171 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) rust/lance-linalg/src/distance/dot.rs:36 — rust/lance-linalg/src/distance/dot.rs:36-56 | rust/lance-linalg/src/distance/l2.rs:149-176 — 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/lance-linalg/src/simd/i32.rs:302 — rust/lance-linalg/src/simd/i32.rs:302-322 | rust/lance-linalg/src/simd/i32.rs:354-374 — 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/lance-table/src/io/commit/dynamodb.rs:540 — rust/lance-table/src/io/commit/dynamodb.rs:540-563 | rust/lance-table/src/io/commit/dynamodb.rs:573-593 — 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/lance-index/src/vector/flat/storage.rs:170 — rust/lance-index/src/vector/flat/storage.rs:170-191 | rust/lance-index/src/vector/flat/storage.rs:346-366 — 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/lance-table/src/io/commit/external_manifest.rs:938 — rust/lance-table/src/io/commit/external_manifest.rs:938-958 | rust/lance-table/src/io/commit/external_manifest.rs:965-987 — 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/lance/src/datafusion/dataframe.rs:58 — rust/lance/src/datafusion/dataframe.rs:58-81 | REDACTED:38-58 — 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/lance/src/dataset/write/merge_insert/exec/delete.rs:68 — rust/lance/src/dataset/write/merge_insert/exec/delete.rs:68-88 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:308-337 — 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/lance-index/src/scalar/inverted/wand/posting.rs:1218 — rust/lance-index/src/scalar/inverted/wand/posting.rs:1218-1238 | rust/lance-index/src/scalar/inverted/wand/posting.rs:1247-1268 — 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) python/src/lib.rs:151 — python/src/lib.rs:151-171 | rust/lance-core/src/utils/tokio.rs:98-121 — 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) java/src/main/java/org/lance/WriteDatasetBuilder.java:550 — java/src/main/java/org/lance/WriteDatasetBuilder.java:550-570 | java/src/main/java/org/lance/WriteDatasetBuilder.java:577-612 — 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/lance-index/src/scalar/inverted/encoding.rs:527 — rust/lance-index/src/scalar/inverted/encoding.rs:527-547 | rust/lance-index/src/scalar/inverted/impact.rs:582-607 — 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) protos/codegen/src/main.rs:87 — protos/codegen/src/main.rs:87-107 | protos/codegen/src/main.rs:223-246 — 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/lance/src/dataset/mem_wal/hnsw/graph.rs:857 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:857-877 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:947-967 — 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) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:277 — java/src/main/java/org/lance/namespace/DirectoryNamespace.java:277-297 | java/src/main/java/org/lance/namespace/RestNamespace.java:191-211 — 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/lance-file/src/versions/v2_0/writer.rs:375 — rust/lance-file/src/versions/v2_0/writer.rs:375-396 | rust/lance-file/src/writer/structural.rs:545-565 — 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/lance-index/src/vector/graph.rs:746 — rust/lance-index/src/vector/graph.rs:746-766 | rust/lance-index/src/vector/graph.rs:775-795 — 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/lance/src/session.rs:190 — rust/lance/src/session.rs:190-211 | rust/lance/src/session.rs:221-241 — 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/lance-index/src/scalar/inverted/index/search.rs:547 — rust/lance-index/src/scalar/inverted/index/search.rs:547-568 | rust/lance-index/src/scalar/inverted/index/search.rs:684-704 — 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 (17 corresponding lines) · ×21
  • Edited copy of a member (17 corresponding lines) rust/lance-linalg/src/simd/dist_table.rs:2275 — rust/lance-linalg/src/simd/dist_table.rs:2275-2293 | rust/lance-linalg/src/simd/dist_table.rs:2423-2439 — 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/lance-core/src/datatypes/schema.rs:1670 — rust/lance-core/src/datatypes/schema.rs:1670-1686 | rust/lance-core/src/datatypes/schema.rs:1697-1713 — 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/lance-index/src/vector/bq/ex_dot.rs:1259 — rust/lance-index/src/vector/bq/ex_dot.rs:1259-1275 | rust/lance-index/src/vector/bq/ex_dot.rs:1669-1688 — 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) python/src/scanner.rs:325 — python/src/scanner.rs:325-341 | python/src/scanner.rs:350-366 — 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/lance-index/src/scalar/fmindex.rs:1210 — rust/lance-index/src/scalar/fmindex.rs:1210-1226 | rust/lance-index/src/scalar/fmindex.rs:1228-1244 — 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/lance-index/src/scalar/fmindex.rs:1274 — rust/lance-index/src/scalar/fmindex.rs:1274-1290 | rust/lance-index/src/scalar/fmindex.rs:1292-1308 — 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/lance/src/index/vector/ivf.rs:5257 — rust/lance/src/index/vector/ivf.rs:5257-5273 | rust/lance/src/index/vector/ivf/streaming_hamming.rs:631-652 — 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/lance-namespace-impls/src/rest.rs:1242 — rust/lance-namespace-impls/src/rest.rs:1242-1263 | rust/lance-namespace-impls/src/rest.rs:1464-1480 — 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/lance-linalg/src/simd/dist_table.rs:2237 — rust/lance-linalg/src/simd/dist_table.rs:2237-2261 | rust/lance-linalg/src/simd/dist_table.rs:2394-2410 — 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/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:167 — rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:167-183 | rust/lance/src/io/exec/filtered_read.rs:1292-1318 — 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/lance-namespace-impls/src/dir/builder.rs:83 — rust/lance-namespace-impls/src/dir/builder.rs:83-115 | rust/lance-namespace-impls/src/rest.rs:203-219 — 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/lance-encoding/src/encodings/physical/alp.rs:274 — rust/lance-encoding/src/encodings/physical/alp.rs:274-290 | rust/lance-encoding/src/encodings/physical/alp.rs:292-308 — 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/lance-arrow/src/json.rs:167 — rust/lance-arrow/src/json.rs:167-185 | rust/lance-arrow/src/json.rs:277-293 — 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/lance/src/dataset.rs:2688 — rust/lance/src/dataset.rs:2688-2705 | rust/lance/src/dataset/write.rs:1669-1685 — 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/lance/src/index/provenance.rs:277 — rust/lance/src/index/provenance.rs:277-293 | rust/lance/src/index/provenance.rs:482-502 — 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/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:273 — rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:273-289 | rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:315-331 — 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/lance-encoding/src/utils/accumulation.rs:251 — rust/lance-encoding/src/utils/accumulation.rs:251-274 | rust/lance-encoding/src/utils/accumulation.rs:280-296 — 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) java/lance-jni/src/namespace.rs:1910 — java/lance-jni/src/namespace.rs:1910-1926 | java/lance-jni/src/namespace.rs:2861-2877 — 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/lance-index/src/scalar/inverted/documents.rs:2307 — rust/lance-index/src/scalar/inverted/documents.rs:2307-2323 | rust/lance-index/src/scalar/inverted/documents.rs:2329-2345 — 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/lance/src/dataset/mem_wal/memtable/scanner/exec/scalar_index.rs:116 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scalar_index.rs:116-140 | rust/lance/src/io/exec/scalar_index.rs:1118-1134 — 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/lance/benches/mem_wal/vector/hnsw/disk_ann_compare.py:239 — rust/lance/benches/mem_wal/vector/hnsw/disk_ann_compare.py:239-255 | rust/lance/benches/mem_wal/vector/hnsw/disk_ann_compare.py:260-283 — 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 (19 corresponding lines) · ×20
  • Edited copy of a member (19 corresponding lines) rust/lance-index/src/vector/kmeans.rs:362 — rust/lance-index/src/vector/kmeans.rs:362-390 | rust/lance-index/src/vector/kmeans.rs:1062-1080 — 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/lance-linalg/src/simd/dist_table.rs:1097 — rust/lance-linalg/src/simd/dist_table.rs:1097-1115 | rust/lance-linalg/src/simd/dist_table.rs:1346-1368 — 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/lance-index/src/scalar/label_list.rs:549 — rust/lance-index/src/scalar/label_list.rs:549-567 | rust/lance-index/src/scalar/label_list.rs:572-590 — 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/lance/src/index/vector/ivf/streaming_hamming/counter.rs:360 — rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:360-388 | rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:406-424 — 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) python/src/fragment.rs:252 — python/src/fragment.rs:252-273 | python/src/fragment.rs:280-298 — 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/lance-encoding/src/encodings/physical/bitpacking.rs:570 — rust/lance-encoding/src/encodings/physical/bitpacking.rs:570-588 | rust/lance-encoding/src/encodings/physical/bitpacking.rs:595-621 — 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) python/src/mem_wal.rs:261 — python/src/mem_wal.rs:261-279 | python/src/mem_wal.rs:286-304 — 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) java/src/main/java/org/lance/memwal/ShardingEvaluator.java:51 — java/src/main/java/org/lance/memwal/ShardingEvaluator.java:51-69 | java/src/main/java/org/lance/memwal/ShardingEvaluator.java:81-99 — 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/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:995 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:995-1013 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1019-1037 — 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/lance-core/src/datatypes/schema.rs:682 — rust/lance-core/src/datatypes/schema.rs:682-702 | rust/lance/src/dataset/schema_evolution.rs:1572-1590 — 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/lance-jsonb/src/extension.rs:106 — rust/lance-jsonb/src/extension.rs:106-124 | rust/lance-jsonb/src/extension.rs:128-153 — 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/lance-index/src/scalar/json.rs:1239 — rust/lance-index/src/scalar/json.rs:1239-1257 | rust/lance-index/src/scalar/list_element.rs:626-644 — 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/lance-index/src/vector/pq/distance.rs:35 — rust/lance-index/src/vector/pq/distance.rs:35-53 | rust/lance-index/src/vector/pq/distance.rs:113-131 — 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/lance-jsonb/src/jsonpath/parser.rs:504 — rust/lance-jsonb/src/jsonpath/parser.rs:504-522 | rust/lance-jsonb/src/jsonpath/parser.rs:524-542 — 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/lance/src/io/exec/fts/flat_match.rs:557 — rust/lance/src/io/exec/fts/flat_match.rs:557-578 | rust/lance/src/io/exec/minhash.rs:516-534 — 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/lance/src/dataset/mem_wal/scanner/fts_search.rs:1463 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1463-1482 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:106-124 — 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/lance-file/src/versions/v2_0/writer.rs:406 — rust/lance-file/src/versions/v2_0/writer.rs:406-428 | rust/lance-file/src/writer/structural.rs:582-600 — 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/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:732 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:732-754 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:503-521 — 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/lance-encoding/src/array_encoding/logical/struct.rs:161 — rust/lance-encoding/src/array_encoding/logical/struct.rs:161-180 | rust/lance-encoding/src/encodings/logical/struct.rs:87-105 — 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/lance-table/src/format/fragment.rs:676 — rust/lance-table/src/format/fragment.rs:676-694 | rust/lance-table/src/format/fragment.rs:699-717 — 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 (16 corresponding lines) · ×20
  • Edited copy of a member (16 corresponding lines) rust/lance/src/io/exec/topk_late_materialization.rs:401 — rust/lance/src/io/exec/topk_late_materialization.rs:401-416 | rust/lance/src/io/exec/topk_late_materialization.rs:449-467 — 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/lance-index/src/scalar/fmindex.rs:1175 — rust/lance-index/src/scalar/fmindex.rs:1175-1190 | rust/lance-index/src/scalar/fmindex.rs:1192-1207 — 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/lance-encoding/src/repdef.rs:2538 — rust/lance-encoding/src/repdef.rs:2538-2553 | rust/lance-encoding/src/repdef.rs:2557-2574 — 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/lance/src/index/scalar/btree.rs:28 — rust/lance/src/index/scalar/btree.rs:28-43 | rust/lance/src/index/scalar/inverted.rs:886-908 — 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/lance-io/src/object_store/throttle.rs:1366 — rust/lance-io/src/object_store/throttle.rs:1366-1381 | rust/lance-io/src/object_store/throttle.rs:1387-1403 — 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/lance-table/src/format/clustering.rs:343 — rust/lance-table/src/format/clustering.rs:343-358 | rust/lance-table/src/format/clustering.rs:383-398 — 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/lance/src/dataset.rs:3038 — rust/lance/src/dataset.rs:3038-3053 | rust/lance/src/dataset.rs:3230-3250 — 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/lance-index/src/vector/pq/distance.rs:59 — rust/lance-index/src/vector/pq/distance.rs:59-74 | rust/lance-index/src/vector/pq/distance.rs:134-150 — 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/lance/src/index/vector/ivf/streaming_hamming/counter.rs:73 — rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:73-88 | rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:105-123 — 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/lance-index/src/vector/bq/ex_dot.rs:709 — rust/lance-index/src/vector/bq/ex_dot.rs:709-724 | rust/lance-index/src/vector/bq/ex_dot.rs:1475-1490 — 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) java/lance-jni/src/blocking_dataset/refs.rs:210 — java/lance-jni/src/blocking_dataset/refs.rs:210-225 | java/lance-jni/src/blocking_dataset/refs.rs:507-523 — 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/lance/src/dataset/mem_wal/index/btree.rs:430 — rust/lance/src/dataset/mem_wal/index/btree.rs:430-445 | rust/lance/src/dataset/mem_wal/index/btree.rs:644-662 — 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/lance-encoding/src/encoder/structural.rs:175 — rust/lance-encoding/src/encoder/structural.rs:175-190 | rust/lance-encoding/src/encoder/structural.rs:197-212 — 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/lance-index/src/scalar/inverted/encoding.rs:1033 — rust/lance-index/src/scalar/inverted/encoding.rs:1033-1048 | rust/lance-index/src/scalar/inverted/encoding.rs:1058-1076 — 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) java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java:79 — java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java:79-94 | java/src/main/java/org/lance/index/scalar/MinHashLshIndexParams.java:160-177 — 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) python/src/dataset/write.rs:398 — python/src/dataset/write.rs:398-413 | python/src/dataset/write.rs:415-430 — 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) java/lance-jni/src/vector_trainer.rs:45 — java/lance-jni/src/vector_trainer.rs:45-62 | java/lance-jni/src/vector_trainer.rs:67-82 — 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/lance-core/src/datatypes/schema.rs:1931 — rust/lance-core/src/datatypes/schema.rs:1931-1948 | rust/lance-core/src/datatypes/schema.rs:1977-1992 — 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/lance/src/dataset/write/merge_insert/exec/delete.rs:206 — rust/lance/src/dataset/write/merge_insert/exec/delete.rs:206-221 | rust/lance/src/dataset/write/merge_insert/exec/in_place.rs:382-399 — 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) java/lance-jni/src/mem_wal.rs:959 — java/lance-jni/src/mem_wal.rs:959-974 | java/lance-jni/src/session.rs:40-56 — 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.
D2 · Cognitive Complexity · lance_table · ×19
  • lance_table::transaction::row_version::resolve_update_version_metadata (cognitive 43) rust/lance-table/src/transaction/row_version.rs:91 — lance_table::transaction::row_version::resolve_update_version_metadata has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 4 (8 pts), match/switch 3 (6 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.
  • lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns (cognitive 38) rust/lance-table/src/utils/stream.rs:478 — lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (29 pts), boolean chains 5, loops 1 (2 pts), match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_table::system_index::frag_reuse::gate::classify (cognitive 36) rust/lance-table/src/system_index/frag_reuse/gate.rs:54 — lance_table::system_index::frag_reuse::gate::classify has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 10, match/switch 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_table::rowids::version::refresh_row_latest_update_meta_for_partial_frag_rewrite_cols (cognitive 31) rust/lance-table/src/rowids/version.rs:721 — lance_table::rowids::version::refresh_row_latest_update_meta_for_partial_frag_rewrite_cols has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_table::transaction::validate::merge_schema_valid (cognitive 29) rust/lance-table/src/transaction/validate.rs:899 — lance_table::transaction::validate::merge_schema_valid has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 5, 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.
  • lance_table::system_index::frag_reuse::ledger::order_lineage (cognitive 28) rust/lance-table/src/system_index/frag_reuse/ledger.rs:480 — lance_table::system_index::frag_reuse::ledger::order_lineage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 7 (11 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.
  • lance_table::transaction::validate::merge_fragments_valid (cognitive 22) rust/lance-table/src/transaction/validate.rs:789 — lance_table::transaction::validate::merge_fragments_valid has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_table::rowids::rechunk_sequences (cognitive 21) rust/lance-table/src/rowids.rs:1176 — lance_table::rowids::rechunk_sequences has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), match/switch 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.
  • lance_table::system_index::frag_reuse::remap_fragment_bitmap (cognitive 21) rust/lance-table/src/system_index/frag_reuse.rs:505 — lance_table::system_index::frag_reuse::remap_fragment_bitmap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (10 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.
  • lance_table::transaction::validate::schema_fragments_modern_valid (cognitive 21) rust/lance-table/src/transaction/validate.rs:664 — lance_table::transaction::validate::schema_fragments_modern_valid has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 8). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (check, subtree_has_present). 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.
  • lance_table::utils::stream::wrap_with_row_id_and_delete_impl (cognitive 21) rust/lance-table/src/utils/stream.rs:698 — lance_table::utils::stream::wrap_with_row_id_and_delete_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_table::io::commit::current_manifest_local (cognitive 19) rust/lance-table/src/io/commit.rs:712 — lance_table::io::commit::current_manifest_local has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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.
  • lance_table::rowids::index::prep_index_chunks (cognitive 19) rust/lance-table/src/rowids/index.rs:1155 — lance_table::rowids::index::prep_index_chunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_table::rowids::index::batch::search_sorted (cognitive 17) rust/lance-table/src/rowids/index/batch.rs:79 — lance_table::rowids::index::batch::search_sorted has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 3 (6 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • lance_table::feature_flags::apply_feature_flags (cognitive 16) rust/lance-table/src/feature_flags.rs:284 — lance_table::feature_flags::apply_feature_flags has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • lance_table::format::key_existence::extract_key_value (cognitive 16) rust/lance-table/src/format/key_existence.rs:413 — lance_table::format::key_existence::extract_key_value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 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.
  • lance_table::io::manifest::read_manifest_proto_with_length (cognitive 16) rust/lance-table/src/io/manifest.rs:69 — lance_table::io::manifest::read_manifest_proto_with_length has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • lance_table::rowids::select_row_ids (cognitive 16) rust/lance-table/src/rowids.rs:1272 — lance_table::rowids::select_row_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (2 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.
  • lance_table::rowids::version::rechunk_version_sequences (cognitive 16) rust/lance-table/src/rowids/version.rs:562 — lance_table::rowids::version::rechunk_version_sequences has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), match/switch 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.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×18
  • Edited copy of a member (8 corresponding lines) rust/lance-index/src/scalar/btree.rs:706 — rust/lance-index/src/scalar/btree.rs:706-713 | rust/lance-index/src/scalar/btree.rs:748-755 — 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/lance-geo/src/rtree.rs:826 — rust/lance-geo/src/rtree.rs:826-834 | rust/lance-index/src/scalar/btree.rs:2938-2945 — 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) java/src/main/java/org/lance/operation/Merge.java:65 — java/src/main/java/org/lance/operation/Merge.java:65-72 | java/src/main/java/org/lance/operation/Overwrite.java:96-104 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rust/lance/src/blob.rs:1020 — rust/lance/src/blob.rs:1020-1027 | rust/lance/src/blob.rs:1033-1040 — 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/lance-index/src/scalar/fmindex.rs:398 — rust/lance-index/src/scalar/fmindex.rs:398-406 | rust/lance-index/src/scalar/fmindex.rs:904-911 — 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/lance-encoding/src/decoder.rs:3181 — rust/lance-encoding/src/decoder.rs:3181-3188 | rust/lance-encoding/src/decoder.rs:3191-3199 — 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) java/src/main/java/org/lance/memwal/LsmVectorSearchPlanner.java:88 — java/src/main/java/org/lance/memwal/LsmVectorSearchPlanner.java:88-102 | java/src/main/java/org/lance/memwal/LsmPointLookupPlanner.java:59-66 — 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/lance-index/src/scalar/bitmap.rs:1561 — rust/lance-index/src/scalar/bitmap.rs:1561-1568 | rust/lance-index/src/scalar/bitmap.rs:1956-1965 — 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/lance-core/src/datatypes/schema.rs:875 — rust/lance-core/src/datatypes/schema.rs:875-882 | rust/lance-core/src/datatypes/schema.rs:889-897 — 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/lance-encoding/src/buffer.rs:53 — rust/lance-encoding/src/buffer.rs:53-60 | rust/lance-encoding/src/encodings/logical/primitive/field.rs:786-796 — 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/lance-datafusion/src/signed_zero.rs:368 — rust/lance-datafusion/src/signed_zero.rs:368-375 | rust/lance-index/src/scalar/zonemap.rs:409-416 — 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/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:108 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:108-115 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.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/lance-index/src/vector/sq/storage.rs:478 — rust/lance-index/src/vector/sq/storage.rs:478-485 | rust/lance-index/src/vector/sq/storage.rs:493-501 — 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/lance-arrow/src/bfloat16.rs:24 — rust/lance-arrow/src/bfloat16.rs:24-31 | rust/lance-arrow/src/json.rs:38-46 — 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/lance-encoding/src/compression.rs:1802 — rust/lance-encoding/src/compression.rs:1802-1809 | rust/lance-encoding/src/encodings/physical/rle.rs:2460-2471 — 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/lance-linalg/src/simd/f32.rs:634 — rust/lance-linalg/src/simd/f32.rs:634-641 | rust/lance-linalg/src/simd/f64.rs:485-492 — 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/lance-file/src/versions/v1/mod.rs:63 — rust/lance-file/src/versions/v1/mod.rs:63-70 | rust/lance-file/src/versions/v2_0/reader.rs:225-232 — 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) python/src/dataset/optimize.rs:323 — python/src/dataset/optimize.rs:323-330 | python/src/fragment.rs:1086-1093 — 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.
D1 · Cyclomatic Complexity · Scanner · ×17
  • Scanner::vector_search (cyclomatic 43) rust/lance/src/dataset/scanner/vector.rs:145 — Scanner::vector_search 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.
  • Scanner::create_plan_impl (cyclomatic 34) rust/lance/src/dataset/scanner/plan.rs:827 — Scanner::create_plan_impl 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.
  • Scanner::plan_compound_scorer (cyclomatic 30) rust/lance/src/dataset/scanner/fts.rs:1175 — Scanner::plan_compound_scorer 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.
  • Scanner::prefilter_source (cyclomatic 24) rust/lance/src/dataset/scanner/vector.rs:1565 — Scanner::prefilter_source 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.
  • Scanner::validate_options (cyclomatic 23) rust/lance/src/dataset/scanner/plan.rs:453 — Scanner::validate_options has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Scanner::plan_corpus_query (cyclomatic 21) rust/lance/src/dataset/scanner/fts.rs:1835 — Scanner::plan_corpus_query 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.
  • Scanner::plan_phrase_query (cyclomatic 20) rust/lance/src/dataset/scanner/fts.rs:1654 — Scanner::plan_phrase_query 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.
  • Scanner::plan_combined_fields_query (cyclomatic 20) rust/lance/src/dataset/scanner/fts.rs:2353 — Scanner::plan_combined_fields_query has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Scanner::new_filtered_read (cyclomatic 20) rust/lance/src/dataset/scanner/source.rs:400 — Scanner::new_filtered_read has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Scanner::plan_match_query (cyclomatic 19) rust/lance/src/dataset/scanner/fts.rs:2016 — Scanner::plan_match_query 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.
  • Scanner::knn_combined (cyclomatic 18) rust/lance/src/dataset/scanner/vector.rs:891 — Scanner::knn_combined 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.
  • Scanner::fts_document_granularity (cyclomatic 17) rust/lance/src/dataset/scanner/fts.rs:815 — Scanner::fts_document_granularity 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 2 function items inside it that branch (visit, add_leaf). 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.
  • Scanner::calculate_final_projection (cyclomatic 17) rust/lance/src/dataset/scanner/plan.rs:153 — Scanner::calculate_final_projection 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.
  • Scanner::scalar_indexed_scan (cyclomatic 17) rust/lance/src/dataset/scanner/source.rs:847 — Scanner::scalar_indexed_scan 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.
  • Scanner::nearest (cyclomatic 16) rust/lance/src/dataset/scanner/builder.rs:828 — Scanner::nearest 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.
  • Scanner::plan_fts (cyclomatic 16) rust/lance/src/dataset/scanner/fts.rs:1417 — Scanner::plan_fts 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.
  • Scanner::create_filter_plan (cyclomatic 16) rust/lance/src/dataset/scanner/plan.rs:560 — Scanner::create_filter_plan 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 · Dataset · ×16
  • Dataset::scanner (cognitive 122) python/src/dataset.rs:943 — Dataset::scanner has cognitive complexity 122 (threshold 15). Drivers by points: if/else 65 (102 pts), match/switch 8 (19 pts), boolean chains 1 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dataset::filter_addr_or_ids (cognitive 69) rust/lance/src/dataset.rs:3643 — Dataset::filter_addr_or_ids has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (52 pts), loops 5 (16 pts), boolean chains 1 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dataset::create_index (cognitive 58) python/src/dataset.rs:2451 — Dataset::create_index has cognitive complexity 58 (threshold 15). Drivers by points: if/else 30 (49 pts), match/switch 3 (4 pts), loops 1 (3 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.
  • Dataset::scalar_index_info_with_plugins (cognitive 41) rust/lance/src/index/loading.rs:668 — Dataset::scalar_index_info_with_plugins has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (30 pts), match/switch 2 (5 pts), boolean chains 4, loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dataset::collect_paths (cognitive 39) rust/lance/src/dataset.rs:4330 — Dataset::collect_paths has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 5 (10 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.
  • Dataset::count_indexed_rows (cognitive 35) rust/lance/src/dataset/scanner.rs:687 — Dataset::count_indexed_rows has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dataset::create_data_file (cognitive 33) rust/lance/src/dataset.rs:2832 — Dataset::create_data_file has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 6, loops 3 (5 pts), match/switch 1 (nesting depth added 8). Of this number, 20 points are the body's own statements and 13 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.
  • Dataset::merge_existing_index_segments (cognitive 32) rust/lance/src/index/lifecycle.rs:657 — Dataset::merge_existing_index_segments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Dataset::new (cognitive 26) python/src/dataset.rs:538 — Dataset::new has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (23 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Dataset::commit_existing_index_segments (cognitive 25) rust/lance/src/index/lifecycle.rs:855 — Dataset::commit_existing_index_segments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • Dataset::tracked_files_with_options (cognitive 23) rust/lance/src/dataset/files.rs:300 — Dataset::tracked_files_with_options has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (7 pts), loops 3 (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.
  • Dataset::load_scalar_index (cognitive 21) rust/lance/src/index/lifecycle.rs:1111 — Dataset::load_scalar_index has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dataset::commit_transaction (cognitive 20) python/src/dataset.rs:2995 — Dataset::commit_transaction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, match/switch 4 (8 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Dataset::load_manifest (cognitive 20) rust/lance/src/dataset.rs:913 — Dataset::load_manifest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Dataset::open_vector_index_from_metadata_with_plan (cognitive 20) rust/lance/src/index/loading.rs:1007 — Dataset::open_vector_index_from_metadata_with_plan has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 7, boolean chains 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.
  • Dataset::write_into_namespace_impl (cognitive 17) rust/lance/src/dataset.rs:1236 — Dataset::write_into_namespace_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D1 · Cyclomatic Complexity · lance_index · ×15
  • lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cyclomatic 127) rust/lance-index/src/vector/distributed/index_merger.rs:868 — lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner has cyclomatic complexity 127 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • lance_index::scalar::zonemap::validate_seed (cyclomatic 35) rust/lance-index/src/scalar/zonemap.rs:3362 — lance_index::scalar::zonemap::validate_seed 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.
  • lance_index::vector::graph::beam_search_acorn (cyclomatic 32) rust/lance-index/src/vector/graph.rs:590 — lance_index::vector::graph::beam_search_acorn 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.
  • lance_index::scalar::inverted::index::flat_search::tokenize_and_count (cyclomatic 24) rust/lance-index/src/scalar/inverted/index/flat_search.rs:234 — lance_index::scalar::inverted::index::flat_search::tokenize_and_count 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.
  • lance_index::scalar::zonemap::parse_seed_for_binary_copy (cyclomatic 24) rust/lance-index/src/scalar/zonemap.rs:3016 — lance_index::scalar::zonemap::parse_seed_for_binary_copy 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.
  • lance_index::vector::bq::ex_dot::unpack_group (cyclomatic 22) rust/lance-index/src/vector/bq/ex_dot.rs:215 — lance_index::vector::bq::ex_dot::unpack_group has cyclomatic complexity 22 (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.
  • lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal (cyclomatic 21) rust/lance-index/src/vector/distributed/index_merger.rs:107 — lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal 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.
  • lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config (cyclomatic 18) rust/lance-index/src/scalar/fmindex.rs:1781 — lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config 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.
  • lance_index::scalar::inverted::combined::maxscore::combined_maxscore (cyclomatic 18) rust/lance-index/src/scalar/inverted/combined/maxscore.rs:60 — lance_index::scalar::inverted::combined::maxscore::combined_maxscore 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.
  • lance_index::scalar::inverted::cross_column::score_cross_column_sources (cyclomatic 18) rust/lance-index/src/scalar/inverted/cross_column.rs:1180 — lance_index::scalar::inverted::cross_column::score_cross_column_sources 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.
  • lance_index::scalar::tuple::planner::plan (cyclomatic 18) rust/lance-index/src/scalar/tuple/planner.rs:178 — lance_index::scalar::tuple::planner::plan 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.
  • lance_index::scalar::tuple::planner::key_ranges (cyclomatic 18) rust/lance-index/src/scalar/tuple/planner.rs:305 — lance_index::scalar::tuple::planner::key_ranges 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.
  • lance_index::scalar::inverted::wand::bounds::exclusive_partial_score_limit (cyclomatic 17) rust/lance-index/src/scalar/inverted/wand/bounds.rs:67 — lance_index::scalar::inverted::wand::bounds::exclusive_partial_score_limit 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.
  • lance_index::vector::distributed::index_merger::read_shard_window_partitions (cyclomatic 17) rust/lance-index/src/vector/distributed/index_merger.rs:728 — lance_index::vector::distributed::index_merger::read_shard_window_partitions 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.
  • lance_index::vector::bq::ex_dot::pack_block (cyclomatic 16) rust/lance-index/src/vector/bq/ex_dot.rs:129 — lance_index::vector::bq::ex_dot::pack_block has cyclomatic complexity 16 (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.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×15
  • Edited copy of a member (18 corresponding lines) rust/lance-namespace-impls/src/rest.rs:1080 — rust/lance-namespace-impls/src/rest.rs:1080-1103 | rust/lance-namespace-impls/src/rest.rs:1482-1503 — 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/lance-encoding/src/encodings/physical/alp/restore.rs:305 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:305-326 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:336-353 — 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/lance/src/dataset/mem_wal/wal.rs:1894 — rust/lance/src/dataset/mem_wal/wal.rs:1894-1916 | rust/lance/src/dataset/mem_wal/wal.rs:1922-1939 — 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/lance-datagen/src/generator.rs:2862 — rust/lance-datagen/src/generator.rs:2862-2879 | rust/lance-datagen/src/generator.rs:2961-2978 — 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/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:312 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:312-329 | rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:197-216 — 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/lance-core/src/datatypes/schema.rs:1628 — rust/lance-core/src/datatypes/schema.rs:1628-1647 | rust/lance-core/src/datatypes/schema.rs:1737-1754 — 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/lance-index/src/scalar/ngram/ngram_regex.rs:73 — rust/lance-index/src/scalar/ngram/ngram_regex.rs:73-90 | rust/lance-index/src/scalar/ngram/ngram_regex.rs:94-111 — 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/lance-arrow/src/memory.rs:31 — rust/lance-arrow/src/memory.rs:31-51 | rust/lance-core/src/deepsize.rs:246-263 — 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/lance-index/src/vector/pq.rs:634 — rust/lance-index/src/vector/pq.rs:634-651 | rust/lance-index/src/vector/sq.rs:169-193 — 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/lance-index/src/scalar/ngram.rs:580 — rust/lance-index/src/scalar/ngram.rs:580-602 | rust/lance-index/src/scalar/ngram.rs:831-848 — 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/lance-index/src/vector/bq/ex_dot.rs:334 — rust/lance-index/src/vector/bq/ex_dot.rs:334-352 | rust/lance-index/src/vector/bq/ex_dot.rs:549-566 — 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/lance/src/io/exec/filtered_read.rs:2087 — rust/lance/src/io/exec/filtered_read.rs:2087-2109 | rust/lance/src/io/exec/filtered_read.rs:2119-2136 — 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/lance/src/dataset/blob/file.rs:622 — rust/lance/src/dataset/blob/file.rs:622-640 | rust/lance/src/dataset/blob/file.rs:643-660 — 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/lance/src/io/exec/fts/compound.rs:172 — rust/lance/src/io/exec/fts/compound.rs:172-191 | rust/lance/src/io/exec/fts/compound.rs:484-501 — 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/lance/src/dataset/mem_wal/index/pk_key.rs:116 — rust/lance/src/dataset/mem_wal/index/pk_key.rs:116-137 | rust/lance/src/dataset/mem_wal/scanner/exec/pk.rs:42-59 — 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 (18 lines × 2) · ×15
  • Duplicated block (18 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:769 — rust/lance-encoding/src/encodings/physical/alp.rs:769-786 | rust/lance-encoding/src/encodings/physical/alp.rs:941-958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:769` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:1001 — rust/lance-encoding/src/encodings/physical/alp.rs:1001-1018 | rust/lance-encoding/src/encodings/physical/alp.rs:1181-1198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:1001` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/sequence.rs:879 — rust/lance-encoding/src/encodings/physical/sequence.rs:879-896 | rust/lance-encoding/src/encodings/physical/sequence.rs:899-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/sequence.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.
  • Duplicated block (18 lines × 2) rust/lance-file/src/versions/v2_1/compression.rs:96 — rust/lance-file/src/versions/v2_1/compression.rs:96-113 | rust/lance-file/src/versions/v2_2/compression.rs:90-107 — `rust/lance-file/src/versions/v2_1/compression.rs` and `rust/lance-file/src/versions/v2_2/compression.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/compression.rs:96` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) rust/lance-file/src/versions/v2_1/reader.rs:81 — rust/lance-file/src/versions/v2_1/reader.rs:81-98 | rust/lance-file/src/versions/v2_2/reader.rs:81-98 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/reader.rs:81` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-index/src/scalar/inverted.rs:200 — rust/lance-index/src/scalar/inverted.rs:200-217 | rust/lance-index/src/scalar/inverted/index/search.rs:459-476 — before extracting anything, compare `rust/lance-index/src/scalar/inverted.rs` and `rust/lance-index/src/scalar/inverted/index/search.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-index/src/scalar/inverted.rs:200` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/inverted/index/doc_set.rs:485 — rust/lance-index/src/scalar/inverted/index/doc_set.rs:485-502 | rust/lance-index/src/scalar/inverted/index/doc_set.rs:523-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/doc_set.rs:485` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/inverted/wand/maxscore.rs:1359 — rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1359-1376 | rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1461-1478 — both copies are in the same file, so extract the 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/lance-index/src/vector/bq/storage.rs:1247 — rust/lance-index/src/vector/bq/storage.rs:1247-1264 | rust/lance-index/src/vector/bq/storage.rs:1334-1351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/storage.rs:1247` it does not close everything it opens, so those exact lines 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/lance-index/src/vector/hnsw/builder.rs:907 — rust/lance-index/src/vector/hnsw/builder.rs:907-924 | rust/lance-index/src/vector/hnsw/online.rs:351-368 — 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/lance-index/src/vector/hnsw/builder.rs:907` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:704 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:704-721 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:477-494 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs` and `rust/lance/src/dataset/mem_wal/scanner/builder.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (18 lines × 2) rust/lance/src/index/frag_reuse.rs:2403 — rust/lance/src/index/frag_reuse.rs:2403-2420 | rust/lance/src/index/frag_reuse.rs:2451-2468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/frag_reuse.rs:2403` it begins part-way through the construct above it, so those exact lines 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/lance/src/index/vector.rs:1824 — rust/lance/src/index/vector.rs:1824-1841 | rust/lance/src/index/vector.rs:1864-1881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector.rs:1824` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (18 lines × 2) rust/lance/src/index/vector/ivf/v2.rs:561 — rust/lance/src/index/vector/ivf/v2.rs:561-578 | rust/lance/src/index/vector/ivf/v2.rs:2608-2625 — both copies are in the same file, so extract the 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/lance/src/io/commit.rs:1462 — rust/lance/src/io/commit.rs:1462-1479 | rust/lance/src/io/commit.rs:2084-2101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/io/commit.rs:1462` it begins part-way through the construct above it, so those 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 · lance_encoding · ×14
  • lance_encoding::encodings::physical::axis_delta::x86_64::transform_width (cyclomatic 34) rust/lance-encoding/src/encodings/physical/axis_delta/x86_64.rs:90 — lance_encoding::encodings::physical::axis_delta::x86_64::transform_width has cyclomatic complexity 34 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • lance_encoding::encodings::logical::primitive::fullzip_decode::structure::read_row (cyclomatic 29) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode/structure.rs:201 — lance_encoding::encodings::logical::primitive::fullzip_decode::structure::read_row 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.
  • lance_encoding::encodings::logical::primitive::sparse::planar::encode (cyclomatic 29) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:249 — lance_encoding::encodings::logical::primitive::sparse::planar::encode 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.
  • lance_encoding::encodings::physical::alp::encode_chunk_f64_rd (cyclomatic 26) rust/lance-encoding/src/encodings/physical/alp.rs:1644 — lance_encoding::encodings::physical::alp::encode_chunk_f64_rd has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • lance_encoding::compression::create_fixed_width_block_decompressor_inner (cyclomatic 25) rust/lance-encoding/src/compression.rs:1828 — lance_encoding::compression::create_fixed_width_block_decompressor_inner 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.
  • lance_encoding::encodings::logical::primitive::planar::validate_page (cyclomatic 23) rust/lance-encoding/src/encodings/logical/primitive/planar.rs:277 — lance_encoding::encodings::logical::primitive::planar::validate_page 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.
  • lance_encoding::encodings::physical::axis_delta::try_tensor_per_value (cyclomatic 22) rust/lance-encoding/src/encodings/physical/axis_delta.rs:374 — lance_encoding::encodings::physical::axis_delta::try_tensor_per_value 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.
  • lance_encoding::array_encoding::physical::decoder_from_array_encoding (cyclomatic 21) rust/lance-encoding/src/array_encoding/physical.rs:141 — lance_encoding::array_encoding::physical::decoder_from_array_encoding 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.
  • lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock_range (cyclomatic 21) rust/lance-encoding/src/encodings/physical/binary.rs:692 — lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock_range 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.
  • lance_encoding::encodings::logical::primitive::dict::dict_encode_variable_width (cyclomatic 18) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:267 — lance_encoding::encodings::logical::primitive::dict::dict_encode_variable_width 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.
  • lance_encoding::encodings::logical::primitive::sparse::select_position_set (cyclomatic 18) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:1724 — lance_encoding::encodings::logical::primitive::sparse::select_position_set 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.
  • lance_encoding::encodings::physical::alp::transform_chunk_f32_avx2 (cyclomatic 18) rust/lance-encoding/src/encodings/physical/alp.rs:797 — lance_encoding::encodings::physical::alp::transform_chunk_f32_avx2 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 shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::transform_chunk_f64_avx2) 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.
  • lance_encoding::encodings::physical::alp::transform_chunk_f64_avx2 (cyclomatic 18) rust/lance-encoding/src/encodings/physical/alp.rs:1031 — lance_encoding::encodings::physical::alp::transform_chunk_f64_avx2 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 shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::transform_chunk_f32_avx2) 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.
  • lance_encoding::encodings::physical::alp::parse_header (cyclomatic 16) rust/lance-encoding/src/encodings/physical/alp.rs:1857 — lance_encoding::encodings::physical::alp::parse_header 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.
D35 · Change Coupling · Change coupling · ×14
  • Change coupling: fixed_size_list.rs ↔ value.rs rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs:1 — `rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs` and `rust/lance-encoding/src/encodings/physical/value.rs` change together 87% of the time (13 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `73ab2b57` feat: add a blob encoding for large binary values (#2868) (at that commit the file was still `rust/lance-encoding/src/encodings/physical/fixed_size_list.rs`); `310950db` feat: add a packed struct encoding to lance (#2593) (at that commit the file was still `rust/lance-encoding/src/encodings/physical/fixed_size_list.rs`); `4a114b2e` feat: enhance binary array encoding, make it the default (#2521) (at that commit the file was still `rust/lance-encoding/src/encodings/physical/fixed_size_list.rs`) — run `git show` on any of them.
  • Change coupling: encoder.rs ↔ physical.rs rust/lance-encoding/src/encoder.rs:1 — `rust/lance-encoding/src/encoder.rs` and `rust/lance-encoding/src/encodings/physical.rs` change together 78% of the time (21 of the 27 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 21 shared commits counted here, the most recent 3 are `c0546975` perf: make miniblock decoding cheaper (#3438); `3ac6d4ad` feat: fsst compression with mini-block (#3121); `3f2faf28` feat: support miniblock with binary data (#3099) — run `git show` on any of them.
  • Change coupling: binary.rs ↔ list.rs rust/lance-encoding/src/array_encoding/logical/binary.rs:1 — `rust/lance-encoding/src/array_encoding/logical/binary.rs` and `rust/lance-encoding/src/encodings/logical/list.rs` change together 78% of the time (14 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `c0546975` perf: make miniblock decoding cheaper (#3438) (at that commit the file was still `rust/lance-encoding/src/encodings/logical/binary.rs`); `4a114b2e` feat: enhance binary array encoding, make it the default (#2521) (at that commit the file was still `rust/lance-encoding/src/encodings/logical/binary.rs`); `2d8e4142` feat: add pushdown to the read path (#2444) (at that commit the file was still `rust/lance-encoding/src/encodings/logical/binary.rs`) — run `git show` on any of them.
  • Change coupling: transform.rs ↔ ivf.rs rust/lance-index/src/vector/pq/transform.rs:1 — `rust/lance-index/src/vector/pq/transform.rs` and `rust/lance/src/index/vector/ivf.rs` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `201a94d9` fix: respect precomputed partitions and shuffle buffers for v3 index …; `15420d54` perf: improve v3 indexing perf (#3525); `8c695718` refactor: remove generic PQ impl and trait (#2529) — run `git show` on any of them.
  • Change coupling: binary.rs ↔ dictionary.rs rust/lance-file/src/versions/v1/encoding/binary.rs:1 — `rust/lance-file/src/versions/v1/encoding/binary.rs` and `rust/lance-file/src/versions/v1/encoding/dictionary.rs` change together 73% of the time (16 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `c878af43` perf: create local writer for efficient local writes (#5939) (at that commit the files were still `rust/lance-io/src/encodings/binary.rs` and `rust/lance-io/src/encodings/dictionary.rs`); `50e00d65` perf: use an asynchronous open function even for local files (#1721) (at that commit the files were still `rust/lance-core/src/encodings/binary.rs` and `rust/lance-core/src/encodings/dictionary.rs`); `9a6e5683` test: fix flaky tests involving tokio::fs::File (#1430) (at that commit the files were still `rust/lance-core/src/encodings/binary.rs` and `rust/lance-core/src/encodings/dictionary.rs`) — run `git show` on any of them.
  • Change coupling: blocking_scanner.rs ↔ Query.java java/lance-jni/src/blocking_scanner.rs:1 — `java/lance-jni/src/blocking_scanner.rs` and `java/src/main/java/org/lance/ipc/Query.java` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 9 shared commits counted here, the most recent 3 are `c3d38379` feat(index): add opt-in quantized vector refinement (#8741); `690c4007` feat(java): expose vector distance bounds (#9374); `a245a182` feat(search): add search effort and auto probing through k=100000 (#9… — run `git show` on any of them.
  • Change coupling: index.rs ↔ index_caches.rs rust/lance/src/index.rs:1 — `rust/lance/src/index.rs` and `rust/lance/src/session/index_caches.rs` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `27da99a5` fix: protect fragment reuse history on stable-row-ID tables (re-land)…; `586bd89e` revert: compaction row-order suffix relabels (#8400, #9769) (#10440); `f343c6cd` fix: protect fragment reuse history on stable-row-ID tables (#9769) — run `git show` on any of them.
  • Change coupling: binary.rs ↔ encoder.rs rust/lance-encoding/src/array_encoding/logical/binary.rs:1 — `rust/lance-encoding/src/array_encoding/logical/binary.rs` and `rust/lance-encoding/src/encoder.rs` change together 61% of the time (11 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `c0546975` perf: make miniblock decoding cheaper (#3438) (at that commit the file was still `rust/lance-encoding/src/encodings/logical/binary.rs`); `4a114b2e` feat: enhance binary array encoding, make it the default (#2521) (at that commit the file was still `rust/lance-encoding/src/encodings/logical/binary.rs`); `2d8e4142` feat: add pushdown to the read path (#2444) (at that commit the file was still `rust/lance-encoding/src/encodings/logical/binary.rs`) — run `git show` on any of them.
  • Change coupling: binary.rs ↔ page_table.rs rust/lance-file/src/versions/v1/encoding/binary.rs:1 — `rust/lance-file/src/versions/v1/encoding/binary.rs` and `rust/lance-file/src/versions/v1/page_table.rs` change together 61% of the time (11 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `c878af43` perf: create local writer for efficient local writes (#5939) (at that commit the files were still `rust/lance-io/src/encodings/binary.rs` and `rust/lance-file/src/previous/page_table.rs`); `50e00d65` perf: use an asynchronous open function even for local files (#1721) (at that commit the files were still `rust/lance-core/src/encodings/binary.rs` and `rust/lance-core/src/format/page_table.rs`); `57f9269a` refactor: move reader trait to lance-core (#1393) (at that commit the files were still `rust/lance/src/encodings/binary.rs` and `rust/lance/src/format/page_table.rs`) — run `git show` on any of them.
  • Change coupling: dot.rs ↔ norm_l2.rs rust/lance-linalg/src/distance/dot.rs:1 — `rust/lance-linalg/src/distance/dot.rs` and `rust/lance-linalg/src/distance/norm_l2.rs` change together 60% of the time (18 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `4a21331d` perf(linalg): select f64 l2/dot and norm_l2 kernels once (#10101); `ec974a37` test: remove redundant work in linalg, encoding and file tests (#10815); `ab268baa` fix: fall back to AVX2 f16 kernels on AVX-512 CPUs (#7428) — run `git show` on any of them.
  • Change coupling: __init__.py ↔ indices.rs python/python/lance/indices/__init__.py:1 — `python/python/lance/indices/__init__.py` and `python/src/indices.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 6 shared commits counted here, the most recent 3 are `8ada2e9a` refactor!: remove index segment builder (#6997); `8962655c` feat: support segmented inverted index build and search (#6305); `1ef63109` refactor!: align distributed index build around segments (#6313) — run `git show` on any of them.
  • Change coupling: cosine.rs ↔ l2.rs rust/lance-linalg/src/distance/cosine.rs:1 — `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/l2.rs` change together 57% of the time (20 of the 35 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `4a21331d` perf(linalg): select f64 l2/dot and norm_l2 kernels once (#10101); `8c392b28` fix(linalg): reject a null Int8 query instead of panicking (#8884); `ab268baa` fix: fall back to AVX2 f16 kernels on AVX-512 CPUs (#7428) — run `git show` on any of them.
  • Change coupling: pq.rs ↔ index_extension.rs rust/lance/src/index/vector/pq.rs:1 — `rust/lance/src/index/vector/pq.rs` and `rust/lance/src/session/index_extension.rs` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `417b9a83` fix: panic if only one partition and split is triggered (#5241); `a767eda4` feat!: add minimum probes and maximum probes to IVF search (#3903); `59b414b5` feat: support to read IVF partitions (#3462) — run `git show` on any of them.
  • Change coupling: residual.rs ↔ ivf.rs rust/lance-index/src/vector/residual.rs:1 — `rust/lance-index/src/vector/residual.rs` and `rust/lance/src/index/vector/ivf.rs` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `c5665d1d` fix(index): reject out-of-range partition ids when computing residual…; `201a94d9` fix: respect precomputed partitions and shuffle buffers for v3 index …; `53382381` feat: int8 support for distance functions (#3605) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×14
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/dot.rs:440 — rust/lance-linalg/src/distance/dot.rs:440-440 | rust/lance-linalg/src/distance/l2.rs:462-462 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/cosine_u8.rs:110 — rust/lance-linalg/src/distance/cosine_u8.rs:110-110 | rust/lance-linalg/src/distance/cosine_u8.rs:168-168 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/l2_u8.rs:81 — rust/lance-linalg/src/distance/l2_u8.rs:81-81 | rust/lance-linalg/src/distance/l2_u8.rs:128-128 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/norm_l2.rs:223 — rust/lance-linalg/src/distance/norm_l2.rs:223-223 | rust/lance-linalg/src/distance/norm_l2.rs:296-296 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/cosine.rs:539 — rust/lance-linalg/src/distance/cosine.rs:539-539 | rust/lance-linalg/src/distance/cosine.rs:773-773 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/dot.rs:624 — rust/lance-linalg/src/distance/dot.rs:624-624 | rust/lance-linalg/src/distance/l2.rs:675-675 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/dot.rs:519 — rust/lance-linalg/src/distance/dot.rs:519-519 | rust/lance-linalg/src/distance/l2.rs:555-555 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/simd/dist_table.rs:140 — rust/lance-linalg/src/simd/dist_table.rs:140-140 | rust/lance-linalg/src/simd/dist_table.rs:429-429 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/simd/dist_table.rs:1026 — rust/lance-linalg/src/simd/dist_table.rs:1026-1026 | rust/lance-linalg/src/simd/dist_table.rs:1045-1045 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/simd/dist_table.rs:1238 — rust/lance-linalg/src/simd/dist_table.rs:1238-1238 | rust/lance-linalg/src/simd/dist_table.rs:1263-1263 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/dot_u8.rs:50 — rust/lance-linalg/src/distance/dot_u8.rs:50-50 | rust/lance-linalg/src/distance/l2_u8.rs:43-43 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/dot.rs:740 — rust/lance-linalg/src/distance/dot.rs:740-740 | rust/lance-linalg/src/distance/l2.rs:804-804 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/dot.rs:757 — rust/lance-linalg/src/distance/dot.rs:757-757 | rust/lance-linalg/src/distance/l2.rs:822-822 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust/lance-linalg/src/distance/dot.rs:774 — rust/lance-linalg/src/distance/dot.rs:774-774 | rust/lance-linalg/src/distance/l2.rs:839-839 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×14
  • Edited copy of a member (20 corresponding lines) python/src/dataset.rs:1419 — python/src/dataset.rs:1419-1438 | python/src/dataset.rs:1447-1472 — 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/lance-io/src/lib.rs:228 — rust/lance-io/src/lib.rs:228-249 | rust/lance-io/src/lib.rs:285-304 — 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/lance/src/index/vector/ivf/v2.rs:259 — rust/lance/src/index/vector/ivf/v2.rs:259-283 | rust/lance/src/index/vector/ivf/v2/partition_search.rs:567-586 — 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/lance/src/bin/fm_contains_bench.rs:210 — rust/lance/src/bin/fm_contains_bench.rs:210-231 | rust/lance/src/bin/fm_index_tool.rs:64-83 — 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/lance-index/src/scalar/inverted/builder.rs:2845 — rust/lance-index/src/scalar/inverted/builder.rs:2845-2868 | rust/lance-table/src/format/index.rs:876-895 — 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/lance/src/index/scalar/inverted.rs:475 — rust/lance/src/index/scalar/inverted.rs:475-494 | rust/lance/src/index/scalar/inverted.rs:496-515 — 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/lance-core/src/utils/row_addr_remap.rs:576 — rust/lance-core/src/utils/row_addr_remap.rs:576-595 | rust/lance-core/src/utils/row_addr_remap.rs:597-616 — 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/lance-namespace-impls/src/dir/manifest.rs:155 — rust/lance-namespace-impls/src/dir/manifest.rs:155-174 | rust/lance-namespace-impls/src/dir/manifest.rs:193-212 — 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/lance/src/io/exec/count_from_mask.rs:453 — rust/lance/src/io/exec/count_from_mask.rs:453-472 | rust/lance/src/io/exec/scalar_index.rs:451-470 — 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) java/lance-jni/src/blocking_dataset/index.rs:48 — java/lance-jni/src/blocking_dataset/index.rs:48-71 | java/lance-jni/src/blocking_dataset/index.rs:689-708 — 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/lance-namespace-impls/src/credentials/azure.rs:684 — rust/lance-namespace-impls/src/credentials/azure.rs:684-703 | rust/lance-namespace-impls/src/credentials/gcp.rs:533-558 — 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/lance/src/index/prewarm.rs:25 — rust/lance/src/index/prewarm.rs:25-44 | rust/lance/src/index/prewarm.rs:59-80 — 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/lance-index/src/vector/flat/storage.rs:135 — rust/lance-index/src/vector/flat/storage.rs:135-156 | rust/lance-index/src/vector/flat/storage.rs:313-332 — 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) python/python/lance/indices/ivf.py:55 — python/python/lance/indices/ivf.py:55-74 | python/python/lance/indices/pq.py:61-81 — 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 (10–11 lines × 2) · ×14
  • Duplicated block (10–11 lines × 2) java/lance-jni/src/blocking_dataset/construction.rs:507 — java/lance-jni/src/blocking_dataset/construction.rs:507-516 | rust/lance/src/dataset.rs:1272-1282 — 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 `java/lance-jni/src/blocking_dataset/construction.rs:507` it begins part-way through the construct above it, so those 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/lance/src/dataset.rs:1285` calls `Some` and `java/lance-jni/src/blocking_dataset/construction.rs:519` 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–11 lines × 2) rust/lance-core/src/datatypes/schema.rs:239 — rust/lance-core/src/datatypes/schema.rs:239-248 | rust/lance-core/src/datatypes/schema.rs:725-735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-core/src/datatypes/schema.rs:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10–11 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:402 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:402-411 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:762-772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:402` it begins part-way through the construct above it, so those 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/lance-encoding/src/encodings/physical/alp/restore.rs:401` calls `wrapping_add`, `_mm256_extract_epi32` and `rust/lance-encoding/src/encodings/physical/alp/restore.rs:762` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:484 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:484-493 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:810-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/lance-encoding/src/encodings/physical/alp/restore.rs:484` it begins part-way through the construct above it, so those 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/lance-encoding/src/encodings/physical/alp/restore.rs:482` calls `_mm_extract_epi32`, `_mm512_extracti32x4_epi32`, `wrapping_add` and `rust/lance-encoding/src/encodings/physical/alp/restore.rs:810` 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–11 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:558 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:558-567 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:858-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:558` it begins part-way through the construct above it, so those 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/lance-encoding/src/encodings/physical/alp/restore.rs:557` calls `wrapping_add`, `vgetq_lane_s32` and `rust/lance-encoding/src/encodings/physical/alp/restore.rs:858` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:633 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:633-642 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:906-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:633` it begins part-way through the construct above it, so those 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/lance-encoding/src/encodings/physical/alp/restore.rs:631` calls `_mm256_extract_epi64`, `_mm512_extracti64x4_epi64`, `wrapping_add` and `rust/lance-encoding/src/encodings/physical/alp/restore.rs:906` 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–11 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:704 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:704-713 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:1112-1122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:704` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:989 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:989-999 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:1049-1058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:989` it begins part-way through the construct above it, so those 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/lance-encoding/src/encodings/physical/alp/restore.rs:1048` calls `wrapping_add`, `_mm256_extract_epi64` and `rust/lance-encoding/src/encodings/physical/alp/restore.rs:989` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) rust/lance-file/src/reader.rs:2320 — rust/lance-file/src/reader.rs:2320-2329 | rust/lance-file/src/reader.rs:2534-2544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/reader.rs:2320` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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–11 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:712 — rust/lance-linalg/src/simd/dist_table.rs:712-722 | rust/lance-linalg/src/simd/dist_table.rs:732-741 — both copies are in the same file, so extract the 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–11 lines × 2) rust/lance/src/dataset/mem_wal/index/hnsw.rs:251 — rust/lance/src/dataset/mem_wal/index/hnsw.rs:251-260 | rust/lance/src/dataset/mem_wal/index/hnsw.rs:298-308 — both copies are in the same file, so extract the 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–11 lines × 2) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:643 — rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:643-652 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:743-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:743` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/optimize/planning.rs:1186 — rust/lance/src/dataset/optimize/planning.rs:1186-1196 | rust/lance/src/dataset/optimize/planning.rs:1534-1543 — both copies are in the same file, so extract the 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 (10–11 lines × 2) java/src/main/java/org/lance/OpenDatasetBuilder.java:178 — java/src/main/java/org/lance/OpenDatasetBuilder.java:178-188 | java/src/main/java/org/lance/WriteDatasetBuilder.java:397-406 — 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 `java/src/main/java/org/lance/OpenDatasetBuilder.java: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.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×13
  • Edited copy of a member (23 corresponding lines) rust/lance-encoding/src/array_encoding/strategy.rs:213 — rust/lance-encoding/src/array_encoding/strategy.rs:213-235 | rust/lance-encoding/src/array_encoding/strategy.rs:240-262 — 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/lance-index/src/scalar/list_element.rs:384 — rust/lance-index/src/scalar/list_element.rs:384-406 | rust/lance-index/src/scalar/list_element.rs:417-442 — 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/lance-linalg/src/distance/hamming.rs:754 — rust/lance-linalg/src/distance/hamming.rs:754-776 | rust/lance-linalg/src/distance/hamming.rs:825-855 — 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) python/src/dataset.rs:1997 — python/src/dataset.rs:1997-2024 | python/src/dataset.rs:2034-2056 — 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/lance-index/src/scalar/fmindex.rs:772 — rust/lance-index/src/scalar/fmindex.rs:772-794 | rust/lance-index/src/scalar/fmindex.rs:796-819 — 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/lance/src/dataset/mem_wal/hnsw/graph.rs:495 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:495-526 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:532-554 — 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) python/src/dataset.rs:3326 — python/src/dataset.rs:3326-3348 | python/src/dataset.rs:3362-3389 — 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) java/lance-jni/src/index_progress.rs:98 — java/lance-jni/src/index_progress.rs:98-125 | java/lance-jni/src/index_progress.rs:127-149 — 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/lance-index/src/vector/pq.rs:370 — rust/lance-index/src/vector/pq.rs:370-393 | rust/lance-index/src/vector/pq.rs:426-448 — 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/lance-index/src/vector/distributed/index_merger.rs:260 — rust/lance-index/src/vector/distributed/index_merger.rs:260-282 | rust/lance-index/src/vector/distributed/index_merger.rs:339-362 — 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/lance/src/dataset/blob/external.rs:291 — rust/lance/src/dataset/blob/external.rs:291-315 | rust/lance/src/dataset/blob/write.rs:841-863 — 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/lance-index/src/vector/flat/storage.rs:584 — rust/lance-index/src/vector/flat/storage.rs:584-606 | rust/lance-index/src/vector/flat/storage.rs:613-635 — 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/lance-jsonb/src/number.rs:710 — rust/lance-jsonb/src/number.rs:710-732 | rust/lance-jsonb/src/number.rs:734-756 — 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.
D1 · Cyclomatic Complexity · Dataset · ×12
  • Dataset::scanner (cyclomatic 72) python/src/dataset.rs:943 — Dataset::scanner has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dataset::create_index (cyclomatic 51) python/src/dataset.rs:2451 — Dataset::create_index 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.
  • Dataset::create_data_file (cyclomatic 26) rust/lance/src/dataset.rs:2832 — Dataset::create_data_file has cyclomatic complexity 26 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dataset::merge_existing_index_segments (cyclomatic 26) rust/lance/src/index/lifecycle.rs:657 — Dataset::merge_existing_index_segments 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.
  • Dataset::open_vector_index_from_metadata_with_plan (cyclomatic 23) rust/lance/src/index/loading.rs:1007 — Dataset::open_vector_index_from_metadata_with_plan 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.
  • Dataset::commit_existing_index_segments (cyclomatic 21) rust/lance/src/index/lifecycle.rs:855 — Dataset::commit_existing_index_segments 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.
  • Dataset::scalar_index_info_with_plugins (cyclomatic 21) rust/lance/src/index/loading.rs:668 — Dataset::scalar_index_info_with_plugins 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.
  • Dataset::new (cyclomatic 20) python/src/dataset.rs:538 — Dataset::new has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Dataset::filter_addr_or_ids (cyclomatic 20) rust/lance/src/dataset.rs:3643 — Dataset::filter_addr_or_ids 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.
  • Dataset::count_indexed_rows (cyclomatic 19) rust/lance/src/dataset/scanner.rs:687 — Dataset::count_indexed_rows 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.
  • Dataset::commit_transaction (cyclomatic 16) python/src/dataset.rs:2995 — Dataset::commit_transaction 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.
  • Dataset::load_manifest (cyclomatic 16) rust/lance/src/dataset.rs:913 — Dataset::load_manifest 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×12
  • Duplicated block (17 lines × 2) java/lance-jni/src/schema.rs:257 — java/lance-jni/src/schema.rs:257-273 | java/lance-jni/src/schema.rs:315-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/schema.rs:257` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) rust/lance-core/src/datatypes/field.rs:1275 — rust/lance-core/src/datatypes/field.rs:1275-1291 | rust/lance-encoding/src/encoder/structural.rs:236-252 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `field` to `&ArrowField` in one and `&Field` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) rust/lance-encoding/src/decoder.rs:1801 — rust/lance-encoding/src/decoder.rs:1801-1817 | rust/lance-encoding/src/decoder.rs:2286-2302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/decoder.rs:1801` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:848 — rust/lance-encoding/src/encodings/physical/alp.rs:848-864 | rust/lance-encoding/src/encodings/physical/alp.rs:922-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/lance-encoding/src/encodings/physical/alp.rs:848` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:1088 — rust/lance-encoding/src/encodings/physical/alp.rs:1088-1104 | rust/lance-encoding/src/encodings/physical/alp.rs:1162-1178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:1088` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/binary.rs:1153 — rust/lance-encoding/src/encodings/physical/binary.rs:1153-1169 | rust/lance-encoding/src/encodings/physical/binary.rs:1177-1193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/binary.rs:1153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/bitmap.rs:571 — rust/lance-index/src/scalar/bitmap.rs:571-587 | rust/lance-index/src/scalar/bitmap.rs:619-635 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/bitmap.rs:571` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:223 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:223-239 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:139-155 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 166 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 (17 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:116 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:116-132 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:151-167 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.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/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.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 (17 lines × 2) rust/lance/src/dataset/scanner/fts.rs:1691 — rust/lance/src/dataset/scanner/fts.rs:1691-1707 | rust/lance/src/dataset/scanner/fts.rs:2055-2071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/scanner/fts.rs:1691` it does not close everything it opens, so those exact lines 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/lance/src/dataset/scanner/fts.rs:2754 — rust/lance/src/dataset/scanner/fts.rs:2754-2770 | rust/lance/src/dataset/scanner/fts.rs:2820-2836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/scanner/fts.rs:2754` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/write/merge_insert/exec/write.rs:433 — rust/lance/src/dataset/write/merge_insert/exec/write.rs:433-449 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1026-1042 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/write/merge_insert/exec/write.rs:433` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D2 · Cognitive Complexity · Wand · ×11
  • Wand::maxscore_search (cognitive 513) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:180 — Wand::maxscore_search has cognitive complexity 513 (threshold 15). Drivers by points: if/else 80 (392 pts), loops 20 (76 pts), match/switch 14 (23 pts), boolean chains 22 (nesting depth added 377). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Wand::and_bulk_search (cognitive 193) rust/lance-index/src/scalar/inverted/wand/bulk_conjunction.rs:34 — Wand::and_bulk_search has cognitive complexity 193 (threshold 15). Drivers by points: if/else 86 (220 pts), loops 33 (65 pts), match/switch 8 (24 pts), boolean chains 9 (nesting depth added 182). To reduce it, split the body into named stages: move each independent 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 (Wand::and_bulk_search::merge_window_docs_pairwise) 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.
  • Wand::complete_maxscore_single_essential (cognitive 103) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1278 — Wand::complete_maxscore_single_essential has cognitive complexity 103 (threshold 15). Drivers by points: if/else 28 (70 pts), loops 10 (23 pts), boolean chains 10 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Wand::next_and_candidate (cognitive 65) rust/lance-index/src/scalar/inverted/wand/conjunction.rs:173 — Wand::next_and_candidate has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (56 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Wand::search (cognitive 63) rust/lance-index/src/scalar/inverted/wand.rs:554 — Wand::search has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (54 pts), boolean chains 8, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Wand::next (cognitive 41) rust/lance-index/src/scalar/inverted/wand/disjunction.rs:27 — Wand::next has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 3 (5 pts), match/switch 1 (3 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.
  • Wand::prepare_score_first_and_window (cognitive 31) rust/lance-index/src/scalar/inverted/wand/conjunction.rs:60 — Wand::prepare_score_first_and_window has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 3, 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.
  • Wand::score_single_essential_upto (cognitive 29) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1155 — Wand::score_single_essential_upto has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Wand::flat_search (cognitive 24) rust/lance-index/src/scalar/inverted/wand.rs:718 — Wand::flat_search has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, 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.
  • Wand::and_bulk_search::merge_window_docs_pairwise (cognitive 20) rust/lance-index/src/scalar/inverted/wand/bulk_conjunction.rs:374 — Wand::and_bulk_search::merge_window_docs_pairwise has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Wand::and_bulk_search) 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.
  • Wand::check_positions (cognitive 17) rust/lance-index/src/scalar/inverted/wand/phrase.rs:33 — Wand::check_positions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction · ×11
  • Transaction::build_manifest_prepared (cognitive 377) rust/lance-table/src/transaction/manifest_build.rs:747 — Transaction::build_manifest_prepared has cognitive complexity 377 (threshold 15). Drivers by points: if/else 110 (243 pts), loops 34 (84 pts), boolean chains 33, match/switch 10 (17 pts) (nesting depth added 190). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Transaction::withdraw_coverage (cognitive 40) rust/lance-table/src/transaction/index_maintenance.rs:379 — Transaction::withdraw_coverage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Transaction::try_from (cognitive 39) rust/lance-table/src/transaction/proto.rs:88 — Transaction::try_from has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 4, 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.
  • Transaction::retain_relevant_indices (cognitive 32) rust/lance-table/src/transaction/index_maintenance.rs:710 — Transaction::retain_relevant_indices has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (11 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.
  • Transaction::prune_overlay_stale_fields_from_indices (cognitive 28) rust/lance-table/src/transaction/index_maintenance.rs:662 — Transaction::prune_overlay_stale_fields_from_indices has cognitive complexity 28 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 3 (10 pts), boolean chains 2 (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • Transaction::handle_rewrite_fragments (cognitive 26) rust/lance-table/src/transaction/index_maintenance.rs:1031 — Transaction::handle_rewrite_fragments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Transaction::handle_rewrite_indices (cognitive 22) rust/lance-table/src/transaction/index_maintenance.rs:897 — Transaction::handle_rewrite_indices has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Transaction::apply_mem_wal_index_coverage (cognitive 19) rust/lance-table/src/transaction/manifest_build.rs:355 — Transaction::apply_mem_wal_index_coverage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Transaction::prepare_indices (cognitive 19) rust/lance-table/src/transaction/manifest_build.rs:577 — Transaction::prepare_indices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (7 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.
  • Transaction::assign_row_ids (cognitive 18) rust/lance-table/src/transaction/row_version.rs:332 — Transaction::assign_row_ids has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (10 pts), loops 2 (5 pts), if/else 2 (3 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.
  • Transaction::register_pure_rewrite_rows_update_frags_in_indices (cognitive 17) rust/lance-table/src/transaction/index_maintenance.rs:61 — Transaction::register_pure_rewrite_rows_update_frags_in_indices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×11
  • Members sharing a duplicated core (4 members, 50+ identical tokens) java/lance-jni/src/mem_wal.rs:777 — java/lance-jni/src/mem_wal.rs:777-806 | java/lance-jni/src/mem_wal.rs:899-946 | python/src/mem_wal.rs:754-778 | python/src/mem_wal.rs:828-873 — 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/lance-file/src/versions/v2_0/reader.rs:137 — rust/lance-file/src/versions/v2_0/reader.rs:137-148 | rust/lance-file/src/versions/v2_1/reader.rs:183-194 | rust/lance-file/src/versions/v2_2/reader.rs:185-196 | rust/lance-file/src/versions/v2_3/reader.rs:348-359 — 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/lance-file/src/versions/v2_0/reader.rs:350 — rust/lance-file/src/versions/v2_0/reader.rs:350-378 | rust/lance-file/src/versions/v2_1/reader.rs:218-244 | rust/lance-file/src/versions/v2_2/reader.rs:220-246 | rust/lance-file/src/versions/v2_3/reader.rs:383-409 — 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/lance-index/src/vector/bq/storage.rs:2357 — rust/lance-index/src/vector/bq/storage.rs:2357-2380 | rust/lance-index/src/vector/bq/storage.rs:2390-2419 | rust/lance-index/src/vector/storage.rs:219-247 | rust/lance-index/src/vector/storage.rs:259-286 — 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/lance-linalg/src/simd/f32.rs:262 — rust/lance-linalg/src/simd/f32.rs:262-279 | rust/lance-linalg/src/simd/f32.rs:281-298 | rust/lance-linalg/src/simd/f64.rs:155-172 | rust/lance-linalg/src/simd/f64.rs:174-191 — 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/lance-linalg/src/simd/f32.rs:750 — rust/lance-linalg/src/simd/f32.rs:750-769 | rust/lance-linalg/src/simd/f32.rs:772-791 | rust/lance-linalg/src/simd/f64.rs:595-615 | rust/lance-linalg/src/simd/f64.rs:618-638 — 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/lance-namespace-impls/src/credentials/azure.rs:392 — rust/lance-namespace-impls/src/credentials/azure.rs:392-433 | rust/lance-namespace-impls/src/credentials/azure.rs:435-491 | rust/lance-namespace-impls/src/credentials/azure.rs:497-550 | rust/lance-namespace-impls/src/credentials/gcp.rs:1097-1133 — 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/lance-namespace-impls/src/dir/manifest.rs:3250 — rust/lance-namespace-impls/src/dir/manifest.rs:3250-3370 | rust/lance-namespace-impls/src/dir/manifest.rs:4294-4350 | rust/lance-namespace-impls/src/dir/manifest.rs:4359-4403 | rust/lance-namespace-impls/src/dir/manifest.rs:4411-4453 — 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/lance/src/dataset/mem_wal/scanner/fts_search.rs:1243 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1243-1459 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:379-546 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:818-986 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:614-858 — 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/lance/src/dataset/refs.rs:226 — rust/lance/src/dataset/refs.rs:226-240 | rust/lance/src/dataset/refs.rs:261-274 | rust/lance/src/dataset/refs.rs:276-303 | rust/lance/src/dataset/refs.rs:309-330 — 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) java/src/main/java/org/lance/Dataset.java:1583 — java/src/main/java/org/lance/Dataset.java:1583-1592 | java/src/main/java/org/lance/Dataset.java:1624-1635 | java/src/main/java/org/lance/Dataset.java:2278-2287 | java/src/main/java/org/lance/Dataset.java:2400-2409 — 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) · ×11
  • Edited copy of a member (24 corresponding lines) rust/lance-encoding/src/array_encoding/logical/struct.rs:584 — rust/lance-encoding/src/array_encoding/logical/struct.rs:584-609 | rust/lance-encoding/src/encodings/logical/struct.rs:341-364 — 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/lance-core/src/cache/mod.rs:761 — rust/lance-core/src/cache/mod.rs:761-784 | rust/lance-core/src/cache/mod.rs:1050-1074 — 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/lance-core/src/memory/components.rs:110 — rust/lance-core/src/memory/components.rs:110-133 | rust/lance-core/src/memory/observer.rs:365-388 — 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/lance/src/dataset.rs:3976 — rust/lance/src/dataset.rs:3976-4008 | rust/lance/src/dataset.rs:4030-4053 — 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/lance-jsonb/src/functions/scalar.rs:502 — rust/lance-jsonb/src/functions/scalar.rs:502-526 | rust/lance-jsonb/src/functions/scalar.rs:593-616 — 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/lance-file/src/reader.rs:1385 — rust/lance-file/src/reader.rs:1385-1409 | rust/lance-file/src/reader.rs:1825-1848 — 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/lance-file/src/versions/v2_1/compression.rs:90 — rust/lance-file/src/versions/v2_1/compression.rs:90-113 | rust/lance-file/src/versions/v2_2/compression.rs:82-107 — 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/lance/src/dataset/mem_wal/index/btree.rs:405 — rust/lance/src/dataset/mem_wal/index/btree.rs:405-428 | rust/lance/src/dataset/mem_wal/index/btree.rs:619-642 — 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) java/lance-jni/src/blocking_dataset/index.rs:440 — java/lance-jni/src/blocking_dataset/index.rs:440-463 | java/lance-jni/src/blocking_dataset/index.rs:494-519 — 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) python/python/ci_benchmarks/datagen/merge_insert.py:363 — python/python/ci_benchmarks/datagen/merge_insert.py:363-386 | python/python/ci_benchmarks/datagen/merge_insert.py:390-415 — 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/lance-file/test_data/exact_versions/datagen.rs:106 — rust/lance-file/test_data/exact_versions/datagen.rs:106-131 | rust/lance-file/test_data/exact_versions/datagen.rs:133-156 — 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 (25 lines × 2) · ×11
  • Duplicated block (25 lines × 2) java/lance-jni/src/blocking_dataset/read.rs:604 — java/lance-jni/src/blocking_dataset/read.rs:604-628 | java/lance-jni/src/blocking_dataset/read.rs:907-931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/blocking_dataset/read.rs:604` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/reader/structural.rs:31 — rust/lance-file/src/reader/structural.rs:31-55 | rust/lance-file/src/versions/v2_0/reader.rs:31-55 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-index/src/scalar/bloomfilter.rs:534 — rust/lance-index/src/scalar/bloomfilter.rs:534-558 | rust/lance-index/src/scalar/zonemap.rs:1135-1159 — before extracting anything, compare `rust/lance-index/src/scalar/bloomfilter.rs` and `rust/lance-index/src/scalar/zonemap.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/lance-index/src/scalar/bloomfilter.rs:534` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:370 — rust/lance-index/src/scalar/inverted/wand/maxscore.rs:370-394 | rust/lance-index/src/scalar/inverted/wand/maxscore.rs:664-688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/wand/maxscore.rs:370` it begins part-way through the construct above it, so those exact lines 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/lance-io/src/uring/current_thread.rs:171 — rust/lance-io/src/uring/current_thread.rs:171-195 | rust/lance-io/src/uring/thread.rs:467-491 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/thread.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-io/src/uring/current_thread.rs:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) rust/lance-jsonb/src/core/iterator.rs:51 — rust/lance-jsonb/src/core/iterator.rs:51-75 | rust/lance-jsonb/src/core/iterator.rs:131-155 — both copies are in the same file, so extract the 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 (25 lines × 2) rust/lance-table/src/rowids.rs:98 — rust/lance-table/src/rowids.rs:98-122 | rust/lance-table/src/rowids.rs:139-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/rowids.rs:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) rust/lance/src/dataset/blob/prepared.rs:26 — rust/lance/src/dataset/blob/prepared.rs:26-50 | rust/lance/src/dataset/blob/write.rs:599-623 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (25 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:130 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:130-154 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:105-129 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 166 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/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.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 (25 lines × 2) rust/lance/src/dataset/optimize/remapping.rs:396 — rust/lance/src/dataset/optimize/remapping.rs:396-420 | rust/lance/src/dataset/optimize/remapping.rs:1117-1141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/optimize/remapping.rs:396` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-namespace-impls/src/credentials/gcp.rs:702 — rust/lance-namespace-impls/src/credentials/gcp.rs:702-728 | rust/lance-namespace-impls/src/credentials/gcp.rs:788-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/credentials/gcp.rs:702` it does not close everything it opens, so those 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/lance-namespace-impls/src/credentials/gcp.rs:786` calls `normalize_workload_identity_audience` and `rust/lance-namespace-impls/src/credentials/gcp.rs:700` 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–9 lines × 2) · ×11
  • Duplicated block (8–9 lines × 2) java/lance-jni/src/mem_wal.rs:786 — java/lance-jni/src/mem_wal.rs:786-794 | python/src/mem_wal.rs:761-768 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `java/lance-jni/src/mem_wal.rs:786` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-datafusion-exec/src/udf/json.rs:322 — rust/lance-datafusion-exec/src/udf/json.rs:322-329 | rust/lance-datafusion-exec/src/udf/json.rs:603-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-datafusion-exec/src/udf/json.rs:322` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:879 — rust/lance-file/src/versions/v2_0/writer.rs:879-887 | rust/lance-file/src/writer/structural.rs:862-869 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/versions/v2_0/writer.rs:879` it does not close everything it opens, so those exact 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/lance-index/src/scalar/bitmap.rs:688 — rust/lance-index/src/scalar/bitmap.rs:688-695 | rust/lance-index/src/scalar/bitmap.rs:746-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:1869 — rust/lance-index/src/scalar/inverted/builder.rs:1869-1876 | rust/lance-index/src/scalar/inverted/builder.rs:1941-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.
  • Duplicated block (8–9 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:2055 — rust/lance-index/src/scalar/inverted/builder.rs:2055-2063 | rust/lance-index/src/scalar/inverted/builder.rs:2068-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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/lance-index/src/vector/ivf/shuffler.rs:611 — rust/lance-index/src/vector/ivf/shuffler.rs:611-618 | rust/lance-index/src/vector/ivf/shuffler.rs:641-649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/ivf/shuffler.rs:641` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) rust/lance-linalg/src/simd/f32.rs:339 — rust/lance-linalg/src/simd/f32.rs:339-347 | rust/lance-linalg/src/simd/f32.rs:832-839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-linalg/src/simd/f32.rs:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) rust/lance-table/src/utils/stream.rs:287 — rust/lance-table/src/utils/stream.rs:287-295 | rust/lance-table/src/utils/stream.rs:312-319 — both copies are in the same file, so extract the 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 (8–9 lines × 2) rust/lance/src/dataset/update_join.rs:726 — rust/lance/src/dataset/update_join.rs:726-733 | rust/lance/src/dataset/update_join.rs:962-970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/update_join.rs:726` it does not close everything it opens, so those 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/lance/src/dataset/update_join.rs:723` calls `iter`, `any`, `push` and `rust/lance/src/dataset/update_join.rs:961` 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/lance/src/index/vector/hamming.rs:510 — rust/lance/src/index/vector/hamming.rs:510-517 | rust/lance/src/index/vector/hamming.rs:626-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector/hamming.rs:510` it begins part-way through the construct above it, so those 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/lance/src/index/vector/hamming.rs:625` calls `limit`, `Some` and `rust/lance/src/index/vector/hamming.rs:509` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×11
  • Duplicated block (5 lines × 3) rust/lance-core/src/cache/telemetry.rs:430 — rust/lance-core/src/cache/telemetry.rs:430-434 | rust/lance-core/src/cache/telemetry.rs:531-535 | rust/lance-core/src/cache/telemetry.rs:550-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.
  • Duplicated block (5 lines × 3) rust/lance-datafusion-exec/src/udf/json.rs:326 — rust/lance-datafusion-exec/src/udf/json.rs:326-330 | rust/lance-datafusion-exec/src/udf/json.rs:555-559 | rust/lance-datafusion-exec/src/udf/json.rs:608-612 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-datafusion-exec/src/udf/json.rs:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) rust/lance-encoding/src/encodings/logical/list.rs:54 — rust/lance-encoding/src/encodings/logical/list.rs:54-59 | rust/lance-encoding/src/encodings/logical/list.rs:66-70 | rust/lance-encoding/src/encodings/logical/map.rs:57-61 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) rust/lance-index/src/scalar/btree.rs:278 — rust/lance-index/src/scalar/btree.rs:278-282 | rust/lance-index/src/scalar/btree.rs:292-296 | rust/lance-index/src/scalar/btree.rs:306-310 — all 3 copies are in the same file, so extract the block into one function there and call 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 (5 lines × 3) rust/lance-index/src/scalar/json.rs:1088 — rust/lance-index/src/scalar/json.rs:1088-1092 | rust/lance-index/src/scalar/json.rs:1109-1113 | rust/lance-index/src/scalar/json.rs:1130-1134 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-index/src/scalar/json.rs:1088` it does not close everything it opens, so those exact lines 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/lance-index/src/vector/bq/ex_dot.rs:822 — rust/lance-index/src/vector/bq/ex_dot.rs:822-827 | rust/lance-index/src/vector/bq/ex_dot.rs:876-880 | rust/lance-index/src/vector/bq/ex_dot.rs:1575-1580 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-index/src/vector/bq/ex_dot.rs:822` it does not close everything it opens, so those exact lines 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/lance/src/io/exec/fts/combined_fields.rs:480 — rust/lance/src/io/exec/fts/combined_fields.rs:480-484 | rust/lance/src/io/exec/fts/match_query.rs:580-584 | rust/lance/src/io/exec/fts/phrase.rs:504-508 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) java/lance-jni/src/blocking_blob.rs:61 — java/lance-jni/src/blocking_blob.rs:61-65 | java/lance-jni/src/blocking_blob.rs:118-124 | java/lance-jni/src/blocking_blob.rs:153-157 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/blocking_blob.rs:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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/lance-namespace-impls/src/credentials/aws.rs:299 — rust/lance-namespace-impls/src/credentials/aws.rs:299-303 | rust/lance-namespace-impls/src/credentials/azure.rs:237-241 | rust/lance-namespace-impls/src/credentials/gcp.rs:757-761 — before extracting anything, compare `rust/lance-namespace-impls/src/credentials/aws.rs` and `rust/lance-namespace-impls/src/credentials/gcp.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/lance-datafusion-exec/src/expr.rs:130 — rust/lance-datafusion-exec/src/expr.rs:130-134 | rust/lance-datafusion-exec/src/expr.rs:156-160 | rust/lance-datafusion-exec/src/expr.rs:184-188 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-datafusion-exec/src/expr.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-datafusion-exec/src/expr.rs:155` calls `Int32`, `Some`, `from` and `rust/lance-datafusion-exec/src/expr.rs:183` 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/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1047 — rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1047-1051 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1088-1092 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1106-1110 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D6 · Cohesion (LCOM4) · Low cohesion · ×11
  • Low cohesion: Dataset (LCOM4 22) rust/lance/src/dataset.rs:256 — Dataset's methods fall into 22 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 22 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: ShardWriterConfig (LCOM4 19) rust/lance/src/dataset/mem_wal/write/config.rs:23 — ShardWriterConfig's methods fall into 19 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 19 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: FilteredReadOptions (LCOM4 10) rust/lance/src/io/exec/filtered_read.rs:1970 — FilteredReadOptions's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: RowAddrTreeMap (LCOM4 8) rust/lance-select/src/mask.rs:504 — RowAddrTreeMap'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: MatchQuery (LCOM4 7) rust/lance-index/src/scalar/inverted/query.rs:340 — MatchQuery'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: RawJsonb (LCOM4 7) rust/lance-jsonb/src/raw.rs:23 — RawJsonb'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: CleanupOperation (LCOM4 5) rust/lance/src/dataset/cleanup.rs:677 — CleanupOperation'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: IVFIndex (LCOM4 5) rust/lance/src/index/vector/ivf/v2.rs:1541 — IVFIndex'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: FtsQuery (LCOM4 4) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:100 — FtsQuery'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: ListRetryStream (LCOM4 4) rust/lance-io/src/object_store/list_retry.rs:19 — ListRetryStream'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: RowIdSequence (LCOM4 4) rust/lance-table/src/rowids.rs:52 — RowIdSequence's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D2 · Cognitive Complexity · TransactionRebase · ×10
  • TransactionRebase::check_create_index_txn (cognitive 135) rust/lance/src/io/commit/conflict_resolver/check/create_index.rs:7 — TransactionRebase::check_create_index_txn has cognitive complexity 135 (threshold 15). Drivers by points: if/else 32 (93 pts), boolean chains 20, loops 5 (20 pts), match/switch 1 (2 pts) (nesting depth added 77). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TransactionRebase::check_rewrite_txn (cognitive 119) rust/lance/src/io/commit/conflict_resolver/check/rewrite.rs:7 — TransactionRebase::check_rewrite_txn has cognitive complexity 119 (threshold 15). Drivers by points: if/else 24 (74 pts), loops 8 (35 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TransactionRebase::check_update_txn (cognitive 105) rust/lance/src/io/commit/conflict_resolver/check.rs:195 — TransactionRebase::check_update_txn has cognitive complexity 105 (threshold 15). Drivers by points: if/else 25 (82 pts), loops 5 (16 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TransactionRebase::check_data_replacement_txn (cognitive 95) rust/lance/src/io/commit/conflict_resolver/check.rs:557 — TransactionRebase::check_data_replacement_txn has cognitive complexity 95 (threshold 15). Drivers by points: if/else 11 (45 pts), loops 12 (44 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TransactionRebase::finish_create_index (cognitive 74) rust/lance/src/io/commit/conflict_resolver/finish.rs:303 — TransactionRebase::finish_create_index has cognitive complexity 74 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 5 (15 pts), boolean chains 7, match/switch 2 (6 pts) (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TransactionRebase::finish_rewrite (cognitive 47) rust/lance/src/io/commit/conflict_resolver/finish.rs:564 — TransactionRebase::finish_rewrite has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (33 pts), match/switch 4 (11 pts), boolean chains 3 (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.
  • TransactionRebase::finish_delete_update (cognitive 39) rust/lance/src/io/commit/conflict_resolver/finish.rs:56 — TransactionRebase::finish_delete_update has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (10 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TransactionRebase::check_delete_txn (cognitive 37) rust/lance/src/io/commit/conflict_resolver/check.rs:89 — TransactionRebase::check_delete_txn has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TransactionRebase::check_data_overlay_txn (cognitive 24) rust/lance/src/io/commit/conflict_resolver/check.rs:740 — TransactionRebase::check_data_overlay_txn has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • TransactionRebase::check_add_bases_txn (cognitive 20) rust/lance/src/io/commit/conflict_resolver/check.rs:1145 — TransactionRebase::check_add_bases_txn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×10
  • Edited copy of a member (42 corresponding lines) rust/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-964 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1604 — 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/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-965 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1605 — 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/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-966 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1606 — 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/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-967 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1607 — 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/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-968 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1608 — 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/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-969 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1609 — 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/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-970 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1610 — 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/lance-index/src/vector/bq/ex_dot.rs:851 — rust/lance-index/src/vector/bq/ex_dot.rs:851-971 | rust/lance-index/src/vector/bq/ex_dot.rs:1552-1611 — 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/lance-select/src/mask/nullable.rs:278 — rust/lance-select/src/mask/nullable.rs:278-319 | rust/lance-select/src/mask/nullable.rs:325-373 — 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/lance/src/dataset/mem_wal/index/fts.rs:415 — rust/lance/src/dataset/mem_wal/index/fts.rs:415-460 | rust/lance/src/dataset/mem_wal/index/fts.rs:464-505 — 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 (6 corresponding lines) · ×10
  • Edited copy of a member (6 corresponding lines) rust/lance-index/src/vector/bq/ex_dot.rs:646 — rust/lance-index/src/vector/bq/ex_dot.rs:646-652 | rust/lance-index/src/vector/bq/ex_dot.rs:1420-1425 — 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) java/src/main/java/org/lance/index/vector/VectorIndexParams.java:86 — java/src/main/java/org/lance/index/vector/VectorIndexParams.java:86-96 | java/src/main/java/org/lance/index/vector/VectorIndexParams.java:120-125 — 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/lance-file/src/versions/v2_0/writer.rs:230 — rust/lance-file/src/versions/v2_0/writer.rs:230-235 | rust/lance-file/src/writer/structural.rs:189-194 — 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) java/lance-jni/src/mem_wal.rs:1422 — java/lance-jni/src/mem_wal.rs:1422-1427 | java/lance-jni/src/utils.rs:680-689 — 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/lance/src/io/exec/count_from_mask.rs:477 — rust/lance/src/io/exec/count_from_mask.rs:477-482 | rust/lance/src/io/exec/scalar_index.rs:475-480 — 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) python/src/datagen.rs:65 — python/src/datagen.rs:65-71 | python/src/lib.rs:132-137 — 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) python/src/dataset/optimize.rs:231 — python/src/dataset/optimize.rs:231-239 | python/src/fragment.rs:991-996 — 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) python/src/dataset/optimize.rs:343 — python/src/dataset/optimize.rs:343-351 | python/src/fragment.rs:1043-1048 — 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/lance-core/src/cache/telemetry.rs:668 — rust/lance-core/src/cache/telemetry.rs:668-673 | rust/lance-io/src/object_store.rs:2593-2598 — 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/lance-file/src/reader/structural.rs:174 — rust/lance-file/src/reader/structural.rs:174-179 | rust/lance-file/src/versions/v2_0/reader.rs:177-182 — 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 (21 lines × 2) · ×10
  • Duplicated block (21 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:438 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:438-458 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:499-519 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:438` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:474 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:474-494 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:535-555 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:474` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:531 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:531-551 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:628-648 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:531` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:567 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:567-587 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:592-612 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 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/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:567` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) rust/lance-encoding/src/decoder.rs:1745 — rust/lance-encoding/src/decoder.rs:1745-1765 | rust/lance-encoding/src/decoder.rs:1982-2002 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/decoder.rs:1745` it does not close everything it opens, so those exact lines 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/lance-io/src/object_store/providers/azure.rs:270 — rust/lance-io/src/object_store/providers/azure.rs:270-290 | rust/lance-io/src/object_store/providers/gcp.rs:308-328 — before extracting anything, compare `rust/lance-io/src/object_store/providers/azure.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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/lance-io/src/object_store/providers/azure.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 (21 lines × 2) rust/lance-io/src/object_store/providers/azure.rs:298 — rust/lance-io/src/object_store/providers/azure.rs:298-318 | rust/lance-io/src/object_store/providers/gcp.rs:336-356 — before extracting anything, compare `rust/lance-io/src/object_store/providers/azure.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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/lance-io/src/object_store/providers/azure.rs:298` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-io/src/object_store/providers/oss.rs:70 — rust/lance-io/src/object_store/providers/oss.rs:70-90 | rust/lance-io/src/object_store/providers/tos.rs:76-96 — before extracting anything, compare `rust/lance-io/src/object_store/providers/oss.rs` and `rust/lance-io/src/object_store/providers/tos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/lance-io/src/object_store/providers/oss.rs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:91 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:91-111 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:126-146 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.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. 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 (21 lines × 2) rust/lance/src/io/commit.rs:679 — rust/lance/src/io/commit.rs:679-699 | rust/lance/src/io/commit.rs:718-738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/io/commit.rs:679` it does not close everything it opens, so those 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/lance/src/io/commit.rs:739` calls `propagate_commit_error_after_success`, `Err` and `rust/lance/src/io/commit.rs:700` 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.
D1 · Cyclomatic Complexity · TransactionRebase · ×9
  • TransactionRebase::check_create_index_txn (cyclomatic 62) rust/lance/src/io/commit/conflict_resolver/check/create_index.rs:7 — TransactionRebase::check_create_index_txn 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.
  • TransactionRebase::check_update_txn (cyclomatic 42) rust/lance/src/io/commit/conflict_resolver/check.rs:195 — TransactionRebase::check_update_txn has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TransactionRebase::check_rewrite_txn (cyclomatic 41) rust/lance/src/io/commit/conflict_resolver/check/rewrite.rs:7 — TransactionRebase::check_rewrite_txn 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.
  • TransactionRebase::check_data_replacement_txn (cyclomatic 36) rust/lance/src/io/commit/conflict_resolver/check.rs:557 — TransactionRebase::check_data_replacement_txn has cyclomatic complexity 36 (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.
  • TransactionRebase::finish_create_index (cyclomatic 31) rust/lance/src/io/commit/conflict_resolver/finish.rs:303 — TransactionRebase::finish_create_index 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.
  • TransactionRebase::check_txn (cyclomatic 30) rust/lance/src/io/commit/conflict_resolver/check.rs:10 — TransactionRebase::check_txn 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.
  • TransactionRebase::finish_rewrite (cyclomatic 20) rust/lance/src/io/commit/conflict_resolver/finish.rs:564 — TransactionRebase::finish_rewrite 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.
  • TransactionRebase::check_delete_txn (cyclomatic 17) rust/lance/src/io/commit/conflict_resolver/check.rs:89 — TransactionRebase::check_delete_txn 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.
  • TransactionRebase::check_data_overlay_txn (cyclomatic 17) rust/lance/src/io/commit/conflict_resolver/check.rs:740 — TransactionRebase::check_data_overlay_txn 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 · lance_jni · ×9
  • lance_jni::transaction::convert_to_rust_operation (cognitive 46) java/lance-jni/src/transaction.rs:1761 — lance_jni::transaction::convert_to_rust_operation has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (33 pts), match/switch 3 (7 pts), loops 2 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_jni::blocking_scanner::build_scanner_with_options (cognitive 36) java/lance-jni/src/blocking_scanner.rs:353 — lance_jni::blocking_scanner::build_scanner_with_options has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27 (31 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_jni::index::determine_index_type (cognitive 28) java/lance-jni/src/index.rs:267 — lance_jni::index::determine_index_type has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22 (27 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_jni::transaction::convert_to_java_operation_inner (cognitive 28) java/lance-jni/src/transaction.rs:890 — lance_jni::transaction::convert_to_java_operation_inner has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 9 (17 pts), loops 2 (6 pts), if/else 3 (5 pts) (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.
  • lance_jni::file_reader::Java_org_lance_file_LanceFileReader_readAllNative (cognitive 22) java/lance-jni/src/file_reader.rs:215 — lance_jni::file_reader::Java_org_lance_file_LanceFileReader_readAllNative has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_jni::transaction::inner_commit_to_uri (cognitive 18) java/lance-jni/src/transaction.rs:2339 — lance_jni::transaction::inner_commit_to_uri has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • lance_jni::transaction::inner_commit_to_dataset (cognitive 17) java/lance-jni/src/transaction.rs:1352 — lance_jni::transaction::inner_commit_to_dataset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_jni::utils::build_compaction_options (cognitive 17) java/lance-jni/src/utils.rs:203 — lance_jni::utils::build_compaction_options has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • lance_jni::utils::get_vector_index_params (cognitive 16) java/lance-jni/src/utils.rs:373 — lance_jni::utils::get_vector_index_params has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PrimitiveStructuralEncoder · ×9
  • PrimitiveStructuralEncoder::encode_dense_page (cognitive 40) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2206 — PrimitiveStructuralEncoder::encode_dense_page has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (28 pts), match/switch 4 (8 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.
  • PrimitiveStructuralEncoder::sample_unique_ratio (cognitive 38) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1892 — PrimitiveStructuralEncoder::sample_unique_ratio has cognitive complexity 38 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 6 (13 pts), match/switch 3 (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.
  • PrimitiveStructuralEncoder::is_constant_values (cognitive 37) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:922 — PrimitiveStructuralEncoder::is_constant_values has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 4 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • PrimitiveStructuralEncoder::serialize_miniblocks (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:477 — PrimitiveStructuralEncoder::serialize_miniblocks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (9 pts), match/switch 2, 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.
  • PrimitiveStructuralEncoder::compress_levels (cognitive 31) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:642 — PrimitiveStructuralEncoder::compress_levels has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PrimitiveStructuralEncoder::should_dictionary_encode (cognitive 27) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1757 — PrimitiveStructuralEncoder::should_dictionary_encode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PrimitiveStructuralEncoder::serialize_full_zip_variable (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1347 — PrimitiveStructuralEncoder::serialize_full_zip_variable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PrimitiveStructuralEncoder::serialize_full_zip_fixed (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1270 — PrimitiveStructuralEncoder::serialize_full_zip_fixed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PrimitiveStructuralEncoder::try_dictionary_encode (cognitive 17) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1685 — PrimitiveStructuralEncoder::try_dictionary_encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×9
  • Edited copy of a member (5 corresponding lines) rust/lance-core/src/cache/telemetry.rs:683 — rust/lance-core/src/cache/telemetry.rs:683-689 | rust/lance-core/src/cache/telemetry.rs:694-698 — 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/lance-index/src/scalar/minhash_lsh/mod.rs:505 — rust/lance-index/src/scalar/minhash_lsh/mod.rs:505-511 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:221-225 — 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/lance-index/src/vector/pq/storage.rs:226 — rust/lance-index/src/vector/pq/storage.rs:226-239 | rust/lance-index/src/vector/storage.rs:724-728 — 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/lance-index/src/vector/bq/storage.rs:3044 — rust/lance-index/src/vector/bq/storage.rs:3044-3048 | rust/lance-index/src/vector/sq/storage.rs:328-339 — 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/lance/src/index/scalar/zonemap.rs:185 — rust/lance/src/index/scalar/zonemap.rs:185-189 | rust/lance/src/index/vector/ivf/v2.rs:854-858 — 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) java/lance-jni/src/blocking_dataset/mod.rs:34 — java/lance-jni/src/blocking_dataset/mod.rs:34-38 | java/lance-jni/src/blocking_dataset/read.rs:696-700 — 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/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:688 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:688-692 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:461-465 — 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/lance-core/src/cache/mod.rs:1040 — rust/lance-core/src/cache/mod.rs:1040-1044 | rust/lance-core/src/cache/moka.rs:208-212 — 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/lance-tools/src/manifest.rs:1453 — rust/lance-tools/src/manifest.rs:1453-1457 | rust/lance-tools/src/meta.rs:54-58 — 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 (9–10 lines × 2) · ×9
  • Duplicated block (9–10 lines × 2) java/lance-jni/src/file_writer.rs:202 — java/lance-jni/src/file_writer.rs:202-210 | java/lance-jni/src/fragment.rs:173-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9–10 lines × 2) rust/lance-encoding/src/encodings/logical/list.rs:55 — rust/lance-encoding/src/encodings/logical/list.rs:55-64 | rust/lance-encoding/src/encodings/logical/list.rs:67-75 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/list.rs:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9–10 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:690 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:690-699 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:709-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:690` it does not close everything it opens, so those exact lines 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/lance-encoding/src/statistics.rs:249 — rust/lance-encoding/src/statistics.rs:249-257 | rust/lance-encoding/src/statistics.rs:262-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/statistics.rs:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/vector/bq/ex_dot.rs:1085 — rust/lance-index/src/vector/bq/ex_dot.rs:1085-1093 | rust/lance-index/src/vector/bq/ex_dot.rs:1116-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/bq/ex_dot.rs:1085` it does not close everything it opens, so those exact 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 `hi` to `*const u8` in one and `&[u8]` 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/lance-jsonb/src/core/util.rs:40 — rust/lance-jsonb/src/core/util.rs:40-48 | rust/lance-jsonb/src/core/util.rs:548-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/core/util.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 (9–10 lines × 2) rust/lance-namespace-impls/src/credentials/gcp.rs:602 — rust/lance-namespace-impls/src/credentials/gcp.rs:602-611 | rust/lance-namespace-impls/src/credentials/gcp.rs:729-737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/credentials/gcp.rs:602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) rust/lance/src/dataset.rs:1315 — rust/lance/src/dataset.rs:1315-1323 | rust/lance/src/dataset/builder.rs:146-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/lance/src/dataset.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance/src/dataset/builder.rs:145` calls `Some` and `rust/lance/src/dataset.rs:1314` 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–10 lines × 2) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1539 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1539-1547 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:210-219 — 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/lance/src/dataset/mem_wal/scanner/fts_search.rs:1539` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 · lance_datafusion · ×8
  • lance_datafusion::substrait::normalize_expr (cognitive 54) rust/lance-datafusion/src/substrait.rs:395 — lance_datafusion::substrait::normalize_expr has cognitive complexity 54 (threshold 15). Drivers by points: loops 11 (26 pts), if/else 6 (14 pts), match/switch 6 (14 pts) (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • lance_datafusion::numeric_coercion::unwrap_node (cognitive 33) rust/lance-datafusion/src/numeric_coercion.rs:571 — lance_datafusion::numeric_coercion::unwrap_node has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (7 pts), match/switch 3 (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.
  • lance_datafusion::signed_zero::rewrite_node (cognitive 32) rust/lance-datafusion/src/signed_zero.rs:642 — lance_datafusion::signed_zero::rewrite_node has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 4 (7 pts), boolean chains 5, loops 1 (2 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.
  • lance_datafusion::logical_expr::resolve_expr (cognitive 23) rust/lance-datafusion/src/logical_expr.rs:99 — lance_datafusion::logical_expr::resolve_expr has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_datafusion::numeric_coercion::rewrite (cognitive 21) rust/lance-datafusion/src/numeric_coercion.rs:287 — lance_datafusion::numeric_coercion::rewrite has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_datafusion::numeric_coercion::lower_decimal (cognitive 20) rust/lance-datafusion/src/numeric_coercion.rs:193 — lance_datafusion::numeric_coercion::lower_decimal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, match/switch 3 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_datafusion::numeric_coercion::lower (cognitive 16) rust/lance-datafusion/src/numeric_coercion.rs:91 — lance_datafusion::numeric_coercion::lower has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_datafusion::substrait::parse_groupings (cognitive 16) rust/lance-datafusion/src/substrait.rs:933 — lance_datafusion::substrait::parse_groupings has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (6 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×8
  • Edited copy of a member (36 corresponding lines) rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:249 — rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:249-284 | rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:311-353 — 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/lance-linalg/src/simd/f32.rs:332 — rust/lance-linalg/src/simd/f32.rs:332-368 | rust/lance-linalg/src/simd/f32.rs:828-863 — 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/lance-namespace-impls/src/dir/manifest.rs:1355 — rust/lance-namespace-impls/src/dir/manifest.rs:1355-1390 | rust/lance-namespace-impls/src/dir/manifest.rs:1456-1498 — 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/lance/src/dataset/write/merge_insert/exec/write.rs:803 — rust/lance/src/dataset/write/merge_insert/exec/write.rs:803-848 | rust/lance/src/dataset/write/update.rs:665-700 — 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/lance-encoding/src/encodings/physical/alp.rs:312 — rust/lance-encoding/src/encodings/physical/alp.rs:312-350 | rust/lance-encoding/src/encodings/physical/alp.rs:354-389 — 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/lance/src/dataset/mem_wal/index/fts.rs:2383 — rust/lance/src/dataset/mem_wal/index/fts.rs:2383-2418 | rust/lance/src/dataset/mem_wal/index/fts.rs:2477-2521 — 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/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:115 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:115-150 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:150-189 — 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/lance-encoding/src/encodings/logical/primitive/all_null.rs:651 — rust/lance-encoding/src/encodings/logical/primitive/all_null.rs:651-686 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:439-480 — 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 (30 corresponding lines) · ×8
  • Edited copy of a member (30 corresponding lines) rust/lance-file/src/versions/v1/encoding/plain.rs:306 — rust/lance-file/src/versions/v1/encoding/plain.rs:306-343 | rust/lance-file/src/versions/v1/encoding/plain.rs:379-408 — 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/lance-file/src/versions/v2_1/compression.rs:55 — rust/lance-file/src/versions/v2_1/compression.rs:55-84 | rust/lance-file/src/versions/v2_2/compression.rs:47-76 — 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/lance-index/src/vector/distributed/index_merger.rs:472 — rust/lance-index/src/vector/distributed/index_merger.rs:472-508 | rust/lance-index/src/vector/distributed/index_merger.rs:514-543 — 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/lance/src/dataset/mem_wal/memtable.rs:451 — rust/lance/src/dataset/mem_wal/memtable.rs:451-489 | rust/lance/src/dataset/mem_wal/memtable.rs:501-530 — 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/lance-namespace-impls/src/dir/index_params.rs:255 — rust/lance-namespace-impls/src/dir/index_params.rs:255-284 | rust/lance-namespace-impls/src/dir/manifest.rs:3120-3150 — 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/lance-namespace-impls/src/credentials/azure.rs:786 — rust/lance-namespace-impls/src/credentials/azure.rs:786-825 | rust/lance-namespace-impls/src/credentials/gcp.rs:850-879 — 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/lance-index/src/vector/hnsw/builder.rs:422 — rust/lance-index/src/vector/hnsw/builder.rs:422-456 | rust/lance-index/src/vector/hnsw/builder.rs:605-634 — 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/lance/src/index/vector/ivf.rs:2409 — rust/lance/src/index/vector/ivf.rs:2409-2440 | rust/lance/src/index/vector/ivf.rs:2452-2481 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×8
  • Edited copy of a member (25 corresponding lines) rust/lance-encoding/src/encodings/physical/alp.rs:215 — rust/lance-encoding/src/encodings/physical/alp.rs:215-239 | rust/lance-encoding/src/encodings/physical/alp.rs:242-266 — 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/lance-io/src/object_store/providers/aws.rs:190 — rust/lance-io/src/object_store/providers/aws.rs:190-231 | rust/lance-io/src/object_store/providers/gcp.rs:216-240 — 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/lance-datagen/src/generator.rs:2744 — rust/lance-datagen/src/generator.rs:2744-2768 | rust/lance-datagen/src/generator.rs:2772-2798 — 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/lance-encoding/src/encodings/physical/byte_stream_split.rs:339 — rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:339-363 | rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:374-398 — 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/lance-index/src/vector/hnsw/index.rs:274 — rust/lance-index/src/vector/hnsw/index.rs:274-298 | rust/lance/src/index/vector/ivf/v2.rs:3337-3362 — 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/lance-linalg/src/simd/f64.rs:194 — rust/lance-linalg/src/simd/f64.rs:194-218 | rust/lance-linalg/src/simd/f64.rs:220-247 — 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/lance-index/src/scalar/inverted/index/posting_builder.rs:697 — rust/lance-index/src/scalar/inverted/index/posting_builder.rs:697-726 | rust/lance-index/src/scalar/inverted/index/posting_builder.rs:728-752 — 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) java/lance-jni/src/blocking_dataset/maintenance.rs:568 — java/lance-jni/src/blocking_dataset/maintenance.rs:568-597 | java/lance-jni/src/blocking_dataset/maintenance.rs:602-626 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×8
  • Edited copy of a member (22 corresponding lines) python/src/dataset.rs:3554 — python/src/dataset.rs:3554-3575 | python/src/dataset.rs:3582-3603 — 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/lance/src/dataset/mem_wal/index/fts.rs:3575 — rust/lance/src/dataset/mem_wal/index/fts.rs:3575-3596 | rust/lance/src/dataset/mem_wal/index/fts.rs:4909-4930 — 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) python/src/mem_wal.rs:341 — python/src/mem_wal.rs:341-362 | python/src/mem_wal.rs:368-397 — 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/lance-index/src/scalar/inverted/compound.rs:2570 — rust/lance-index/src/scalar/inverted/compound.rs:2570-2598 | rust/lance-index/src/scalar/inverted/compound.rs:2850-2871 — 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/lance/src/dataset/builder.rs:322 — rust/lance/src/dataset/builder.rs:322-345 | rust/lance/src/dataset/builder.rs:354-375 — 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) java/src/main/java/org/lance/compaction/Compaction.java:32 — java/src/main/java/org/lance/compaction/Compaction.java:32-57 | java/src/main/java/org/lance/compaction/Compaction.java:60-81 — 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/lance-encoding/src/encodings/physical/alp.rs:428 — rust/lance-encoding/src/encodings/physical/alp.rs:428-449 | rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:789-813 — 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) python/python/lance/indices/ivf.py:30 — python/python/lance/indices/ivf.py:30-51 | python/python/lance/indices/pq.py:33-57 — 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, 11+ corresponding lines) · ×8
  • Edited copies of one member (3 members, 11+ corresponding lines) python/src/scanner.rs:217 — python/src/scanner.rs:217-228 | python/src/transaction.rs:1364-1375 | python/src/transaction.rs:1408-1418 — 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/lance-namespace-impls/src/rest_adapter.rs:917 — rust/lance-namespace-impls/src/rest_adapter.rs:917-927 | rust/lance-namespace-impls/src/rest_adapter.rs:1539-1549 | rust/lance-namespace-impls/src/rest_adapter.rs:1557-1567 — 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/lance-index/src/vector/bq/builder.rs:714 — rust/lance-index/src/vector/bq/builder.rs:714-724 | rust/lance-index/src/vector/bq/builder.rs:892-902 | rust/lance-index/src/vector/bq/builder.rs:1095-1106 — 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/lance-linalg/src/kernels.rs:28 — rust/lance-linalg/src/kernels.rs:28-38 | rust/lance-linalg/src/kernels.rs:49-61 | rust/lance-linalg/src/kernels.rs:142-154 — 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) java/src/main/java/org/lance/Version.java:60 — java/src/main/java/org/lance/Version.java:60-71 | java/src/main/java/org/lance/operation/CreateIndex.java:46-56 | java/src/main/java/org/lance/operation/Delete.java:66-77 — 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/lance/src/index/lifecycle.rs:462 — rust/lance/src/index/lifecycle.rs:462-472 | rust/lance/src/index/lifecycle.rs:502-520 | rust/lance/src/index/lifecycle.rs:538-555 — 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/lance/src/dataset/mem_wal/scanner/exec/bloom_guard.rs:160 — rust/lance/src/dataset/mem_wal/scanner/exec/bloom_guard.rs:160-172 | rust/lance/src/dataset/mem_wal/scanner/exec/pk_block_filter.rs:135-147 | rust/lance/src/dataset/mem_wal/scanner/exec/schema_relabel.rs:99-109 — 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/lance/src/index/scalar/bitmap.rs:16 — rust/lance/src/index/scalar/bitmap.rs:16-26 | rust/lance/src/index/scalar/btree.rs:45-55 | rust/lance/src/index/scalar/label_list.rs:18-28 — 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 (24 lines × 2) · ×8
  • Duplicated block (24 lines × 2) java/lance-jni/src/lib.rs:109 — java/lance-jni/src/lib.rs:109-132 | python/src/lib.rs:209-232 — 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 (24 lines × 2) java/lance-jni/src/transaction.rs:1369 — java/lance-jni/src/transaction.rs:1369-1392 | java/lance-jni/src/transaction.rs:2360-2383 — both copies are in the same file, so extract the 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, `java/lance-jni/src/transaction.rs:2357` calls `extract` and `java/lance-jni/src/transaction.rs:1368` 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 (24 lines × 2) rust/lance-core/src/cache/moka.rs:264 — rust/lance-core/src/cache/moka.rs:264-287 | rust/lance-core/src/cache/quick.rs:484-507 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-core/src/cache/moka.rs:264` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:1369 — rust/lance-encoding/src/encodings/physical/alp.rs:1369-1392 | rust/lance-encoding/src/encodings/physical/alp.rs:1493-1516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:1369` it begins part-way through the construct above it, so those exact lines 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/lance-index/src/vector/graph.rs:404 — rust/lance-index/src/vector/graph.rs:404-427 | rust/lance-index/src/vector/graph.rs:505-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/graph.rs:404` it does not close everything it opens, so those exact lines 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/lance-linalg/src/simd/f32.rs:407 — rust/lance-linalg/src/simd/f32.rs:407-430 | rust/lance-linalg/src/simd/i32.rs:247-270 — 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/lance-linalg/src/simd/f32.rs:407` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact 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 `val` to `f32` in one and `i32` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (24 lines × 2) rust/lance/src/dataset/mem_wal/memtable/flush.rs:313 — rust/lance/src/dataset/mem_wal/memtable/flush.rs:313-336 | rust/lance/src/dataset/mem_wal/memtable/flush.rs:594-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/memtable/flush.rs:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) rust/lance/src/dataset/mem_wal/scanner/planner.rs:406 — rust/lance/src/dataset/mem_wal/scanner/planner.rs:406-429 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:658-681 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/planner.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 82 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/lance/src/dataset/mem_wal/scanner/planner.rs:406` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×8
  • Duplicated block (19 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:746 — rust/lance-encoding/src/encodings/physical/alp.rs:746-764 | rust/lance-encoding/src/encodings/physical/alp.rs:867-885 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:746` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:978 — rust/lance-encoding/src/encodings/physical/alp.rs:978-996 | rust/lance-encoding/src/encodings/physical/alp.rs:1107-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:978` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/fsst.rs:76 — rust/lance-encoding/src/encodings/physical/fsst.rs:76-94 | rust/lance-encoding/src/encodings/physical/fsst.rs:97-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/fsst.rs:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-file/src/versions/v2_2/compression.rs:116 — rust/lance-file/src/versions/v2_2/compression.rs:116-134 | rust/lance-file/src/versions/v2_3/compression.rs:143-161 — `rust/lance-file/src/versions/v2_2/compression.rs` and `rust/lance-file/src/versions/v2_3/compression.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 42 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_2/compression.rs:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-index/src/scalar/inverted/index/inverted_index.rs:367 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:367-385 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:437-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/inverted_index.rs:367` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-jsonb/src/parser.rs:802 — rust/lance-jsonb/src/parser.rs:802-820 | rust/lance-jsonb/src/parser.rs:867-885 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/parser.rs:802` it does not close everything it opens, so those exact lines 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/lance/src/index/vector.rs:2223 — rust/lance/src/index/vector.rs:2223-2241 | rust/lance/src/index/vector.rs:2262-2280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector.rs:2223` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-encoding/src/array_encoding/logical/struct.rs:587 — rust/lance-encoding/src/array_encoding/logical/struct.rs:587-605 | rust/lance-encoding/src/encodings/logical/struct.rs:342-360 — before extracting anything, compare `rust/lance-encoding/src/array_encoding/logical/struct.rs` and `rust/lance-encoding/src/encodings/logical/struct.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-encoding/src/array_encoding/logical/struct.rs:587` it does not close everything it opens, so those 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 × 2) · ×8
  • Duplicated block (14–15 lines × 2) rust/lance-index/src/scalar/inverted/index/flat_search.rs:272 — rust/lance-index/src/scalar/inverted/index/flat_search.rs:272-286 | rust/lance-index/src/scalar/inverted/index/flat_search.rs:578-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/flat_search.rs:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) rust/lance-namespace-impls/src/credentials/azure.rs:800 — rust/lance-namespace-impls/src/credentials/azure.rs:800-814 | rust/lance-namespace-impls/src/credentials/azure.rs:866-879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/credentials/azure.rs:800` it begins part-way through the construct above it, so those exact lines 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/lance/src/index/frag_reuse.rs:1250 — rust/lance/src/index/frag_reuse.rs:1250-1263 | rust/lance/src/index/frag_reuse.rs:2688-2702 — both copies are in the same file, so extract the 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) rust/lance/src/index/vector.rs:2206 — rust/lance/src/index/vector.rs:2206-2220 | rust/lance/src/index/vector.rs:2244-2257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector.rs:2244` it does not close everything it opens, so those exact 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/lance/src/index/vector/ivf/io.rs:480 — rust/lance/src/index/vector/ivf/io.rs:480-493 | rust/lance/src/index/vector/ivf/io.rs:504-518 — both copies are in the same file, so extract the 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/lance/src/io/exec/fts/boolean.rs:196 — rust/lance/src/io/exec/fts/boolean.rs:196-210 | rust/lance/src/io/exec/fts/boolean.rs:546-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/io/exec/fts/boolean.rs:196` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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/lance/src/io/exec/fts/boolean.rs:542` calls `record_parts_searched`, `timer` and `rust/lance/src/io/exec/fts/boolean.rs:194` 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/lance/src/io/exec/fts/match_query.rs:517 — rust/lance/src/io/exec/fts/match_query.rs:517-531 | rust/lance/src/io/exec/fts/phrase.rs:445-458 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 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/lance/src/io/exec/fts/match_query.rs:517` it does not close everything it opens, so those exact lines 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) java/src/main/java/org/lance/WriteDatasetBuilder.java:493 — java/src/main/java/org/lance/WriteDatasetBuilder.java:493-507 | java/src/main/java/org/lance/WriteDatasetBuilder.java:532-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/src/main/java/org/lance/WriteDatasetBuilder.java:493` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×8
  • Duplicated block (11–12 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:542 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:542-553 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:563-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/lance-encoding/src/encodings/physical/alp/restore.rs:542` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/general.rs:372 — rust/lance-encoding/src/encodings/physical/general.rs:372-383 | rust/lance-encoding/src/encodings/physical/general.rs:394-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:923 — rust/lance-file/src/versions/v2_0/writer.rs:923-934 | rust/lance-file/src/writer/structural.rs:904-914 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11–12 lines × 2) rust/lance-index/src/vector/bq/storage/scan.rs:455 — rust/lance-index/src/vector/bq/storage/scan.rs:455-465 | rust/lance-index/src/vector/bq/storage/scan.rs:517-528 — both copies are in the same file, so extract the 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/lance-index/src/vector/bq/storage/scan.rs:529` calls `peek` and `rust/lance-index/src/vector/bq/storage/scan.rs:466` 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/lance-index/src/vector/flat/index.rs:142 — rust/lance-index/src/vector/flat/index.rs:142-152 | rust/lance-index/src/vector/flat/index.rs:299-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/flat/index.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.
  • Duplicated block (11–12 lines × 2) rust/lance-table/src/io/commit/external_manifest.rs:174 — rust/lance-table/src/io/commit/external_manifest.rs:174-185 | rust/lance-table/src/io/commit/external_manifest.rs:203-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/io/commit/external_manifest.rs:174` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact 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/lance/src/dataset/optimize/planning.rs:1342 — rust/lance/src/dataset/optimize/planning.rs:1342-1353 | rust/lance/src/dataset/optimize/planning.rs:1648-1658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/optimize/planning.rs:1342` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/write/merge_insert/exec/in_place.rs:562 — rust/lance/src/dataset/write/merge_insert/exec/in_place.rs:562-572 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1455-1466 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×8
  • Duplicated block (6 lines × 3) rust/lance-io/src/lib.rs:235 — rust/lance-io/src/lib.rs:235-240 | rust/lance-io/src/lib.rs:290-295 | rust/lance-table/src/rowids.rs:1315-1320 — 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/lance-io/src/lib.rs:235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rust/lance/src/io/exec/fts/flat_combined_fields.rs:521 — rust/lance/src/io/exec/fts/flat_combined_fields.rs:521-527 | rust/lance/src/io/exec/fts/flat_match.rs:1180-1186 | rust/lance/src/io/exec/rowids.rs:226-231 — 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/lance/src/io/exec/fts/flat_combined_fields.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 (6 lines × 3) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:318 — rust/lance-encoding/src/encodings/logical/primitive/dict.rs:318-323 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2057-2062 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2073-2078 — 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/lance-encoding/src/encodings/logical/primitive/dict.rs:318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 3) rust/lance-file/src/reader/structural.rs:208 — rust/lance-file/src/reader/structural.rs:208-213 | rust/lance-file/src/versions/v1/mod.rs:86-91 | rust/lance-file/src/versions/v2_0/mod.rs:52-57 — `rust/lance-file/src/versions/v1/mod.rs` and `rust/lance-file/src/versions/v2_0/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 3) rust/lance-file/src/versions/v2_1/writer.rs:88 — rust/lance-file/src/versions/v2_1/writer.rs:88-93 | rust/lance-file/src/versions/v2_2/writer.rs:88-93 | rust/lance-file/src/versions/v2_3/writer.rs:88-93 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 3) rust/lance-index/src/scalar/inverted/compound.rs:2610 — rust/lance-index/src/scalar/inverted/compound.rs:2610-2615 | rust/lance-index/src/scalar/inverted/compound.rs:2883-2888 | rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:586-591 — before extracting anything, compare `rust/lance-index/src/scalar/inverted/compound.rs` and `rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:2438 — rust/lance-namespace-impls/src/dir/manifest.rs:2438-2444 | rust/lance-namespace-impls/src/dir/manifest.rs:2471-2477 | rust/lance-namespace-impls/src/dir/manifest.rs:2851-2856 — all 3 copies are in the same file, so extract the block into one function there and call 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 (6 lines × 3) rust/lance-file/src/versions/v1/writer/mod.rs:419 — rust/lance-file/src/versions/v1/writer/mod.rs:419-424 | rust/lance-file/src/versions/v1/writer/mod.rs:436-441 | rust/lance-file/src/versions/v1/writer/mod.rs:455-460 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-file/src/versions/v1/writer/mod.rs:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-file/src/versions/v1/writer/mod.rs:415` calls `is_empty`, `data_type` and `rust/lance-file/src/versions/v1/writer/mod.rs:451` 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.
D1 · Cyclomatic Complexity · Wand · ×7
  • Wand::and_bulk_search (cyclomatic 139) rust/lance-index/src/scalar/inverted/wand/bulk_conjunction.rs:34 — Wand::and_bulk_search has cyclomatic complexity 139 (threshold 15). Of this number, 74 points are the body's own statements and 65 belong to 14 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.
  • Wand::maxscore_search (cyclomatic 128) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:180 — Wand::maxscore_search has cyclomatic complexity 128 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Wand::complete_maxscore_single_essential (cyclomatic 45) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1278 — Wand::complete_maxscore_single_essential 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.
  • Wand::search (cyclomatic 30) rust/lance-index/src/scalar/inverted/wand.rs:554 — Wand::search 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.
  • Wand::next_and_candidate (cyclomatic 28) rust/lance-index/src/scalar/inverted/wand/conjunction.rs:173 — Wand::next_and_candidate 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.
  • Wand::prepare_score_first_and_window (cyclomatic 22) rust/lance-index/src/scalar/inverted/wand/conjunction.rs:60 — Wand::prepare_score_first_and_window 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.
  • Wand::next (cyclomatic 20) rust/lance-index/src/scalar/inverted/wand/disjunction.rs:27 — Wand::next 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.
D2 · Cognitive Complexity · CleanupTask · ×7
  • CleanupTask::cleanup_file_if_not_referenced (cognitive 78) rust/lance/src/dataset/cleanup.rs:2278 — CleanupTask::cleanup_file_if_not_referenced has cognitive complexity 78 (threshold 15). Drivers by points: if/else 45 (71 pts), boolean chains 6, match/switch 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CleanupTask::delete_unreferenced_files (cognitive 53) rust/lance/src/dataset/cleanup.rs:1662 — CleanupTask::delete_unreferenced_files has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 5 (11 pts), boolean chains 7, match/switch 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.
  • CleanupTask::run (cognitive 32) rust/lance/src/dataset/cleanup.rs:936 — CleanupTask::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 2 (5 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CleanupTask::process_manifest_file (cognitive 31) rust/lance/src/dataset/cleanup.rs:1349 — CleanupTask::process_manifest_file has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CleanupTask::process_branch_referenced_manifests (cognitive 26) rust/lance/src/dataset/cleanup.rs:2883 — CleanupTask::process_branch_referenced_manifests has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (6 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CleanupTask::delete_bulk_batch (cognitive 25) rust/lance/src/dataset/cleanup.rs:2177 — CleanupTask::delete_bulk_batch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CleanupTask::process_manifest (cognitive 16) rust/lance/src/dataset/cleanup.rs:1513 — CleanupTask::process_manifest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 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.
D2 · Cognitive Complexity · DirectoryNamespace · ×7
  • DirectoryNamespace::describe_table_impl (cognitive 64) rust/lance-namespace-impls/src/dir/load.rs:18 — DirectoryNamespace::describe_table_impl has cognitive complexity 64 (threshold 15). Drivers by points: if/else 36 (55 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DirectoryNamespace::alter_transaction (cognitive 49) rust/lance-namespace-impls/src/dir/namespace.rs:1320 — DirectoryNamespace::alter_transaction has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (33 pts), match/switch 3 (9 pts), boolean chains 6, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DirectoryNamespace::query_table (cognitive 38) rust/lance-namespace-impls/src/dir/namespace.rs:2207 — DirectoryNamespace::query_table has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DirectoryNamespace::list_tables (cognitive 23) rust/lance-namespace-impls/src/dir/namespace.rs:160 — DirectoryNamespace::list_tables has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DirectoryNamespace::apply_query_params_to_scanner (cognitive 23) rust/lance-namespace-impls/src/dir/query.rs:118 — DirectoryNamespace::apply_query_params_to_scanner has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (22 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.
  • DirectoryNamespace::build_index_params (cognitive 21) rust/lance-namespace-impls/src/dir/index_params.rs:91 — DirectoryNamespace::build_index_params has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DirectoryNamespace::list_versions_under (cognitive 21) rust/lance-namespace-impls/src/dir/versions.rs:288 — DirectoryNamespace::list_versions_under has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lance_file · ×7
  • lance_file::concat::validate_blob_field (cognitive 39) rust/lance-file/src/concat.rs:319 — lance_file::concat::validate_blob_field has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 4 (8 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_file::versions::v1::writer::statistics::get_binary_statistics (cognitive 30) rust/lance-file/src/versions/v1/writer/statistics.rs:316 — lance_file::versions::v1::writer::statistics::get_binary_statistics has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_file::versions::v1::writer::statistics::get_fixed_size_binary_statistics (cognitive 29) rust/lance-file/src/versions/v1/writer/statistics.rs:389 — lance_file::versions::v1::writer::statistics::get_fixed_size_binary_statistics has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_file::versions::v1::writer::statistics::get_string_statistics (cognitive 28) rust/lance-file/src/versions/v1/writer/statistics.rs:241 — lance_file::versions::v1::writer::statistics::get_string_statistics has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_file::reader::describe_encoding (cognitive 26) rust/lance-file/src/reader.rs:2588 — lance_file::reader::describe_encoding has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 8 (12 pts) (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.
  • lance_file::concat::copy_page_buffers (cognitive 24) rust/lance-file/src/concat.rs:849 — lance_file::concat::copy_page_buffers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_file::concat::check_compatibility (cognitive 22) rust/lance-file/src/concat.rs:638 — lance_file::concat::check_compatibility has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×7
  • Edited copy of a member (28 corresponding lines) rust/lance-core/src/datatypes/schema.rs:238 — rust/lance-core/src/datatypes/schema.rs:238-265 | rust/lance-core/src/datatypes/schema.rs:724-764 — 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/lance-index/src/vector/bq/dist_table_quant.rs:62 — rust/lance-index/src/vector/bq/dist_table_quant.rs:62-94 | rust/lance-index/src/vector/bq/dist_table_quant.rs:101-128 — 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) java/lance-jni/src/vector_trainer.rs:113 — java/lance-jni/src/vector_trainer.rs:113-145 | java/lance-jni/src/vector_trainer.rs:176-203 — 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/lance-index/src/scalar/inverted/index/partition.rs:896 — rust/lance-index/src/scalar/inverted/index/partition.rs:896-923 | rust/lance-index/src/scalar/inverted/index/partition.rs:933-961 — 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/lance-file/src/reader.rs:2316 — rust/lance-file/src/reader.rs:2316-2343 | rust/lance-file/src/reader.rs:2530-2558 — 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/lance/src/dataset/scanner/fts.rs:333 — rust/lance/src/dataset/scanner/fts.rs:333-366 | rust/lance/src/dataset/scanner/fts.rs:375-402 — 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) java/lance-jni/src/blocking_dataset/construction.rs:291 — java/lance-jni/src/blocking_dataset/construction.rs:291-318 | java/lance-jni/src/blocking_dataset/construction.rs:426-454 — 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 (31 corresponding lines) · ×7
  • Edited copy of a member (31 corresponding lines) rust/lance-namespace-impls/src/rest.rs:1187 — rust/lance-namespace-impls/src/rest.rs:1187-1226 | rust/lance-namespace-impls/src/rest.rs:1528-1558 — 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/lance-core/src/cache/moka.rs:257 — rust/lance-core/src/cache/moka.rs:257-287 | rust/lance-core/src/cache/quick.rs:469-507 — 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/lance-file/src/versions/v1/writer/statistics.rs:52 — rust/lance-file/src/versions/v1/writer/statistics.rs:52-82 | rust/lance-file/src/versions/v1/writer/statistics.rs:106-136 — 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/lance-linalg/src/distance/hamming.rs:785 — rust/lance-linalg/src/distance/hamming.rs:785-815 | rust/lance-linalg/src/distance/hamming.rs:864-897 — 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/lance/src/dataset/mem_wal/scanner/fts_search.rs:155 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:155-185 | rust/lance/src/dataset/scanner/fts.rs:1030-1066 — 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/lance-file/src/reader.rs:1488 — rust/lance-file/src/reader.rs:1488-1518 | rust/lance-file/src/reader.rs:1532-1564 — 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/lance/src/index/scalar.rs:873 — rust/lance/src/index/scalar.rs:873-903 | rust/lance/src/index/scalar/label_list.rs:34-67 — 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, 9+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 9+ corresponding lines) rust/lance-file/src/versions/v1/writer/mod.rs:413 — rust/lance-file/src/versions/v1/writer/mod.rs:413-424 | rust/lance-file/src/versions/v1/writer/mod.rs:433-441 | rust/lance-file/src/versions/v1/writer/mod.rs:450-460 — 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/lance-file/src/versions/v2_1/writer.rs:78 — rust/lance-file/src/versions/v2_1/writer.rs:78-86 | rust/lance-file/src/versions/v2_2/writer.rs:78-86 | rust/lance-file/src/versions/v2_3/writer.rs:78-86 — 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) python/src/mem_wal.rs:665 — python/src/mem_wal.rs:665-675 | python/src/mem_wal.rs:709-721 | python/src/mem_wal.rs:724-732 — 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) python/src/dataset/delta.rs:34 — python/src/dataset/delta.rs:34-42 | python/src/dataset/delta.rs:45-53 | python/src/dataset/delta.rs:57-65 — 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) python/src/dataset.rs:1478 — python/src/dataset.rs:1478-1486 | python/src/dataset.rs:1492-1505 | python/src/dataset.rs:1511-1522 — 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) java/src/main/java/org/lance/ipc/LanceScanner.java:157 — java/src/main/java/org/lance/ipc/LanceScanner.java:157-167 | java/src/main/java/org/lance/memwal/ExecutionPlan.java:81-89 | java/src/main/java/org/lance/memwal/LsmScanner.java:155-163 — 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) python/src/dataset/optimize.rs:487 — python/src/dataset/optimize.rs:487-495 | python/src/fragment.rs:1116-1124 | python/src/schema.rs:33-41 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×7
  • Duplicated block (20 lines × 2) rust/lance-encoding/src/decoder.rs:1756 — rust/lance-encoding/src/decoder.rs:1756-1775 | rust/lance-encoding/src/decoder.rs:2253-2272 — both copies are in the same file, so extract the 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 (20 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1375 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1375-1394 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1397-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1375` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-file/src/versions/v2_0/writer.rs:254 — rust/lance-file/src/versions/v2_0/writer.rs:254-273 | rust/lance-file/src/writer/structural.rs:222-241 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/versions/v2_0/writer.rs:254` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) rust/lance-index/src/scalar/inverted/wand/posting.rs:1116 — rust/lance-index/src/scalar/inverted/wand/posting.rs:1116-1135 | rust/lance-index/src/scalar/inverted/wand/posting.rs:1174-1193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/wand/posting.rs:1116` it begins part-way through the construct above it, so those exact 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 `self` to `super) fn next(&mut` in one and `super) fn next_doc_id(&mut` 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/lance-index/src/vector/flat/storage.rs:87 — rust/lance-index/src/vector/flat/storage.rs:87-106 | rust/lance-index/src/vector/flat/storage.rs:267-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/lance-index/src/vector/flat/storage.rs:107` calls `cosine_norms_cache` and `rust/lance-index/src/vector/flat/storage.rs:287` 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 (20 lines × 2) rust/lance/src/index/vector.rs:1466 — rust/lance/src/index/vector.rs:1466-1485 | rust/lance/src/index/vector.rs:1523-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/lance/src/index/vector.rs:1466` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/index/vector/ivf.rs:3446 — rust/lance/src/index/vector/ivf.rs:3446-3465 | rust/lance/src/index/vector/ivf.rs:3502-3521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector/ivf.rs:3446` it does not close everything it opens, so those 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) · ×7
  • Duplicated block (13–14 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:203 — rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:203-215 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:290-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:465 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:465-478 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:489-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:465` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/alp/restore.rs:1031 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:1031-1044 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:1054-1066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:1031` it does not close everything it opens, so those exact lines 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/lance-index/src/vector/ivf/shuffler.rs:303 — rust/lance-index/src/vector/ivf/shuffler.rs:303-316 | rust/lance/src/index/vector/builder.rs:2188-2200 — 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/lance-index/src/vector/ivf/shuffler.rs:303` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/hash_joiner.rs:193 — rust/lance/src/dataset/hash_joiner.rs:193-206 | rust/lance/src/dataset/hash_joiner.rs:280-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/hash_joiner.rs:193` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/index/frag_reuse.rs:162 — rust/lance/src/dataset/index/frag_reuse.rs:162-175 | rust/lance/src/dataset/index/frag_reuse.rs:801-813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/index/frag_reuse.rs:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) rust/lance/src/dataset/write.rs:2419 — rust/lance/src/dataset/write.rs:2419-2431 | rust/lance/src/dataset/write.rs:2480-2493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/write.rs:2480` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×7
  • Duplicated block (12 lines × 3) rust/lance-datafusion-exec/src/udf/json.rs:673 — rust/lance-datafusion-exec/src/udf/json.rs:673-684 | rust/lance-datafusion-exec/src/udf/json.rs:729-740 | rust/lance-datafusion-exec/src/udf/json.rs:785-796 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-datafusion-exec/src/udf/json.rs:673` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance-file/src/versions/v2_1/mod.rs:79 — rust/lance-file/src/versions/v2_1/mod.rs:79-90 | rust/lance-file/src/versions/v2_2/mod.rs:82-93 | rust/lance-file/src/versions/v2_3/mod.rs:94-105 — `rust/lance-file/src/versions/v2_2/mod.rs` and `rust/lance-file/src/versions/v2_3/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/mod.rs:79` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 3) rust/lance-index/src/scalar/lance_format.rs:348 — rust/lance-index/src/scalar/lance_format.rs:348-359 | rust/lance-index/src/scalar/lance_format.rs:389-400 | rust/lance-index/src/scalar/lance_format.rs:472-483 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 3) rust/lance-index/src/vector/distributed/index_merger.rs:267 — rust/lance-index/src/vector/distributed/index_merger.rs:267-278 | rust/lance-index/src/vector/distributed/index_merger.rs:306-317 | rust/lance-index/src/vector/distributed/index_merger.rs:347-358 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-index/src/vector/distributed/index_merger.rs:267` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) rust/lance/src/index/scalar/bloomfilter.rs:26 — rust/lance/src/index/scalar/bloomfilter.rs:26-37 | rust/lance/src/index/scalar/minhash_lsh.rs:31-42 | rust/lance/src/index/scalar/rtree.rs:27-38 — before extracting anything, compare `rust/lance/src/index/scalar/bloomfilter.rs` and `rust/lance/src/index/scalar/minhash_lsh.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) rust/lance-file/src/reader/structural.rs:249 — rust/lance-file/src/reader/structural.rs:249-260 | rust/lance-file/src/versions/v1/mod.rs:43-54 | rust/lance-file/src/versions/v2_0/reader.rs:205-216 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/reader/structural.rs:249` it begins part-way through the construct above it, so those 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/lance-file/src/versions/v1/mod.rs:56` calls `projection_from_whole_schema`, `projection_from_field_ids`, `field_id_to_column_index` and `rust/lance-file/src/reader/structural.rs:263` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) java/src/main/java/org/lance/Dataset.java:880 — java/src/main/java/org/lance/Dataset.java:880-891 | java/src/main/java/org/lance/Dataset.java:909-920 | java/src/main/java/org/lance/Dataset.java:992-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 `java/src/main/java/org/lance/Dataset.java:880` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • Duplicated block (8 lines × 3) rust/lance-file/src/versions/v2_1/mod.rs:108 — rust/lance-file/src/versions/v2_1/mod.rs:108-115 | rust/lance-file/src/versions/v2_2/mod.rs:104-111 | rust/lance-file/src/versions/v2_3/mod.rs:116-123 — `rust/lance-file/src/versions/v2_2/mod.rs` and `rust/lance-file/src/versions/v2_3/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/mod.rs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) rust/lance-index/src/scalar/inverted/index/partition.rs:1141 — rust/lance-index/src/scalar/inverted/index/partition.rs:1141-1148 | rust/lance-index/src/scalar/inverted/index/partition.rs:1207-1214 | rust/lance-index/src/scalar/inverted/index/partition.rs:1269-1276 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/lance-index/src/scalar/inverted/index/partition.rs:1216` calls `new_with_block_size` and `rust/lance-index/src/scalar/inverted/index/partition.rs:1150` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) rust/lance-jsonb/src/jsonpath/selector.rs:766 — rust/lance-jsonb/src/jsonpath/selector.rs:766-773 | rust/lance-jsonb/src/jsonpath/selector.rs:780-787 | rust/lance-jsonb/src/jsonpath/selector.rs:797-804 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/jsonpath/selector.rs:766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) rust/lance/src/dataset/optimize/execution.rs:624 — rust/lance/src/dataset/optimize/execution.rs:624-631 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1250-1257 | rust/lance/src/dataset/write/update.rs:482-489 — 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/lance/src/dataset/optimize/execution.rs:624` it does not close everything it opens, so those exact lines 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/lance-file/src/versions/v2_1/writer.rs:79 — rust/lance-file/src/versions/v2_1/writer.rs:79-86 | rust/lance-file/src/versions/v2_2/writer.rs:79-86 | rust/lance-file/src/versions/v2_3/writer.rs:79-86 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 3) python/src/dataset/optimize.rs:211 — python/src/dataset/optimize.rs:211-218 | python/src/fragment.rs:981-988 | python/src/fragment.rs:1033-1040 — 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 (8 lines × 3) rust/lance/src/dataset.rs:1259 — rust/lance/src/dataset.rs:1259-1266 | rust/lance/src/dataset.rs:1319-1326 | rust/lance/src/dataset/builder.rs:151-158 — 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/lance/src/dataset.rs:1259` it begins part-way through the construct above it, so those 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) · ×7
  • Duplicated block (7 lines × 3) rust/lance-index/src/scalar/inverted/index/search.rs:826 — rust/lance-index/src/scalar/inverted/index/search.rs:826-832 | rust/lance-index/src/scalar/inverted/index/search.rs:1094-1100 | rust/lance-index/src/vector.rs:539-545 — 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/lance-index/src/scalar/inverted/index/search.rs:826` it does not close everything it opens, so those exact lines 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/lance/src/index/scalar/bitmap.rs:99 — rust/lance/src/index/scalar/bitmap.rs:99-105 | rust/lance/src/index/scalar/btree.rs:141-147 | rust/lance/src/index/scalar/label_list.rs:108-114 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/btree.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) rust/lance-linalg/src/simd/dist_table.rs:255 — rust/lance-linalg/src/simd/dist_table.rs:255-261 | rust/lance-linalg/src/simd/dist_table.rs:471-477 | rust/lance-linalg/src/simd/dist_table.rs:514-520 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-linalg/src/simd/dist_table.rs:255` it does not close everything it opens, so those exact lines 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/lance-index/src/scalar/inverted/encoding.rs:417 — rust/lance-index/src/scalar/inverted/encoding.rs:417-423 | rust/lance-index/src/scalar/inverted/impact.rs:573-579 | rust/lance-index/src/scalar/inverted/index/posting_builder.rs:113-119 — 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/lance-index/src/scalar/bitmap.rs:2762 — rust/lance-index/src/scalar/bitmap.rs:2762-2768 | rust/lance-index/src/scalar/btree.rs:4455-4461 | rust/lance-index/src/scalar/label_list.rs:1211-1217 — before extracting anything, compare `rust/lance-index/src/scalar/bitmap.rs` and `rust/lance-index/src/scalar/btree.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/bitmap.rs:2762` it begins part-way through the construct above it, so those exact lines 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/lance-arrow/src/lib.rs:1123 — rust/lance-arrow/src/lib.rs:1123-1129 | rust/lance-arrow/src/lib.rs:1145-1151 | rust/lance-arrow/src/lib.rs:1167-1173 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-arrow/src/lib.rs:1123` it begins part-way through the construct above it, so those exact lines 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/lance/src/dataset/index/frag_reuse.rs:684 — rust/lance/src/dataset/index/frag_reuse.rs:684-690 | rust/lance/src/index/frag_reuse.rs:2339-2345 | rust/lance/src/index/frag_reuse.rs:2383-2389 — before extracting anything, compare `rust/lance/src/dataset/index/frag_reuse.rs` and `rust/lance/src/index/frag_reuse.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D1 · Cyclomatic Complexity · lance_datafusion · ×6
  • lance_datafusion::substrait::normalize_expr (cyclomatic 37) rust/lance-datafusion/src/substrait.rs:395 — lance_datafusion::substrait::normalize_expr 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.
  • lance_datafusion::signed_zero::rewrite_node (cyclomatic 24) rust/lance-datafusion/src/signed_zero.rs:642 — lance_datafusion::signed_zero::rewrite_node 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.
  • lance_datafusion::numeric_coercion::lower_decimal (cyclomatic 21) rust/lance-datafusion/src/numeric_coercion.rs:193 — lance_datafusion::numeric_coercion::lower_decimal 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.
  • lance_datafusion::logical_expr::resolve_expr (cyclomatic 19) rust/lance-datafusion/src/logical_expr.rs:99 — lance_datafusion::logical_expr::resolve_expr 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.
  • lance_datafusion::numeric_coercion::rewrite (cyclomatic 17) rust/lance-datafusion/src/numeric_coercion.rs:287 — lance_datafusion::numeric_coercion::rewrite 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.
  • lance_datafusion::numeric_coercion::unwrap_node (cyclomatic 16) rust/lance-datafusion/src/numeric_coercion.rs:571 — lance_datafusion::numeric_coercion::unwrap_node 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 · lance_jni · ×6
  • lance_jni::blocking_scanner::build_scanner_with_options (cyclomatic 34) java/lance-jni/src/blocking_scanner.rs:353 — lance_jni::blocking_scanner::build_scanner_with_options has cyclomatic complexity 34 (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.
  • lance_jni::transaction::convert_to_rust_operation (cyclomatic 33) java/lance-jni/src/transaction.rs:1761 — lance_jni::transaction::convert_to_rust_operation 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.
  • lance_jni::transaction::convert_to_java_operation_inner (cyclomatic 29) java/lance-jni/src/transaction.rs:890 — lance_jni::transaction::convert_to_java_operation_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.
  • lance_jni::index::determine_index_type (cyclomatic 20) java/lance-jni/src/index.rs:267 — lance_jni::index::determine_index_type has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • lance_jni::utils::build_compaction_options (cyclomatic 18) java/lance-jni/src/utils.rs:203 — lance_jni::utils::build_compaction_options has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: lance_jni::utils::scalar_value_to_java (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.
  • lance_jni::transaction::inner_commit_to_uri (cyclomatic 16) java/lance-jni/src/transaction.rs:2339 — lance_jni::transaction::inner_commit_to_uri 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 · MergeInsertJob · ×6
  • MergeInsertJob::analyze_report (cyclomatic 32) rust/lance/src/dataset/write/merge_insert/job.rs:2038 — MergeInsertJob::analyze_report has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • MergeInsertJob::update_fragments (cyclomatic 24) rust/lance/src/dataset/write/merge_insert/update_fragments.rs:146 — MergeInsertJob::update_fragments 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 (MergeInsertJob::update_fragments::handle_fragment) 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.
  • MergeInsertJob::execute_uncommitted_impl (cyclomatic 21) rust/lance/src/dataset/write/merge_insert/job.rs:1458 — MergeInsertJob::execute_uncommitted_impl 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.
  • MergeInsertJob::create_indexed_scan_joined_stream (cyclomatic 18) rust/lance/src/dataset/write/merge_insert/job.rs:219 — MergeInsertJob::create_indexed_scan_joined_stream 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.
  • MergeInsertJob::can_use_create_plan (cyclomatic 17) rust/lance/src/dataset/write/merge_insert/job.rs:1326 — MergeInsertJob::can_use_create_plan has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • MergeInsertJob::update_fragments::handle_fragment (cyclomatic 17) rust/lance/src/dataset/write/merge_insert/update_fragments.rs:275 — MergeInsertJob::update_fragments::handle_fragment 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 shape REPEATS in the file: one other method here (MergeInsertJob::update_fragments) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · lance_table · ×6
  • lance_table::system_index::frag_reuse::gate::classify (cyclomatic 31) rust/lance-table/src/system_index/frag_reuse/gate.rs:54 — lance_table::system_index::frag_reuse::gate::classify 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.
  • lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns (cyclomatic 27) rust/lance-table/src/utils/stream.rs:478 — lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • lance_table::transaction::row_version::resolve_update_version_metadata (cyclomatic 23) rust/lance-table/src/transaction/row_version.rs:91 — lance_table::transaction::row_version::resolve_update_version_metadata 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.
  • lance_table::transaction::validate::merge_schema_valid (cyclomatic 20) rust/lance-table/src/transaction/validate.rs:899 — lance_table::transaction::validate::merge_schema_valid 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.
  • lance_table::format::key_existence::extract_key_value (cyclomatic 19) rust/lance-table/src/format/key_existence.rs:413 — lance_table::format::key_existence::extract_key_value 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.
  • lance_table::feature_flags::apply_feature_flags (cyclomatic 16) rust/lance-table/src/feature_flags.rs:284 — lance_table::feature_flags::apply_feature_flags 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.
D2 · Cognitive Complexity · MergeInsertJob · ×6
  • MergeInsertJob::analyze_report (cognitive 50) rust/lance/src/dataset/write/merge_insert/job.rs:2038 — MergeInsertJob::analyze_report has cognitive complexity 50 (threshold 15). Drivers by points: if/else 27 (34 pts), match/switch 4 (8 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • MergeInsertJob::execute_uncommitted_impl (cognitive 45) rust/lance/src/dataset/write/merge_insert/job.rs:1458 — MergeInsertJob::execute_uncommitted_impl has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (30 pts), loops 3 (9 pts), match/switch 2 (4 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.
  • MergeInsertJob::update_fragments (cognitive 44) rust/lance/src/dataset/write/merge_insert/update_fragments.rs:146 — MergeInsertJob::update_fragments has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27 (58 pts), loops 13 (33 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MergeInsertJob::update_fragments::handle_fragment) 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.
  • MergeInsertJob::update_fragments::handle_fragment (cognitive 35) rust/lance/src/dataset/write/merge_insert/update_fragments.rs:275 — MergeInsertJob::update_fragments::handle_fragment has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 6 (17 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. This shape REPEATS in the file: one other method here (MergeInsertJob::update_fragments) 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.
  • MergeInsertJob::create_indexed_scan_joined_stream (cognitive 24) rust/lance/src/dataset/write/merge_insert/job.rs:219 — MergeInsertJob::create_indexed_scan_joined_stream has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 3 (5 pts), boolean chains 3, 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.
  • MergeInsertJob::can_use_create_plan (cognitive 18) rust/lance/src/dataset/write/merge_insert/job.rs:1326 — MergeInsertJob::can_use_create_plan has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (5 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×6
  • Edited copy of a member (27 corresponding lines) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:129 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:129-162 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:93-134 — 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/lance-index/src/vector/bq/dist_table_quant.rs:286 — rust/lance-index/src/vector/bq/dist_table_quant.rs:286-314 | rust/lance-index/src/vector/bq/dist_table_quant.rs:322-348 — 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/lance/src/index/scalar/inverted.rs:542 — rust/lance/src/index/scalar/inverted.rs:542-583 | rust/lance/src/index/scalar/inverted.rs:604-630 — 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/lance-table/src/rowids.rs:417 — rust/lance-table/src/rowids.rs:417-445 | rust/lance-table/src/rowids/version.rs:315-341 — 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/lance-index/src/scalar/inverted/index/posting_prewarm.rs:43 — rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:43-72 | rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:74-100 — 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) java/lance-jni/src/blocking_dataset/construction.rs:376 — java/lance-jni/src/blocking_dataset/construction.rs:376-402 | java/lance-jni/src/fragment.rs:233-260 — 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, 1+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 1+ corresponding lines) rust/lance-linalg/src/distance/cosine.rs:810 — rust/lance-linalg/src/distance/cosine.rs:810-810 | rust/lance-linalg/src/distance/cosine.rs:1024-1024 | rust/lance-linalg/src/distance/l2.rs:711-711 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 1+ corresponding lines) rust/lance-linalg/src/distance/cosine.rs:859 — rust/lance-linalg/src/distance/cosine.rs:859-859 | rust/lance-linalg/src/distance/dot.rs:701-701 | rust/lance-linalg/src/distance/l2.rs:761-761 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 1+ corresponding lines) rust/lance-linalg/src/distance/dot.rs:563 — rust/lance-linalg/src/distance/dot.rs:563-563 | rust/lance-linalg/src/distance/dot.rs:599-599 | rust/lance-linalg/src/distance/l2.rs:650-650 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 1+ corresponding lines) rust/lance-linalg/src/simd/dist_table.rs:159 — rust/lance-linalg/src/simd/dist_table.rs:159-159 | rust/lance-linalg/src/simd/dist_table.rs:184-184 | rust/lance-linalg/src/simd/dist_table.rs:209-209 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 1+ corresponding lines) rust/lance-linalg/src/simd/dist_table.rs:1990 — rust/lance-linalg/src/simd/dist_table.rs:1990-1990 | rust/lance-linalg/src/simd/dist_table.rs:2006-2006 | rust/lance-linalg/src/simd/dist_table.rs:2022-2022 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 1+ corresponding lines) rust/lance-linalg/src/distance/cosine.rs:485 — rust/lance-linalg/src/distance/cosine.rs:485-485 | rust/lance-linalg/src/distance/cosine.rs:503-503 | rust/lance-linalg/src/distance/cosine.rs:521-521 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×6
  • Edited copy of a member (29 corresponding lines) rust/lance-core/src/levenshtein.rs:17 — rust/lance-core/src/levenshtein.rs:17-46 | rust/lance/src/dataset/mem_wal/index/fts.rs:668-696 — 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/lance/src/dataset/mem_wal/index/btree.rs:477 — rust/lance/src/dataset/mem_wal/index/btree.rs:477-505 | rust/lance/src/dataset/mem_wal/index/btree.rs:694-723 — 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/lance/src/dataset/mem_wal/scanner/collector.rs:307 — rust/lance/src/dataset/mem_wal/scanner/collector.rs:307-335 | rust/lance/src/dataset/mem_wal/scanner/collector.rs:344-380 — 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/lance-index/src/vector/flat/storage.rs:86 — rust/lance-index/src/vector/flat/storage.rs:86-116 | rust/lance-index/src/vector/flat/storage.rs:266-294 — 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) java/src/main/java/org/lance/Dataset.java:160 — java/src/main/java/org/lance/Dataset.java:160-188 | java/src/main/java/org/lance/Dataset.java:304-332 — 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) java/lance-jni/src/blocking_dataset/read.rs:599 — java/lance-jni/src/blocking_dataset/read.rs:599-628 | java/lance-jni/src/blocking_dataset/read.rs:903-931 — 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/lance-arrow/src/json.rs:391 — rust/lance-arrow/src/json.rs:391-416 | rust/lance-arrow/src/json.rs:419-444 — 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/lance-jsonb/src/core/de.rs:583 — rust/lance-jsonb/src/core/de.rs:583-608 | rust/lance-jsonb/src/core/de.rs:863-896 — 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/lance-arrow/src/json.rs:625 — rust/lance-arrow/src/json.rs:625-650 | rust/lance-arrow/src/json.rs:655-680 — 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) java/lance-jni/src/namespace.rs:1566 — java/lance-jni/src/namespace.rs:1566-1593 | java/lance-jni/src/namespace.rs:2519-2544 — 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) python/src/namespace.rs:142 — python/src/namespace.rs:142-170 | python/src/namespace.rs:892-917 — 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/lance/src/dataset/mem_wal/write/writer.rs:750 — rust/lance/src/dataset/mem_wal/write/writer.rs:750-775 | rust/lance/src/dataset/mem_wal/write/writer.rs:1906-1934 — 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 copies of one member (3 members, 6+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 6+ corresponding lines) rust/lance-linalg/src/distance/cosine.rs:65 — rust/lance-linalg/src/distance/cosine.rs:65-71 | rust/lance-linalg/src/distance/dot.rs:205-210 | rust/lance-linalg/src/distance/l2.rs:50-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) rust/lance-index/src/vector/bq/dist_table_quant.rs:352 — rust/lance-index/src/vector/bq/dist_table_quant.rs:352-357 | rust/lance-index/src/vector/bq/dist_table_quant.rs:361-366 | rust/lance-index/src/vector/bq/ex_dot.rs:778-784 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) rust/lance-encoding/src/encodings/logical/primitive/all_null.rs:857 — rust/lance-encoding/src/encodings/logical/primitive/all_null.rs:857-864 | rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:625-630 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:2247-2252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) java/lance-jni/src/blocking_dataset/index.rs:406 — java/lance-jni/src/blocking_dataset/index.rs:406-412 | java/lance-jni/src/blocking_dataset/mutation.rs:173-179 | java/lance-jni/src/blocking_dataset/refs.rs:596-601 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) rust/lance-file/src/versions/v2_1/mod.rs:126 — rust/lance-file/src/versions/v2_1/mod.rs:126-134 | rust/lance-file/src/versions/v2_2/mod.rs:122-131 | rust/lance-file/src/versions/v2_3/mod.rs:134-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) rust/lance-encoding/src/array_encoding/strategy.rs:773 — rust/lance-encoding/src/array_encoding/strategy.rs:773-778 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1678-1683 | rust/lance-io/src/uring/thread.rs:153-160 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×6
  • Edited copy of a member (4 corresponding lines) rust/lance-index/src/vector/hnsw/builder.rs:66 — rust/lance-index/src/vector/hnsw/builder.rs:66-72 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:1253-1256 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) rust/lance-index/src/vector/bq/storage.rs:2875 — rust/lance-index/src/vector/bq/storage.rs:2875-2878 | rust/lance-index/src/vector/flat/storage.rs:75-79 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) python/src/dataset.rs:3207 — python/src/dataset.rs:3207-3210 | python/src/fragment.rs:696-699 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) python/src/dataset.rs:1856 — python/src/dataset.rs:1856-1859 | python/src/fragment.rs:685-688 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) rust/lance-arrow/src/json.rs:446 — rust/lance-arrow/src/json.rs:446-449 | rust/lance/src/dataset/blob/rewrite.rs:333-338 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) java/lance-jni/src/merge_insert.rs:275 — java/lance-jni/src/merge_insert.rs:275-278 | java/lance-jni/src/update.rs:101-104 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×6
  • Duplicated block (11 lines × 3) rust/lance-encoding/src/decoder.rs:1755 — rust/lance-encoding/src/decoder.rs:1755-1765 | rust/lance-encoding/src/decoder.rs:1992-2002 | rust/lance-encoding/src/decoder.rs:2252-2262 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-encoding/src/decoder.rs:1755` it does not close everything it opens, so those exact lines 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/lance-namespace-impls/src/dir/manifest.rs:2925 — rust/lance-namespace-impls/src/dir/manifest.rs:2925-2935 | rust/lance-namespace-impls/src/dir/manifest.rs:2961-2971 | rust/lance-namespace-impls/src/dir/manifest.rs:3072-3084 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-namespace-impls/src/dir/manifest.rs:2925` it does not close everything it opens, so those exact lines 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/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:136 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:136-146 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:146-156 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:111-121 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) rust/lance/src/index/scalar/bitmap.rs:41 — rust/lance/src/index/scalar/bitmap.rs:41-51 | rust/lance/src/index/scalar/btree.rs:71-81 | rust/lance/src/index/scalar/rtree.rs:88-98 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/btree.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) rust/lance-index/src/scalar/inverted/compound.rs:1027 — rust/lance-index/src/scalar/inverted/compound.rs:1027-1037 | rust/lance-index/src/scalar/inverted/compound.rs:3334-3344 | rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:508-518 — before extracting anything, compare `rust/lance-index/src/scalar/inverted/compound.rs` and `rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) rust/lance/src/io/exec/fts/compound.rs:1025 — rust/lance/src/io/exec/fts/compound.rs:1025-1035 | rust/lance/src/io/exec/fts/compound.rs:1678-1689 | rust/lance/src/io/exec/minhash.rs:193-203 — 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/lance/src/io/exec/fts/compound.rs:1025` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance/src/io/exec/minhash.rs:205` calls `clone` and `rust/lance/src/io/exec/fts/compound.rs:1036` 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 × 4) · ×6
  • Duplicated block (7 lines × 4) java/lance-jni/src/mem_wal.rs:785 — java/lance-jni/src/mem_wal.rs:785-793 | java/lance-jni/src/mem_wal.rs:910-916 | python/src/mem_wal.rs:760-767 | python/src/mem_wal.rs:834-840 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 4) rust/lance-linalg/src/simd/f32.rs:448 — rust/lance-linalg/src/simd/f32.rs:448-454 | rust/lance-linalg/src/simd/f32.rs:961-967 | rust/lance-linalg/src/simd/f64.rs:298-304 | rust/lance-linalg/src/simd/f64.rs:754-760 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 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/lance-linalg/src/simd/f32.rs:448` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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/lance-linalg/src/simd/f32.rs:958` calls `lasx_xvfmadd_s` and `rust/lance-linalg/src/simd/f32.rs:445` 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/lance-linalg/src/simd/f32.rs:760 — rust/lance-linalg/src/simd/f32.rs:760-766 | rust/lance-linalg/src/simd/f32.rs:782-788 | rust/lance-linalg/src/simd/f64.rs:606-612 | rust/lance-linalg/src/simd/f64.rs:629-635 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 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/lance-linalg/src/simd/f32.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `ptr` to `*mut f32` in one and `*mut f64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 4) rust/lance-namespace-impls/src/dir/manifest.rs:3323 — rust/lance-namespace-impls/src/dir/manifest.rs:3323-3329 | rust/lance-namespace-impls/src/dir/manifest.rs:4314-4320 | rust/lance-namespace-impls/src/dir/manifest.rs:4377-4383 | rust/lance-namespace-impls/src/dir/manifest.rs:4429-4435 — 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 (7 lines × 4) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:300 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:300-306 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:736-742 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scalar_index.rs:512-518 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:361-369 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.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.
  • Duplicated block (7 lines × 4) rust/lance-datafusion-exec/src/expr.rs:143 — rust/lance-datafusion-exec/src/expr.rs:143-149 | rust/lance-datafusion-exec/src/expr.rs:169-175 | rust/lance-datafusion-exec/src/expr.rs:260-266 | rust/lance-datafusion-exec/src/expr.rs:282-288 — 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/lance-datafusion-exec/src/expr.rs:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Off the main sequence · ×6
  • Off the main sequence: fsst — fsst: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: lance-arrow-scalar — lance-arrow-scalar: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: lance-jsonb — lance-jsonb: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: lance-datagen — lance-datagen: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: lance-core (Cargo) — lance-core (Cargo): abstractness 0.15, instability 0.11, distance 0.75 — zone of pain — concrete and depended on by 17 project(s), so it's rigid to change.
  • Off the main sequence: lance-io — lance-io: abstractness 0.11, instability 0.17, distance 0.73 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×6
  • Outbound HTTP without resilience REDACTED:270 — `urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience python/python/lance/download.py:57 — `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience python/python/lance/download.py:86 — `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience rust/lance-namespace-impls/src/credentials/azure.rs:231 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience rust/lance-namespace-impls/src/rest/tls.rs:77 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience rust/lance-namespace-impls/src/rest/tls.rs:136 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D1 · Cyclomatic Complexity · CleanupTask · ×5
  • CleanupTask::cleanup_file_if_not_referenced (cyclomatic 48) rust/lance/src/dataset/cleanup.rs:2278 — CleanupTask::cleanup_file_if_not_referenced has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CleanupTask::delete_unreferenced_files (cyclomatic 32) rust/lance/src/dataset/cleanup.rs:1662 — CleanupTask::delete_unreferenced_files 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.
  • CleanupTask::process_manifest_file (cyclomatic 22) rust/lance/src/dataset/cleanup.rs:1349 — CleanupTask::process_manifest_file 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.
  • CleanupTask::run (cyclomatic 20) rust/lance/src/dataset/cleanup.rs:936 — CleanupTask::run has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CleanupTask::process_branch_referenced_manifests (cyclomatic 20) rust/lance/src/dataset/cleanup.rs:2883 — CleanupTask::process_branch_referenced_manifests 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 · pylance · ×5
  • pylance::dataset::prepare_vector_index_params (cyclomatic 39) python/src/dataset.rs:4529 — pylance::dataset::prepare_vector_index_params has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • pylance::dataset::write::get_write_params (cyclomatic 32) python/src/dataset/write.rs:173 — pylance::dataset::write::get_write_params 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.
  • pylance::dataset::optimize::parse_compaction_options (cyclomatic 24) python/src/dataset/optimize.rs:26 — pylance::dataset::optimize::parse_compaction_options 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.
  • pylance::scanner::vector_query_params_from_dict (cyclomatic 24) python/src/scanner.rs:436 — pylance::scanner::vector_query_params_from_dict has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • pylance::dataset::writer_config_from_kwargs (cyclomatic 17) python/src/dataset.rs:212 — pylance::dataset::writer_config_from_kwargs 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 · DirectoryNamespace · ×5
  • DirectoryNamespace::describe_table_impl (cyclomatic 36) rust/lance-namespace-impls/src/dir/load.rs:18 — DirectoryNamespace::describe_table_impl 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.
  • DirectoryNamespace::query_table (cyclomatic 32) rust/lance-namespace-impls/src/dir/namespace.rs:2207 — DirectoryNamespace::query_table 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.
  • DirectoryNamespace::build_index_params (cyclomatic 27) rust/lance-namespace-impls/src/dir/index_params.rs:91 — DirectoryNamespace::build_index_params 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.
  • DirectoryNamespace::alter_transaction (cyclomatic 25) rust/lance-namespace-impls/src/dir/namespace.rs:1320 — DirectoryNamespace::alter_transaction 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.
  • DirectoryNamespace::apply_query_params_to_scanner (cyclomatic 17) rust/lance-namespace-impls/src/dir/query.rs:118 — DirectoryNamespace::apply_query_params_to_scanner 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 · PrimitiveStructuralEncoder · ×5
  • PrimitiveStructuralEncoder::encode_dense_page (cyclomatic 32) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:2206 — PrimitiveStructuralEncoder::encode_dense_page 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.
  • PrimitiveStructuralEncoder::sample_unique_ratio (cyclomatic 24) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1892 — PrimitiveStructuralEncoder::sample_unique_ratio has cyclomatic complexity 24 (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.
  • PrimitiveStructuralEncoder::should_dictionary_encode (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1757 — PrimitiveStructuralEncoder::should_dictionary_encode 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.
  • PrimitiveStructuralEncoder::serialize_miniblocks (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:477 — PrimitiveStructuralEncoder::serialize_miniblocks 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.
  • PrimitiveStructuralEncoder::is_constant_values (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:922 — PrimitiveStructuralEncoder::is_constant_values has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · FixmeComment · ×5
  • FixmeComment rust/lance-file/src/versions/v1/writer/mod.rs:1139 — // FIXME: these max values shouldn't be incremented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment rust/lance-datafusion/src/planner.rs:2090 — // FIXME: This should work, but sqlparser doesn't recognize anything — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment rust/lance-core/src/utils/bloomfilter/sbbf.rs:27 — //! FIXME: Make the upstream SBBF implementation public so that this file could be — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment rust/lance/src/dataset/fragment.rs:2549 — // FIXME, change this method to streams — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment python/python/tests/test_dataset.py:1685 — # FIXME: sqlparser seems to ignore the .y part, but I can't create a simple — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · pylance · ×5
  • pylance::dataset::write::get_write_params (cognitive 61) python/src/dataset/write.rs:173 — pylance::dataset::write::get_write_params has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (49 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • pylance::dataset::prepare_vector_index_params (cognitive 53) python/src/dataset.rs:4529 — pylance::dataset::prepare_vector_index_params has cognitive complexity 53 (threshold 15). Drivers by points: if/else 26 (46 pts), match/switch 3 (6 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.
  • pylance::scanner::vector_query_params_from_dict (cognitive 41) python/src/scanner.rs:436 — pylance::scanner::vector_query_params_from_dict has cognitive complexity 41 (threshold 15). Drivers by points: if/else 29 (36 pts), boolean chains 5 (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.
  • pylance::dataset::writer_config_from_kwargs (cognitive 20) python/src/dataset.rs:212 — pylance::dataset::writer_config_from_kwargs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • pylance::session::backend_config_from_dict (cognitive 16) python/src/session.rs:109 — pylance::session::backend_config_from_dict has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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 · PostingIterator · ×5
  • PostingIterator::merge_optional_freqs (cognitive 45) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:966 — PostingIterator::merge_optional_freqs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 4 (8 pts), match/switch 5 (6 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PostingIterator::position_cursor (cognitive 28) rust/lance-index/src/scalar/inverted/wand/posting.rs:939 — PostingIterator::position_cursor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 2 (10 pts), match/switch 3 (6 pts) (nesting depth added 20). 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.
  • PostingIterator::collect_window_scores (cognitive 26) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:32 — PostingIterator::collect_window_scores has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (7 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.
  • PostingIterator::take_docs_one_block_upto (cognitive 20) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1072 — PostingIterator::take_docs_one_block_upto has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 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.
  • PostingIterator::next_doc_id (cognitive 18) rust/lance-index/src/scalar/inverted/wand/posting.rs:1139 — PostingIterator::next_doc_id has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×5
  • Edited copy of a member (32 corresponding lines) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:1037 — rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:1037-1068 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:321-362 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) rust/lance-index/src/vector/bq/pairwise.rs:616 — rust/lance-index/src/vector/bq/pairwise.rs:616-648 | rust/lance-index/src/vector/bq/pairwise.rs:703-734 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) python/src/dataset.rs:3610 — python/src/dataset.rs:3610-3647 | python/src/indices.rs:164-195 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) rust/lance-index/src/scalar/inverted/index/search.rs:272 — rust/lance-index/src/scalar/inverted/index/search.rs:272-303 | rust/lance-index/src/scalar/inverted/index/search.rs:310-344 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:870 — rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:870-901 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:903-943 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×5
  • Edited copy of a member (34 corresponding lines) rust/lance-index/src/vector/sq/pairwise.rs:460 — rust/lance-index/src/vector/sq/pairwise.rs:460-493 | rust/lance-index/src/vector/sq/pairwise.rs:506-539 — 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/lance/src/blob.rs:163 — rust/lance/src/blob.rs:163-196 | rust/lance/src/blob.rs:210-244 — 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/lance-file/src/reader/structural.rs:286 — rust/lance-file/src/reader/structural.rs:286-337 | rust/lance-file/src/versions/v2_0/reader.rs:244-277 — 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/lance/src/dataset/mem_wal/index/fts.rs:573 — rust/lance/src/dataset/mem_wal/index/fts.rs:573-606 | rust/lance/src/dataset/mem_wal/index/fts.rs:610-647 — 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) python/python/lance/_dataset/merge_insert.py:154 — python/python/lance/_dataset/merge_insert.py:154-187 | python/python/lance/_dataset/merge_insert.py:523-622 — 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, 15+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 15+ corresponding lines) java/lance-jni/src/blocking_blob.rs:60 — java/lance-jni/src/blocking_blob.rs:60-74 | java/lance-jni/src/blocking_blob.rs:115-132 | java/lance-jni/src/blocking_blob.rs:152-166 — 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) python/src/dataset/merge_insert.rs:215 — python/src/dataset/merge_insert.rs:215-233 | python/src/dataset/merge_insert.rs:299-313 | python/src/dataset/merge_insert.rs:319-340 — 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) java/lance-jni/src/merge_insert.rs:182 — java/lance-jni/src/merge_insert.rs:182-196 | java/lance-jni/src/merge_insert.rs:310-325 | java/lance-jni/src/merge_insert.rs:330-348 — 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) python/src/dataset.rs:1536 — python/src/dataset.rs:1536-1550 | python/src/dataset.rs:1564-1578 | python/src/dataset.rs:1592-1606 — 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/lance-file/src/reader.rs:2046 — rust/lance-file/src/reader.rs:2046-2061 | rust/lance-file/src/reader.rs:2068-2082 | rust/lance-file/src/reader.rs:2090-2104 — 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 (3 members, 13+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 13+ corresponding lines) python/src/dataset.rs:3482 — python/src/dataset.rs:3482-3494 | python/src/dataset.rs:3510-3522 | python/src/dataset.rs:3529-3543 — 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) java/lance-jni/src/blocking_dataset/maintenance.rs:412 — java/lance-jni/src/blocking_dataset/maintenance.rs:412-424 | java/lance-jni/src/index.rs:23-35 | java/lance-jni/src/transaction.rs:195-207 — 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/lance-encoding/src/format.rs:574 — rust/lance-encoding/src/format.rs:574-591 | rust/lance-encoding/src/format.rs:636-648 | rust/lance-encoding/src/format.rs:733-749 — 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/lance-index/src/scalar/btree.rs:681 — rust/lance-index/src/scalar/btree.rs:681-693 | rust/lance-index/src/scalar/inverted/documents.rs:292-304 | rust/lance-index/src/scalar/inverted/wand/posting.rs:581-593 — 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/lance/src/io/exec/fts/flat_match.rs:728 — rust/lance/src/io/exec/fts/flat_match.rs:728-741 | rust/lance/src/io/exec/fts/flat_match.rs:785-799 | rust/lance/src/io/exec/fts/match_query.rs:224-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 10+ corresponding lines) rust/lance-core/src/cache/telemetry.rs:428 — rust/lance-core/src/cache/telemetry.rs:428-437 | rust/lance-core/src/cache/telemetry.rs:528-540 | rust/lance-core/src/cache/telemetry.rs:548-557 — 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) python/src/dataset.rs:1884 — python/src/dataset.rs:1884-1896 | python/src/dataset.rs:2351-2360 | python/src/dataset.rs:3220-3232 — 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) java/lance-jni/src/delta.rs:161 — java/lance-jni/src/delta.rs:161-170 | java/lance-jni/src/delta.rs:185-194 | java/lance-jni/src/delta.rs:212-221 — 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) java/src/main/java/org/lance/delta/DatasetDelta.java:67 — java/src/main/java/org/lance/delta/DatasetDelta.java:67-76 | java/src/main/java/org/lance/delta/DatasetDelta.java:81-90 | java/src/main/java/org/lance/delta/DatasetDelta.java:99-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) java/lance-jni/src/session.rs:346 — java/lance-jni/src/session.rs:346-355 | java/lance-jni/src/session.rs:369-378 | java/lance-jni/src/session.rs:412-421 — 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, 7+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 7+ corresponding lines) python/src/debug.rs:16 — python/src/debug.rs:16-22 | python/src/debug.rs:26-32 | python/src/debug.rs:87-97 — 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/lance-core/src/cache/mod.rs:791 — rust/lance-core/src/cache/mod.rs:791-797 | rust/lance-core/src/cache/mod.rs:825-835 | rust/lance-core/src/cache/mod.rs:846-855 — 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) java/lance-jni/src/blocking_dataset/refs.rs:317 — java/lance-jni/src/blocking_dataset/refs.rs:317-324 | java/lance-jni/src/blocking_dataset/refs.rs:360-366 | java/lance-jni/src/blocking_dataset/refs.rs:386-392 — 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) python/src/dataset.rs:3653 — python/src/dataset.rs:3653-3659 | python/src/dataset.rs:3665-3672 | python/src/mem_wal.rs:939-945 — 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/lance-encoding/src/encodings/logical/primitive/all_null.rs:86 — rust/lance-encoding/src/encodings/logical/primitive/all_null.rs:86-92 | rust/lance-encoding/src/encodings/physical/rle.rs:2236-2242 | rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs:189-196 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×5
  • Duplicated block (19–20 lines × 2) python/src/dataset.rs:1214 — python/src/dataset.rs:1214-1233 | python/src/fragment.rs:376-394 — before extracting anything, compare `python/src/dataset.rs` and `python/src/fragment.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/dataset.rs:1214` it does not close everything it opens, so those exact lines 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/lance-encoding/src/encodings/physical/rle.rs:1621 — rust/lance-encoding/src/encodings/physical/rle.rs:1621-1640 | rust/lance-encoding/src/encodings/physical/rle.rs:1959-1977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/rle.rs:1621` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance-io/src/uring/current_thread.rs:196 — rust/lance-io/src/uring/current_thread.rs:196-215 | rust/lance-io/src/uring/thread.rs:499-517 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/thread.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-io/src/uring/current_thread.rs:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–20 lines × 2) rust/lance-jsonb/src/core/de.rs:370 — rust/lance-jsonb/src/core/de.rs:370-389 | rust/lance-jsonb/src/core/de.rs:586-604 — both copies are in the same file, so extract the 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/lance-jsonb/src/core/de.rs:605` calls `Err` and `rust/lance-jsonb/src/core/de.rs:390` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19–20 lines × 2) rust/lance/src/dataset.rs:4621 — rust/lance/src/dataset.rs:4621-4639 | rust/lance/src/dataset/fragment.rs:2680-2699 — 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/lance/src/dataset.rs:4621` it does not close everything it opens, so those exact 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 (17 lines × 3) · ×5
  • Duplicated block (17 lines × 3) java/lance-jni/src/blocking_dataset/read.rs:768 — java/lance-jni/src/blocking_dataset/read.rs:768-784 | java/lance-jni/src/blocking_dataset/read.rs:818-834 | java/lance-jni/src/blocking_dataset/read.rs:874-890 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/blocking_dataset/read.rs:768` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/io/exec/fts/match_query.rs:181 — rust/lance/src/io/exec/fts/match_query.rs:181-197 | rust/lance/src/io/exec/fts/match_query.rs:246-262 | rust/lance/src/io/exec/fts/match_query.rs:314-330 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/io/exec/fts/match_query.rs:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) rust/lance/src/io/exec/fts/phrase.rs:155 — rust/lance/src/io/exec/fts/phrase.rs:155-171 | rust/lance/src/io/exec/fts/phrase.rs:211-227 | rust/lance/src/io/exec/fts/phrase.rs:279-295 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/io/exec/fts/phrase.rs:155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) rust/lance-encoding/src/encodings/physical/alp.rs:766 — rust/lance-encoding/src/encodings/physical/alp.rs:766-782 | rust/lance-encoding/src/encodings/physical/alp.rs:917-933 | rust/lance-encoding/src/encodings/physical/alp.rs:938-954 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-encoding/src/encodings/physical/alp.rs:766` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) rust/lance-encoding/src/encodings/physical/alp.rs:998 — rust/lance-encoding/src/encodings/physical/alp.rs:998-1014 | rust/lance-encoding/src/encodings/physical/alp.rs:1157-1173 | rust/lance-encoding/src/encodings/physical/alp.rs:1178-1194 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-encoding/src/encodings/physical/alp.rs:998` it begins part-way through the construct above it, so those 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/lance-datafusion/src/planner.rs:779 — rust/lance-datafusion/src/planner.rs:779-794 | rust/lance-datafusion/src/planner.rs:796-810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-datafusion/src/planner.rs:779` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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/lance-datafusion/src/planner.rs:793` calls `Ok`, `Timestamp`, `Datetime` and `rust/lance-datafusion/src/planner.rs:778` 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/lance/src/dataset.rs:941 — rust/lance/src/dataset.rs:941-955 | rust/lance/src/dataset.rs:977-992 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset.rs:941` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–16 lines × 2) rust/lance/src/dataset/scanner/fts.rs:1816 — rust/lance/src/dataset/scanner/fts.rs:1816-1830 | rust/lance/src/dataset/scanner/fts.rs:2173-2188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/scanner/fts.rs:1816` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) rust/lance/src/index/vector/utils.rs:866 — rust/lance/src/index/vector/utils.rs:866-880 | rust/lance/src/index/vector/utils.rs:1073-1088 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector/utils.rs:866` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:382 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:382-397 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:407-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:382` it does not close everything it opens, so those 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/lance-datafusion-exec/src/expr.rs:393 — rust/lance-datafusion-exec/src/expr.rs:393-407 | rust/lance-datafusion-exec/src/expr.rs:525-539 | rust/lance-datafusion-exec/src/expr.rs:541-555 — all 3 copies are in the same file, so extract the block into one function there and call 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/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1191 — rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1191-1205 | rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1228-1242 | rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1343-1357 — all 3 copies are in the same file, so extract the block into one function there and call 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/lance-encoding/src/encodings/physical/alp.rs:560 — rust/lance-encoding/src/encodings/physical/alp.rs:560-574 | rust/lance-encoding/src/encodings/physical/alp.rs:633-647 | rust/lance-encoding/src/encodings/physical/alp.rs:1609-1623 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-encoding/src/encodings/physical/alp.rs:560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) rust/lance/src/index/vector.rs:1788 — rust/lance/src/index/vector.rs:1788-1802 | rust/lance/src/index/vector.rs:1806-1820 | rust/lance/src/index/vector.rs:1846-1860 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/index/vector.rs:1788` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 3) python/python/lance/_dataset/scanner.py:1191 — python/python/lance/_dataset/scanner.py:1191-1205 | python/python/lance/dataset.py:5578-5592 | python/python/lance/fragment.py:1798-1812 — 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 `python/python/lance/_dataset/scanner.py:1191` it begins part-way through the construct above it, so those 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) · ×5
  • Duplicated block (14 lines × 3) rust/lance-file/src/versions/v2_1/reader.rs:222 — rust/lance-file/src/versions/v2_1/reader.rs:222-235 | rust/lance-file/src/versions/v2_2/reader.rs:224-237 | rust/lance-file/src/versions/v2_3/reader.rs:387-400 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/reader.rs:222` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 × 3) rust/lance-index/src/scalar/zonemap.rs:718 — rust/lance-index/src/scalar/zonemap.rs:718-731 | rust/lance-index/src/scalar/zonemap.rs:733-746 | rust/lance-index/src/scalar/zonemap.rs:748-761 — all 3 copies are in the same file, so extract the block into one function there and call 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 (14 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:3404 — rust/lance-namespace-impls/src/dir/manifest.rs:3404-3417 | rust/lance-namespace-impls/src/dir/manifest.rs:3626-3639 | rust/lance-namespace-impls/src/dir/manifest.rs:4248-4261 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-namespace-impls/src/dir/manifest.rs:3404` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 × 3) rust/lance/src/index/vector.rs:1608 — rust/lance/src/index/vector.rs:1608-1621 | rust/lance/src/index/vector.rs:1639-1652 | rust/lance/src/index/vector.rs:1668-1681 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/index/vector.rs:1608` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) java/lance-jni/src/schema.rs:256 — java/lance-jni/src/schema.rs:256-269 | java/lance-jni/src/schema.rs:284-297 | java/lance-jni/src/schema.rs:314-327 — all 3 copies are in the same file, so extract the block into one function there and call 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, `java/lance-jni/src/schema.rs:300` calls `unwrap_or`, `new_string` and `java/lance-jni/src/schema.rs:272` 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–14 lines × 2) · ×5
  • Duplicated block (12–14 lines × 2) rust/compression/fsst/src/fsst.rs:1104 — rust/compression/fsst/src/fsst.rs:1104-1117 | rust/compression/fsst/src/fsst.rs:1167-1178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/compression/fsst/src/fsst.rs:1104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) rust/lance-encoding/src/encodings/physical/bitpacking.rs:577 — rust/lance-encoding/src/encodings/physical/bitpacking.rs:577-588 | rust/lance-encoding/src/encodings/physical/bitpacking.rs:633-646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/bitpacking.rs:577` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `data` to `Vec<LanceBuffer>` in one and `Option<LanceBuffer>` 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–14 lines × 2) rust/lance-index/src/scalar/inverted/compound.rs:4081 — rust/lance-index/src/scalar/inverted/compound.rs:4081-4092 | rust/lance-index/src/scalar/inverted/index/search.rs:1114-1127 — 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/lance-index/src/scalar/inverted/compound.rs:4081` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance/src/dataset/mem_wal/index/fts.rs:2032 — rust/lance/src/dataset/mem_wal/index/fts.rs:2032-2043 | rust/lance/src/io/exec/fts/query_tokens.rs:282-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/index/fts.rs:2032` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) rust/lance/src/index/vector/ivf.rs:1401 — rust/lance/src/index/vector/ivf.rs:1401-1414 | rust/lance/src/index/vector/ivf.rs:1490-1501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector/ivf.rs:1401` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:615 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:615-627 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:638-649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp/restore.rs:615` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) rust/lance-encoding/src/encodings/physical/binary.rs:1062 — rust/lance-encoding/src/encodings/physical/binary.rs:1062-1073 | rust/lance-encoding/src/encodings/physical/binary.rs:1105-1117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/binary.rs:1062` it begins part-way through the construct above it, so those exact 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/lance-encoding/src/utils/accumulation.rs:143 — rust/lance-encoding/src/utils/accumulation.rs:143-154 | rust/lance-encoding/src/utils/accumulation.rs:261-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/utils/accumulation.rs:143` it begins part-way through the construct above it, so those exact 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/lance-index/src/scalar/inverted/wand/maxscore.rs:53 — rust/lance-index/src/scalar/inverted/wand/maxscore.rs:53-65 | rust/lance-index/src/scalar/inverted/wand/maxscore.rs:1084-1095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/wand/maxscore.rs:53` it does not close everything it opens, so those 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/lance-index/src/scalar/inverted/wand/maxscore.rs:1082` calls `block_shift`, `block_mask` and `rust/lance-index/src/scalar/inverted/wand/maxscore.rs:52` 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/lance-jsonb/src/jsonpath/selector.rs:348 — rust/lance-jsonb/src/jsonpath/selector.rs:348-360 | rust/lance-jsonb/src/jsonpath/selector.rs:485-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-jsonb/src/jsonpath/selector.rs:348` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) rust/lance-datagen/src/generator.rs:145 — rust/lance-datagen/src/generator.rs:145-153 | rust/lance-datagen/src/generator.rs:168-176 | rust/lance-datagen/src/generator.rs:191-199 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-datagen/src/generator.rs:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:175 — rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:175-183 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:208-216 | rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:296-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.
  • Duplicated block (9 lines × 3) rust/lance-io/src/object_store/providers/oss.rs:153 — rust/lance-io/src/object_store/providers/oss.rs:153-161 | rust/lance-io/src/object_store/providers/tencent.rs:107-115 | rust/lance-io/src/object_store/providers/tos.rs:159-167 — before extracting anything, compare `rust/lance-io/src/object_store/providers/oss.rs` and `rust/lance-io/src/object_store/providers/tos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/lance-io/src/object_store/providers/oss.rs:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/index/vector/ivf.rs:1442 — rust/lance/src/index/vector/ivf.rs:1442-1450 | rust/lance/src/index/vector/ivf.rs:2769-2777 | rust/lance/src/index/vector/ivf.rs:2838-2846 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/index/vector/ivf.rs:1442` it begins part-way through the construct above it, so those 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/lance/src/index/vector/ivf.rs:1440` calls `clone` and `rust/lance/src/index/vector/ivf.rs:2836` 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) java/lance-jni/src/index_progress.rs:53 — java/lance-jni/src/index_progress.rs:53-61 | java/lance-jni/src/index_progress.rs:104-112 | java/lance-jni/src/index_progress.rs:128-136 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/index_progress.rs:53` it does not close everything it opens, so those 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 · FtsMemIndex · ×4
  • FtsMemIndex::to_index_builder (cognitive 61) rust/lance/src/dataset/mem_wal/index/fts.rs:2941 — FtsMemIndex::to_index_builder has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 14 (23 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.
  • FtsMemIndex::expand_fuzzy_term (cognitive 24) rust/lance/src/dataset/mem_wal/index/fts.rs:2706 — FtsMemIndex::expand_fuzzy_term has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (4 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.
  • FtsMemIndex::search_match_strings (cognitive 19) rust/lance/src/dataset/mem_wal/index/fts.rs:2306 — FtsMemIndex::search_match_strings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (7 pts), boolean chains 1, 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.
  • FtsMemIndex::insert_batch_with_keys (cognitive 16) rust/lance/src/dataset/mem_wal/index/fts.rs:1881 — FtsMemIndex::insert_batch_with_keys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 1, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · lance_io · ×4
  • lance_io::uring::thread::run_uring_thread (cognitive 51) rust/lance-io/src/uring/thread.rs:185 — lance_io::uring::thread::run_uring_thread has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (34 pts), match/switch 3 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_io::local::remove_empty_dirs (cognitive 39) rust/lance-io/src/local.rs:81 — lance_io::local::remove_empty_dirs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 5 (10 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_io::uring::current_thread::process_thread_local_completions (cognitive 23) rust/lance-io/src/uring/current_thread.rs:156 — lance_io::uring::current_thread::process_thread_local_completions 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.
  • lance_io::uring::thread::process_completions (cognitive 22) rust/lance-io/src/uring/thread.rs:452 — lance_io::uring::thread::process_completions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ManifestNamespace · ×4
  • ManifestNamespace::rewrite_manifest (cognitive 40) rust/lance-namespace-impls/src/dir/manifest.rs:2226 — ManifestNamespace::rewrite_manifest has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 4 (10 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ManifestNamespace::create_table (cognitive 25) rust/lance-namespace-impls/src/dir/manifest.rs:3398 — ManifestNamespace::create_table has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, boolean chains 4, match/switch 2 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ManifestNamespace::describe_table (cognitive 24) rust/lance-namespace-impls/src/dir/manifest.rs:3250 — ManifestNamespace::describe_table has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ManifestNamespace::list_tables (cognitive 18) rust/lance-namespace-impls/src/dir/manifest.rs:3159 — ManifestNamespace::list_tables has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileFragment · ×4
  • FileFragment::validate (cognitive 38) rust/lance/src/dataset/fragment.rs:2112 — FileFragment::validate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (9 pts), boolean chains 5, 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.
  • FileFragment::scanner (cognitive 33) python/src/fragment.rs:302 — FileFragment::scanner has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (29 pts), match/switch 2 (4 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.
  • FileFragment::open (cognitive 20) rust/lance/src/dataset/fragment.rs:1362 — FileFragment::open has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (16 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.
  • FileFragment::update_columns_from_stream (cognitive 16) rust/lance/src/dataset/fragment/aligned_update.rs:119 — FileFragment::update_columns_from_stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShouldMaxScoreScorer · ×4
  • ShouldMaxScoreScorer::current_score_upper_bound (cognitive 30) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:520 — ShouldMaxScoreScorer::current_score_upper_bound has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 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.
  • ShouldMaxScoreScorer::prepare_window (cognitive 25) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:209 — ShouldMaxScoreScorer::prepare_window has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3, 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.
  • ShouldMaxScoreScorer::ensure_confirmed (cognitive 20) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:345 — ShouldMaxScoreScorer::ensure_confirmed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ShouldMaxScoreScorer::position (cognitive 18) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:275 — ShouldMaxScoreScorer::position has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×4
  • Edited copy of a member (35 corresponding lines) rust/lance-file/src/versions/v2_2/mod.rs:73 — rust/lance-file/src/versions/v2_2/mod.rs:73-118 | rust/lance-file/src/versions/v2_3/mod.rs:80-130 — 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/lance/src/index/vector/ivf.rs:4706 — rust/lance/src/index/vector/ivf.rs:4706-4740 | rust/lance/src/index/vector/ivf.rs:4754-4797 — 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/lance-encoding/src/array_encoding/strategy.rs:136 — rust/lance-encoding/src/array_encoding/strategy.rs:136-175 | rust/lance-encoding/src/encoder/structural.rs:39-73 — 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/lance/src/io/exec/pushdown_scan.rs:250 — rust/lance/src/io/exec/pushdown_scan.rs:250-284 | rust/lance/src/io/exec/scan.rs:655-689 — 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 (53 corresponding lines) · ×4
  • Edited copy of a member (53 corresponding lines) rust/lance/src/io/exec/fts/match_query.rs:516 — rust/lance/src/io/exec/fts/match_query.rs:516-572 | rust/lance/src/io/exec/fts/phrase.rs:444-496 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) rust/lance-index/src/scalar/inverted/index/partition.rs:1184 — rust/lance-index/src/scalar/inverted/index/partition.rs:1184-1236 | rust/lance-index/src/scalar/inverted/index/partition.rs:1243-1300 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) rust/lance/src/dataset/blob/materialize.rs:714 — rust/lance/src/dataset/blob/materialize.rs:714-769 | rust/lance/src/dataset/blob/rewrite.rs:644-696 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) rust/lance-file/src/versions/v2_0/writer.rs:447 — rust/lance-file/src/versions/v2_0/writer.rs:447-502 | rust/lance-file/src/writer/structural.rs:607-659 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×4
  • Edited copy of a member (44 corresponding lines) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:99 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:99-142 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:145-188 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) java/lance-jni/src/mem_wal.rs:1228 — java/lance-jni/src/mem_wal.rs:1228-1273 | python/src/mem_wal.rs:1059-1102 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) rust/lance-file/src/versions/v1/writer/statistics.rs:718 — rust/lance-file/src/versions/v1/writer/statistics.rs:718-761 | rust/lance-file/src/versions/v1/writer/statistics.rs:763-806 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) python/src/indices.rs:459 — python/src/indices.rs:459-502 | python/src/indices.rs:629-673 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×4
  • Edited copy of a member (38 corresponding lines) rust/lance/src/dataset/index/frag_reuse.rs:663 — rust/lance/src/dataset/index/frag_reuse.rs:663-709 | rust/lance/src/index/frag_reuse.rs:2322-2359 — 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/lance-jsonb/src/jsonpath/parser.rs:85 — rust/lance-jsonb/src/jsonpath/parser.rs:85-122 | rust/lance-jsonb/src/jsonpath/parser.rs:124-162 — 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/lance/src/io/exec/filtered_read.rs:3565 — rust/lance/src/io/exec/filtered_read.rs:3565-3618 | rust/lance/src/io/exec/take.rs:458-495 — 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/lance-index/src/scalar/inverted/compound.rs:3346 — rust/lance-index/src/scalar/inverted/compound.rs:3346-3383 | rust/lance-index/src/scalar/inverted/compound.rs:3641-3679 — 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 (33 corresponding lines) · ×4
  • Edited copy of a member (33 corresponding lines) rust/lance-index/src/vector/pq/pairwise.rs:462 — rust/lance-index/src/vector/pq/pairwise.rs:462-494 | rust/lance-index/src/vector/pq/pairwise.rs:515-557 — 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/lance-table/src/rowids.rs:97 — rust/lance-table/src/rowids.rs:97-129 | rust/lance-table/src/rowids.rs:138-170 — 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/lance/src/index/vector/ivf.rs:4806 — rust/lance/src/index/vector/ivf.rs:4806-4838 | rust/lance/src/index/vector/ivf.rs:4851-4890 — 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/lance-encoding/src/encodings/physical/constant.rs:58 — rust/lance-encoding/src/encodings/physical/constant.rs:58-95 | rust/lance-encoding/src/encodings/physical/range.rs:87-119 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 21+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:461 — rust/lance-linalg/src/simd/f32.rs:461-481 | rust/lance-linalg/src/simd/f32.rs:513-533 | rust/lance-linalg/src/simd/f32.rs:565-585 — 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/lance-linalg/src/simd/f64.rs:311 — rust/lance-linalg/src/simd/f64.rs:311-331 | rust/lance-linalg/src/simd/f64.rs:363-383 | rust/lance-linalg/src/simd/f64.rs:415-435 — 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/lance-linalg/src/simd/f32.rs:700 — rust/lance-linalg/src/simd/f32.rs:700-720 | rust/lance-linalg/src/simd/f32.rs:723-747 | rust/lance-linalg/src/simd/f64.rs:545-565 — 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/lance-datafusion-exec/src/udf/json.rs:148 — rust/lance-datafusion-exec/src/udf/json.rs:148-168 | rust/lance-datafusion-exec/src/udf/json.rs:175-195 | rust/lance-datafusion-exec/src/udf/json.rs:202-222 — 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, 14+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 14+ corresponding lines) rust/lance-select/src/mask.rs:683 — rust/lance-select/src/mask.rs:683-696 | rust/lance-select/src/mask.rs:1174-1194 | rust/lance-select/src/mask.rs:1230-1248 — 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) java/src/main/java/org/lance/Tag.java:102 — java/src/main/java/org/lance/Tag.java:102-117 | java/src/main/java/org/lance/Transaction.java:118-131 | java/src/main/java/org/lance/operation/RewrittenIndex.java:91-105 — 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) python/src/dataset.rs:3239 — python/src/dataset.rs:3239-3254 | python/src/dataset.rs:3263-3278 | python/src/dataset.rs:3282-3295 — 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/lance-jsonb/src/core/de.rs:145 — rust/lance-jsonb/src/core/de.rs:145-158 | rust/lance-jsonb/src/core/de.rs:160-174 | rust/lance-jsonb/src/core/de.rs:176-193 — 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 · Duplicated block (18–19 lines × 2) · ×4
  • Duplicated block (18–19 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:324 — rust/lance-file/src/versions/v2_0/writer.rs:324-342 | rust/lance-file/src/writer/structural.rs:411-428 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–19 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/write.rs:1247 — rust/lance/src/dataset/write/merge_insert/exec/write.rs:1247-1265 | rust/lance/src/dataset/write/update.rs:480-497 — 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/lance/src/dataset/write/merge_insert/exec/write.rs:1247` it begins part-way through the construct above it, so those exact lines 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/lance/src/io/exec/fts/match_query.rs:535 — rust/lance/src/io/exec/fts/match_query.rs:535-553 | rust/lance/src/io/exec/fts/phrase.rs:461-478 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 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/lance/src/io/exec/fts/match_query.rs:535` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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/lance/src/io/exec/fts/compound.rs:1017 — rust/lance/src/io/exec/fts/compound.rs:1017-1034 | rust/lance/src/io/exec/fts/compound.rs:1670-1688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/io/exec/fts/compound.rs:1017` it does not close everything it opens, so those 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) · ×4
  • Duplicated block (16–17 lines × 2) java/lance-jni/src/blocking_dataset/mutation.rs:39 — java/lance-jni/src/blocking_dataset/mutation.rs:39-54 | java/lance-jni/src/transaction.rs:2453-2469 — 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 `java/lance-jni/src/blocking_dataset/mutation.rs:39` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/reader/structural.rs:321 — rust/lance-file/src/reader/structural.rs:321-337 | rust/lance-file/src/versions/v2_0/reader.rs:262-277 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/reader/structural.rs:321` it begins part-way through the construct above it, so those exact lines 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/lance-namespace-impls/src/dir/manifest.rs:4060 — rust/lance-namespace-impls/src/dir/manifest.rs:4060-4076 | rust/lance-namespace-impls/src/dir/manifest.rs:4212-4227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:4060` it begins part-way through the construct above it, so those exact 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 (16–17 lines × 2) rust/lance/src/index/scalar/btree.rs:131 — rust/lance/src/index/scalar/btree.rs:131-146 | rust/lance/src/index/scalar/ngram.rs:48-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×4
  • Duplicated block (16 lines × 3) rust/lance-encoding/src/encodings/physical/alp.rs:743 — rust/lance-encoding/src/encodings/physical/alp.rs:743-758 | rust/lance-encoding/src/encodings/physical/alp.rs:844-859 | rust/lance-encoding/src/encodings/physical/alp.rs:864-879 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-encoding/src/encodings/physical/alp.rs:743` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/encodings/physical/alp.rs:975 — rust/lance-encoding/src/encodings/physical/alp.rs:975-990 | rust/lance-encoding/src/encodings/physical/alp.rs:1084-1099 | rust/lance-encoding/src/encodings/physical/alp.rs:1104-1119 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-encoding/src/encodings/physical/alp.rs:975` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/versions/v2_1/compression.rs:69 — rust/lance-file/src/versions/v2_1/compression.rs:69-84 | rust/lance-file/src/versions/v2_2/compression.rs:61-76 | rust/lance-file/src/versions/v2_3/compression.rs:84-99 — `rust/lance-file/src/versions/v2_1/compression.rs` and `rust/lance-file/src/versions/v2_2/compression.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/compression.rs:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) python/python/lance/dataset.py:4328 — python/python/lance/dataset.py:4328-4343 | python/python/lance/dataset.py:4475-4490 | python/python/lance/fragment.py:1791-1806 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×4
  • Duplicated block (10 lines × 4) rust/lance/src/dataset/write/delete.rs:56 — rust/lance/src/dataset/write/delete.rs:56-65 | rust/lance/src/dataset/write/merge_insert/exec.rs:86-95 | rust/lance/src/dataset/write/merge_insert/job.rs:1824-1833 | rust/lance/src/dataset/write/update.rs:829-838 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 4) rust/lance/src/dataset/write/delete.rs:87 — rust/lance/src/dataset/write/delete.rs:87-96 | rust/lance/src/dataset/write/merge_insert/exec.rs:117-126 | rust/lance/src/dataset/write/merge_insert/job.rs:1855-1864 | rust/lance/src/dataset/write/update.rs:860-869 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance/src/dataset/write/delete.rs:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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/lance/src/io/exec/fts/match_query.rs:533 — rust/lance/src/io/exec/fts/match_query.rs:533-542 | rust/lance/src/io/exec/fts/match_query.rs:555-564 | rust/lance/src/io/exec/fts/phrase.rs:459-468 | rust/lance/src/io/exec/fts/phrase.rs:479-488 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 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/lance/src/io/exec/fts/match_query.rs:533` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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/lance/src/io/exec/fts/match_query.rs:531` calls `clone` and `rust/lance/src/io/exec/fts/phrase.rs:457` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 4) rust/lance-index/src/scalar/bitmap.rs:2711 — rust/lance-index/src/scalar/bitmap.rs:2711-2720 | rust/lance-index/src/scalar/btree.rs:4401-4410 | rust/lance-index/src/scalar/label_list.rs:1159-1168 | rust/lance-index/src/scalar/ngram.rs:2164-2173 — before extracting anything, compare `rust/lance-index/src/scalar/bitmap.rs` and `rust/lance-index/src/scalar/btree.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/bitmap.rs:2711` it begins part-way through the construct above it, so those 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 · Transaction · ×3
  • Transaction::build_manifest_prepared (cyclomatic 200) rust/lance-table/src/transaction/manifest_build.rs:747 — Transaction::build_manifest_prepared has cyclomatic complexity 200 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Transaction::try_from (cyclomatic 35) rust/lance-table/src/transaction/proto.rs:88 — Transaction::try_from 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.
  • Transaction::withdraw_coverage (cyclomatic 18) rust/lance-table/src/transaction/index_maintenance.rs:379 — Transaction::withdraw_coverage 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 · FileFragment · ×3
  • FileFragment::scanner (cyclomatic 28) python/src/fragment.rs:302 — FileFragment::scanner 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.
  • FileFragment::validate (cyclomatic 24) rust/lance/src/dataset/fragment.rs:2112 — FileFragment::validate 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.
  • FileFragment::open (cyclomatic 17) rust/lance/src/dataset/fragment.rs:1362 — FileFragment::open 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 · lance_io · ×3
  • lance_io::local::remove_empty_dirs (cyclomatic 28) rust/lance-io/src/local.rs:81 — lance_io::local::remove_empty_dirs 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.
  • lance_io::uring::thread::run_uring_thread (cyclomatic 19) rust/lance-io/src/uring/thread.rs:185 — lance_io::uring::thread::run_uring_thread 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.
  • lance_io::object_store::throttle::error_document_code (cyclomatic 18) rust/lance-io/src/object_store/throttle.rs:830 — lance_io::object_store::throttle::error_document_code 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 · lance_file · ×3
  • lance_file::concat::validate_blob_field (cyclomatic 23) rust/lance-file/src/concat.rs:319 — lance_file::concat::validate_blob_field has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • lance_file::versions::v2_3::reader::validate_compressive_encoding (cyclomatic 23) rust/lance-file/src/versions/v2_3/reader.rs:59 — lance_file::versions::v2_3::reader::validate_compressive_encoding 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.
  • lance_file::concat::check_compatibility (cyclomatic 17) rust/lance-file/src/concat.rs:638 — lance_file::concat::check_compatibility 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 · Field · ×3
  • Field::project_by_field (cyclomatic 21) rust/lance-core/src/datatypes/field.rs:788 — Field::project_by_field 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.
  • Field::try_from (cyclomatic 19) rust/lance-core/src/datatypes/field.rs:1245 — Field::try_from 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.
  • Field::do_intersection (cyclomatic 17) rust/lance-core/src/datatypes/field.rs:913 — Field::do_intersection 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 · DecodeMiniBlockTask · ×3
  • DecodeMiniBlockTask::map_range (cognitive 128) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:552 — DecodeMiniBlockTask::map_range has cognitive complexity 128 (threshold 15). Drivers by points: if/else 33 (107 pts), loops 5 (19 pts), match/switch 1 (2 pts) (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • DecodeMiniBlockTask::decode (cognitive 44) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:938 — DecodeMiniBlockTask::decode has cognitive complexity 44 (threshold 15). Drivers by points: loops 7 (21 pts), if/else 11 (14 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • DecodeMiniBlockTask::decode_inline_bitpacking (cognitive 28) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:91 — DecodeMiniBlockTask::decode_inline_bitpacking has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (10 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobPreprocessor · ×3
  • BlobPreprocessor::logical_to_prepared_blob_array (cognitive 53) rust/lance/src/dataset/blob/write.rs:1198 — BlobPreprocessor::logical_to_prepared_blob_array has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 5, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BlobPreprocessor::preprocess_field (cognitive 24) rust/lance/src/dataset/blob/write.rs:949 — BlobPreprocessor::preprocess_field has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BlobPreprocessor::rewrite_sidecars (cognitive 20) rust/lance/src/dataset/blob/write.rs:702 — BlobPreprocessor::rewrite_sidecars has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Number · ×3
  • Number::cmp (cognitive 42) rust/lance-jsonb/src/number.rs:840 — Number::cmp has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (41 pts), match/switch 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.
  • Number::compact_encode (cognitive 25) rust/lance-jsonb/src/core/util.rs:293 — Number::compact_encode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, 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.
  • Number::rem (cognitive 19) rust/lance-jsonb/src/number.rs:543 — Number::rem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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 · Partition · ×3
  • Partition::maxscore_loop (cognitive 35) rust/lance/src/dataset/mem_wal/index/fts.rs:4775 — Partition::maxscore_loop has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 6 (11 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Partition::from_tail (cognitive 18) rust/lance/src/dataset/mem_wal/index/fts.rs:4512 — Partition::from_tail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Partition::search_phrase (cognitive 16) rust/lance/src/dataset/mem_wal/index/fts.rs:4843 — Partition::search_phrase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LsmFtsSearchPlanner · ×3
  • LsmFtsSearchPlanner::build_source_plan (cognitive 33) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1232 — LsmFtsSearchPlanner::build_source_plan has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 9 (13 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.
  • LsmFtsSearchPlanner::plan_bound_search (cognitive 23) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:914 — LsmFtsSearchPlanner::plan_bound_search has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, loops 3, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • LsmFtsSearchPlanner::resolve_column_index_contract (cognitive 21) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1098 — LsmFtsSearchPlanner::resolve_column_index_contract has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 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.
D2 · Cognitive Complexity · InvertedIndexBuilder · ×3
  • InvertedIndexBuilder::consolidate_updated_partitions (cognitive 31) rust/lance-index/src/scalar/inverted/builder.rs:925 — InvertedIndexBuilder::consolidate_updated_partitions has cognitive complexity 31 (threshold 15). Drivers by points: loops 8 (17 pts), if/else 6 (12 pts), match/switch 1 (2 pts) (nesting depth added 16). 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.
  • InvertedIndexBuilder::merge_existing_segments (cognitive 22) rust/lance-index/src/scalar/inverted/builder.rs:370 — InvertedIndexBuilder::merge_existing_segments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 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.
  • InvertedIndexBuilder::update_index (cognitive 16) rust/lance-index/src/scalar/inverted/builder.rs:476 — InvertedIndexBuilder::update_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 5 (6 pts), match/switch 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 · Selector · ×3
  • Selector::select_array_values_by_indices (cognitive 30) rust/lance-jsonb/src/jsonpath/selector.rs:498 — Selector::select_array_values_by_indices has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (9 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Selector::convert_expr_val (cognitive 27) rust/lance-jsonb/src/jsonpath/selector.rs:754 — Selector::convert_expr_val has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 4 (15 pts), loops 2 (7 pts), if/else 2 (5 pts) (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.
  • Selector::recursive_select_values (cognitive 25) rust/lance-jsonb/src/jsonpath/selector.rs:362 — Selector::recursive_select_values has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (12 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Field · ×3
  • Field::do_intersection (cognitive 29) rust/lance-core/src/datatypes/field.rs:913 — Field::do_intersection has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Field::project_by_field (cognitive 19) rust/lance-core/src/datatypes/field.rs:788 — Field::project_by_field has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Field::try_from (cognitive 16) rust/lance-core/src/datatypes/field.rs:1245 — Field::try_from has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3, 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 · MemTableBruteForceVectorExec · ×3
  • MemTableBruteForceVectorExec::compute_topk (cognitive 28) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:363 — MemTableBruteForceVectorExec::compute_topk has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), boolean chains 2, 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.
  • MemTableBruteForceVectorExec::materialize_rows (cognitive 19) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:471 — MemTableBruteForceVectorExec::materialize_rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (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.
  • MemTableBruteForceVectorExec::prefiltered_rows (cognitive 18) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:316 — MemTableBruteForceVectorExec::prefiltered_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FullSchemaMergeInsertExec · ×3
  • FullSchemaMergeInsertExec::split_updates_and_inserts (cognitive 24) rust/lance/src/dataset/write/merge_insert/exec/write.rs:867 — FullSchemaMergeInsertExec::split_updates_and_inserts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FullSchemaMergeInsertExec::process_and_split_batch (cognitive 19) rust/lance/src/dataset/write/merge_insert/exec/write.rs:999 — FullSchemaMergeInsertExec::process_and_split_batch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (3 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.
  • FullSchemaMergeInsertExec::execute (cognitive 16) rust/lance/src/dataset/write/merge_insert/exec/write.rs:1213 — FullSchemaMergeInsertExec::execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RowIdIndex · ×3
  • RowIdIndex::probe (cognitive 23) rust/lance-table/src/rowids/index.rs:611 — RowIdIndex::probe has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RowIdIndex::get_many (cognitive 22) rust/lance-table/src/rowids/index.rs:559 — RowIdIndex::get_many has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RowIdIndex::reuse_merged (cognitive 18) rust/lance-table/src/rowids/index.rs:416 — RowIdIndex::reuse_merged has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LsmPointLookupPlanner · ×3
  • LsmPointLookupPlanner::lookup_many_on_disk (cognitive 17) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:676 — LsmPointLookupPlanner::lookup_many_on_disk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LsmPointLookupPlanner::lookup_many_keep_tombstone (cognitive 16) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:379 — LsmPointLookupPlanner::lookup_many_keep_tombstone has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LsmPointLookupPlanner::lookup (cognitive 16) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:447 — LsmPointLookupPlanner::lookup has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (7 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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFields · ×3
  • TooManyFields: RabitScanStats rust/lance-index/src/vector/bq/scan_stats.rs:153 — TooManyFields — 101 stored fields. The bar is 30 stored fields; this is 71 over it, 3.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Scanner rust/lance/src/dataset/scanner.rs:494 — TooManyFields — 45 stored fields beside 177 methods. The bar is 30 stored fields; this is 15 over it, 1.50× 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: Wand rust/lance-index/src/scalar/inverted/wand.rs:266 — TooManyFields — 32 stored fields beside 55 methods. The bar is 30 stored fields; this is 2 over it, 1.07× 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.
D3 · God Classes · TooManyFunctions · ×3
  • TooManyFunctions: lance_index::vector::bq::ex_dot::x86 rust/lance-index/src/vector/bq/ex_dot.rs:597 — TooManyFunctions — 72 free functions. The bar is 30 free functions; this is 42 over it, 2.40× 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: lance_jni::blocking_dataset::refs java/lance-jni/src/blocking_dataset/refs.rs:110 — TooManyFunctions — 36 free functions. The bar is 30 free functions; 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.
  • TooManyFunctions: lance_index::vector::bq::ex_dot::neon rust/lance-index/src/vector/bq/ex_dot.rs:1404 — TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D35 · Change Coupling · Change-coupling hub · ×3
  • Change-coupling hub: bitmap.rs → basic.rs, fixed_size_list.rs, encoder.rs, list.rs, value.rs rust/lance-encoding/src/array_encoding/physical/bitmap.rs — `rust/lance-encoding/src/array_encoding/physical/bitmap.rs` changes together with 5 other files — `rust/lance-encoding/src/array_encoding/physical/basic.rs`, `rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs`, `rust/lance-encoding/src/encoder.rs`, `rust/lance-encoding/src/encodings/logical/list.rs`, `rust/lance-encoding/src/encodings/physical/value.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
  • Change-coupling hub: basic.rs → fixed_size_list.rs, list.rs, value.rs rust/lance-encoding/src/array_encoding/physical/basic.rs — `rust/lance-encoding/src/array_encoding/physical/basic.rs` changes together with 3 other files — `rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs`, `rust/lance-encoding/src/encodings/logical/list.rs`, `rust/lance-encoding/src/encodings/physical/value.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.
  • Change-coupling hub: write.rs → graph.rs, index.rs, hnsw.rs rust/lance/src/dataset/mem_wal/write.rs — `rust/lance/src/dataset/mem_wal/write.rs` changes together with 3 other files — `rust/lance/src/dataset/mem_wal/hnsw/graph.rs`, `rust/lance/src/dataset/mem_wal/index.rs`, `rust/lance/src/dataset/mem_wal/index/hnsw.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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rust/lance-index/src/vector/ivf.rs:156 — rust/lance-index/src/vector/ivf.rs:156-177 | rust/lance-index/src/vector/ivf.rs:184-219 | rust/lance-index/src/vector/ivf.rs:228-270 | rust/lance-index/src/vector/ivf.rs:278-313 | rust/lance-index/src/vector/ivf.rs:322-366 — 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) python/python/lance/_dataset/scanner.py:1077 — python/python/lance/_dataset/scanner.py:1077-1206 | python/python/lance/dataset.py:4113-4356 | python/python/lance/dataset.py:4393-4503 | python/python/lance/dataset.py:5524-5592 | python/python/lance/fragment.py:1612-1812 — 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) python/python/lance/dataset.py:1041 — python/python/lance/dataset.py:1041-1180 | python/python/lance/dataset.py:1210-1249 | python/python/lance/dataset.py:1648-1683 | python/python/lance/fragment.py:746-764 | python/python/lance/fragment.py:786-802 — 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 (43 corresponding lines) · ×3
  • Edited copy of a member (43 corresponding lines) rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:103 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:103-145 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:148-190 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) rust/lance-index/src/scalar/inverted/wand/posting.rs:1093 — rust/lance-index/src/scalar/inverted/wand/posting.rs:1093-1135 | rust/lance-index/src/scalar/inverted/wand/posting.rs:1139-1193 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:890 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:890-936 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:979-1021 — 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 (54 corresponding lines) · ×3
  • Edited copy of a member (54 corresponding lines) rust/lance-index/src/scalar/inverted.rs:159 — rust/lance-index/src/scalar/inverted.rs:159-217 | rust/lance-index/src/scalar/inverted/index/search.rs:423-476 — 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) java/lance-jni/src/namespace.rs:225 — java/lance-jni/src/namespace.rs:225-283 | java/lance-jni/src/namespace.rs:286-339 — 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/lance-namespace-impls/src/credentials/azure.rs:834 — rust/lance-namespace-impls/src/credentials/azure.rs:834-890 | rust/lance-namespace-impls/src/credentials/gcp.rs:887-940 — 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 (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) rust/lance-file/src/versions/v2_0/writer.rs:237 — rust/lance-file/src/versions/v2_0/writer.rs:237-273 | rust/lance-file/src/writer/structural.rs:205-241 — 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/lance-encoding/src/encodings/physical/fsst.rs:217 — rust/lance-encoding/src/encodings/physical/fsst.rs:217-276 | rust/lance-encoding/src/encodings/physical/fsst.rs:326-362 — 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/lance/src/index/vector/ivf/builder.rs:61 — rust/lance/src/index/vector/ivf/builder.rs:61-97 | rust/lance/src/index/vector/ivf/builder.rs:264-310 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×3
  • Edited copy of a member (41 corresponding lines) rust/lance-file/src/versions/v1/writer/mod.rs:497 — rust/lance-file/src/versions/v1/writer/mod.rs:497-537 | rust/lance-file/src/versions/v1/writer/mod.rs:545-586 — 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) java/src/main/java/org/lance/ipc/AsyncScanner.java:62 — java/src/main/java/org/lance/ipc/AsyncScanner.java:62-102 | java/src/main/java/org/lance/ipc/LanceScanner.java:58-101 — 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/lance-index/src/vector/hnsw/builder.rs:351 — rust/lance-index/src/vector/hnsw/builder.rs:351-396 | rust/lance-index/src/vector/hnsw/builder.rs:544-584 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 31+ corresponding lines) rust/lance-linalg/src/simd/dist_table.rs:240 — rust/lance-linalg/src/simd/dist_table.rs:240-272 | rust/lance-linalg/src/simd/dist_table.rs:454-490 | rust/lance-linalg/src/simd/dist_table.rs:499-529 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 31+ corresponding lines) rust/lance-jsonb/src/jsonpath/selector.rs:330 — rust/lance-jsonb/src/jsonpath/selector.rs:330-360 | rust/lance-jsonb/src/jsonpath/selector.rs:465-496 | rust/lance-jsonb/src/jsonpath/selector.rs:502-540 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 31+ corresponding lines) rust/lance-file/src/reader.rs:1572 — rust/lance-file/src/reader.rs:1572-1602 | rust/lance-file/src/reader.rs:1610-1642 | rust/lance-file/src/reader.rs:1650-1682 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 19+ corresponding lines) rust/lance-index/src/scalar/fmindex.rs:840 — rust/lance-index/src/scalar/fmindex.rs:840-858 | rust/lance-index/src/scalar/fmindex.rs:861-879 | rust/lance-index/src/scalar/fmindex.rs:881-902 — 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/lance-table/src/rowids/encoded_array.rs:89 — rust/lance-table/src/rowids/encoded_array.rs:89-107 | rust/lance-table/src/rowids/encoded_array.rs:109-127 | rust/lance-table/src/rowids/encoded_array.rs:129-147 — 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/lance/src/index/vector/ivf/partition_serde.rs:298 — rust/lance/src/index/vector/ivf/partition_serde.rs:298-317 | rust/lance/src/index/vector/ivf/partition_serde.rs:342-361 | rust/lance/src/index/vector/ivf/partition_serde.rs:390-408 — 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, 16+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 16+ corresponding lines) rust/lance-index/src/vector/bq/dist_table_quant.rs:397 — rust/lance-index/src/vector/bq/dist_table_quant.rs:397-414 | rust/lance-index/src/vector/bq/dist_table_quant.rs:432-447 | rust/lance-index/src/vector/bq/dist_table_quant.rs:525-546 — 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) java/src/main/java/org/lance/Dataset.java:876 — java/src/main/java/org/lance/Dataset.java:876-891 | java/src/main/java/org/lance/Dataset.java:903-920 | java/src/main/java/org/lance/Dataset.java:985-1003 — 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/lance-linalg/src/simd/u8.rs:198 — rust/lance-linalg/src/simd/u8.rs:198-213 | rust/lance-linalg/src/simd/u8.rs:319-334 | rust/lance-linalg/src/simd/u8.rs:401-416 — 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, 13+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 13+ corresponding lines) java/lance-jni/src/namespace.rs:3460 — java/lance-jni/src/namespace.rs:3460-3472 | java/lance-jni/src/namespace.rs:3544-3559 | java/lance-jni/src/namespace.rs:3589-3601 | java/lance-jni/src/namespace.rs:3673-3688 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 13+ corresponding lines) python/src/dataset/merge_insert.rs:192 — python/src/dataset/merge_insert.rs:192-210 | python/src/dataset/merge_insert.rs:239-252 | python/src/dataset/merge_insert.rs:254-266 | python/src/dataset/merge_insert.rs:273-293 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 13+ corresponding lines) rust/lance-datagen/src/generator.rs:2540 — rust/lance-datagen/src/generator.rs:2540-2557 | rust/lance-datagen/src/generator.rs:2582-2599 | rust/lance-datagen/src/generator.rs:2616-2633 | rust/lance-datagen/src/generator.rs:2701-2713 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 7+ corresponding lines) python/src/namespace.rs:515 — python/src/namespace.rs:515-521 | python/src/namespace.rs:579-585 | python/src/namespace.rs:1262-1268 | python/src/namespace.rs:1326-1332 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 7+ corresponding lines) python/src/dataset.rs:2058 — python/src/dataset.rs:2058-2064 | python/src/dataset.rs:2067-2073 | python/src/dataset.rs:3212-3218 | python/src/dataset.rs:3496-3503 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 7+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:44 — rust/lance-linalg/src/simd/f32.rs:44-50 | rust/lance-linalg/src/simd/f64.rs:42-48 | rust/lance-linalg/src/simd/i32.rs:47-53 | rust/lance-linalg/src/simd/u8.rs:77-83 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 8+ corresponding lines) rust/lance-index/src/vector/bq/ex_dot.rs:685 — rust/lance-index/src/vector/bq/ex_dot.rs:685-692 | rust/lance-index/src/vector/bq/ex_dot.rs:751-758 | rust/lance-index/src/vector/bq/ex_dot.rs:1453-1460 | rust/lance-index/src/vector/bq/ex_dot.rs:1516-1523 — 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) java/src/main/java/org/lance/Dataset.java:2551 — java/src/main/java/org/lance/Dataset.java:2551-2558 | java/src/main/java/org/lance/Dataset.java:2605-2612 | java/src/main/java/org/lance/Dataset.java:2614-2621 | java/src/main/java/org/lance/Dataset.java:2677-2684 — 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/lance-linalg/src/simd/f32.rs:164 — rust/lance-linalg/src/simd/f32.rs:164-171 | rust/lance-linalg/src/simd/f64.rs:57-64 | rust/lance-linalg/src/simd/i32.rs:62-69 | rust/lance-linalg/src/simd/u8.rs:92-99 — 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 · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) rust/compression/fsst/src/fsst.rs:1134 — rust/compression/fsst/src/fsst.rs:1134-1160 | rust/compression/fsst/src/fsst.rs:1179-1205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/compression/fsst/src/fsst.rs:1134` it begins part-way through the construct above it, so those exact lines 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/lance-encoding/src/utils/accumulation.rs:113 — rust/lance-encoding/src/utils/accumulation.rs:113-139 | rust/lance-encoding/src/utils/accumulation.rs:187-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (27 lines × 2) rust/lance-file/src/versions/v1/writer/statistics.rs:344 — rust/lance-file/src/versions/v1/writer/statistics.rs:344-370 | rust/lance-file/src/versions/v1/writer/statistics.rs:418-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v1/writer/statistics.rs:344` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (20–23 lines × 2) · ×3
  • Duplicated block (20–23 lines × 2) rust/lance-table/src/io/commit/external_manifest.rs:81 — rust/lance-table/src/io/commit/external_manifest.rs:81-103 | rust/lance-table/src/io/commit/external_manifest.rs:691-710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-table/src/io/commit/external_manifest.rs:81` it begins part-way through the construct above it, so those exact lines 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–23 lines × 2) rust/lance/src/dataset/index/frag_reuse.rs:190 — rust/lance/src/dataset/index/frag_reuse.rs:190-212 | rust/lance/src/dataset/index/frag_reuse.rs:231-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/index/frag_reuse.rs:190` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20–23 lines × 2) rust/lance/src/dataset/mem_wal/memtable/flush.rs:372 — rust/lance/src/dataset/mem_wal/memtable/flush.rs:372-391 | rust/lance/src/dataset/mem_wal/memtable/flush.rs:667-689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/memtable/flush.rs:372` it does not close everything it opens, so those 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/lance/src/dataset/mem_wal/memtable/flush.rs:369` calls `create_pk_index`, `indexes`, `path_to_uri` and `rust/lance/src/dataset/mem_wal/memtable/flush.rs:667` 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 (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) rust/lance-file/src/versions/v2_1/compression.rs:56 — rust/lance-file/src/versions/v2_1/compression.rs:56-77 | rust/lance-file/src/versions/v2_2/compression.rs:48-69 — `rust/lance-file/src/versions/v2_1/compression.rs` and `rust/lance-file/src/versions/v2_2/compression.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/compression.rs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) rust/lance-file/src/versions/v2_1/reader.rs:116 — rust/lance-file/src/versions/v2_1/reader.rs:116-137 | rust/lance-file/src/versions/v2_2/reader.rs:122-143 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/reader.rs:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) rust/lance/src/io/exec/fts/segments.rs:241 — rust/lance/src/io/exec/fts/segments.rs:241-262 | rust/lance/src/io/exec/fts/segments.rs:312-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/io/exec/fts/segments.rs:241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×3
  • Duplicated block (20–21 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:558 — rust/lance-encoding/src/encodings/physical/alp.rs:558-578 | rust/lance-encoding/src/encodings/physical/alp.rs:1608-1627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:558` it begins part-way through the construct above it, so those exact lines 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–21 lines × 2) rust/lance-index/src/vector/hnsw/remap.rs:213 — rust/lance-index/src/vector/hnsw/remap.rs:213-233 | rust/lance-index/src/vector/hnsw/remap.rs:681-700 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/hnsw/remap.rs:213` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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–21 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1335 — rust/lance-index/src/vector/distributed/index_merger.rs:1335-1354 | rust/lance-index/src/vector/distributed/index_merger.rs:1367-1387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/distributed/index_merger.rs:1335` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×3
  • Duplicated block (19 lines × 3) java/lance-jni/src/namespace.rs:523 — java/lance-jni/src/namespace.rs:523-541 | java/lance-jni/src/namespace.rs:606-624 | java/lance-jni/src/namespace.rs:788-806 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/namespace.rs:523` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 3) rust/lance-file/src/versions/v2_1/writer.rs:210 — rust/lance-file/src/versions/v2_1/writer.rs:210-228 | rust/lance-file/src/versions/v2_2/writer.rs:210-228 | rust/lance-file/src/versions/v2_3/writer.rs:210-228 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 3) rust/lance-index/src/vector/ivf.rs:192 — rust/lance-index/src/vector/ivf.rs:192-210 | rust/lance-index/src/vector/ivf.rs:236-254 | rust/lance-index/src/vector/ivf.rs:286-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/ivf.rs:192` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) java/lance-jni/src/fragment.rs:486 — java/lance-jni/src/fragment.rs:486-503 | java/lance-jni/src/fragment.rs:546-562 — both copies are in the same file, so extract the 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–18 lines × 2) rust/lance-table/src/io/commit/dynamodb.rs:378 — rust/lance-table/src/io/commit/dynamodb.rs:378-394 | rust/lance-table/src/io/commit/dynamodb.rs:411-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (17–18 lines × 2) rust/lance/src/dataset/scanner/fts.rs:1796 — rust/lance/src/dataset/scanner/fts.rs:1796-1812 | rust/lance/src/dataset/scanner/fts.rs:2153-2170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/scanner/fts.rs:1796` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×3
  • Duplicated block (11–14 lines × 2) rust/lance-index/src/vector/flat/index.rs:176 — rust/lance-index/src/vector/flat/index.rs:176-189 | rust/lance-index/src/vector/flat/index.rs:327-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/flat/index.rs:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–14 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:633 — rust/lance-linalg/src/simd/dist_table.rs:633-643 | rust/lance-linalg/src/simd/dist_table.rs:736-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-linalg/src/simd/dist_table.rs:633` it begins part-way through the construct above it, so those 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/lance-linalg/src/simd/dist_table.rs:750` calls `_mm256_storeu_si256`, `as_mut_ptr` and `rust/lance-linalg/src/simd/dist_table.rs:644` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–14 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2440 — rust/lance-namespace-impls/src/dir/manifest.rs:2440-2453 | rust/lance-namespace-impls/src/dir/manifest.rs:3982-3992 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×3
  • Duplicated block (12 lines × 4) rust/lance-index/src/vector/ivf.rs:157 — rust/lance-index/src/vector/ivf.rs:157-168 | rust/lance-index/src/vector/ivf.rs:229-240 | rust/lance-index/src/vector/ivf.rs:279-290 | rust/lance-index/src/vector/ivf.rs:323-334 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) rust/lance-namespace/src/schema.rs:119 — rust/lance-namespace/src/schema.rs:119-130 | rust/lance-namespace/src/schema.rs:137-148 | rust/lance-namespace/src/schema.rs:155-166 | rust/lance-namespace/src/schema.rs:199-210 — 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/lance-namespace/src/schema.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 (12 lines × 4) rust/lance/src/dataset/mem_wal/scanner/builder.rs:664 — rust/lance/src/dataset/mem_wal/scanner/builder.rs:664-675 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:729-740 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:775-786 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:803-814 — 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 (10–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) java/lance-jni/src/mem_wal.rs:911 — java/lance-jni/src/mem_wal.rs:911-920 | python/src/mem_wal.rs:835-846 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `java/lance-jni/src/mem_wal.rs:911` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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–12 lines × 2) python/src/dataset.rs:2001 — python/src/dataset.rs:2001-2012 | python/src/dataset.rs:2035-2044 — both copies are in the same file, so extract the 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–12 lines × 2) rust/lance-index/src/scalar/ngram.rs:1823 — rust/lance-index/src/scalar/ngram.rs:1823-1834 | rust/lance-index/src/scalar/ngram.rs:1940-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/lance-index/src/scalar/ngram.rs:1823` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 × 4) · ×3
  • Duplicated block (11 lines × 4) rust/lance-encoding/src/encodings/physical/alp.rs:833 — rust/lance-encoding/src/encodings/physical/alp.rs:833-843 | rust/lance-encoding/src/encodings/physical/alp.rs:906-916 | rust/lance-encoding/src/encodings/physical/alp.rs:1073-1083 | rust/lance-encoding/src/encodings/physical/alp.rs:1146-1156 — 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/lance-encoding/src/encodings/physical/alp.rs:833` it begins part-way through the construct above it, so those exact lines 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/lance-file/src/versions/v2_0/reader.rs:138 — rust/lance-file/src/versions/v2_0/reader.rs:138-148 | rust/lance-file/src/versions/v2_1/reader.rs:184-194 | rust/lance-file/src/versions/v2_2/reader.rs:186-196 | rust/lance-file/src/versions/v2_3/reader.rs:349-359 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 4) rust/lance-file/src/versions/v2_0/reader.rs:361 — rust/lance-file/src/versions/v2_0/reader.rs:361-371 | rust/lance-file/src/versions/v2_1/reader.rs:227-237 | rust/lance-file/src/versions/v2_2/reader.rs:229-239 | rust/lance-file/src/versions/v2_3/reader.rs:392-402 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_0/reader.rs:361` it does not close everything it opens, so those 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/lance-file/src/versions/v2_1/reader.rs:226` calls `validate_global_buffers` and `rust/lance-file/src/versions/v2_0/reader.rs:360` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×3
  • Duplicated block (9–11 lines × 2) rust/lance-file/src/versions/v1/writer/statistics.rs:249 — rust/lance-file/src/versions/v1/writer/statistics.rs:249-257 | rust/lance-file/src/versions/v1/writer/statistics.rs:324-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v1/writer/statistics.rs:249` it does not close everything it opens, so those exact lines 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–11 lines × 2) rust/lance/src/io/exec/fts/match_query.rs:711 — rust/lance/src/io/exec/fts/match_query.rs:711-721 | rust/lance/src/io/exec/fts/phrase.rs:614-622 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 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/lance/src/io/exec/fts/match_query.rs:711` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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–11 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:169 — rust/lance-index/src/scalar/bloomfilter.rs:169-179 | rust/lance-index/src/scalar/zonemap.rs:876-884 — before extracting anything, compare `rust/lance-index/src/scalar/bloomfilter.rs` and `rust/lance-index/src/scalar/zonemap.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×3
  • Duplicated block (8–10 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:477 — rust/lance-file/src/versions/v2_0/writer.rs:477-486 | rust/lance-file/src/versions/v2_0/writer.rs:574-581 — both copies are in the same file, so extract the 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–10 lines × 2) rust/lance-index/src/scalar/json.rs:923 — rust/lance-index/src/scalar/json.rs:923-930 | rust/lance-index/src/scalar/json.rs:1053-1062 — both copies are in the same file, so extract the 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–10 lines × 2) java/src/main/java/org/lance/ipc/FullTextQuery.java:383 — java/src/main/java/org/lance/ipc/FullTextQuery.java:383-390 | java/src/main/java/org/lance/ipc/FullTextQuery.java:476-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
P1 · CI/CD gates · CI formatting step cannot fail · ×3
  • CI formatting step cannot fail REDACTED:138 — `8. Run "cargo fmt --all" to ensure formatting is correct.` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
  • CI formatting step cannot fail REDACTED:139 — `- For formatting issues: Run "cargo fmt --all"` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
  • CI formatting step cannot fail REDACTED:143 — `- Run "cargo fmt --all" to ensure formatting is correct` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
D1 · Cyclomatic Complexity · lance_datafusion_exec · ×2
  • lance_datafusion_exec::expr::safe_coerce_scalar (cyclomatic 211) rust/lance-datafusion-exec/src/expr.rs:112 — lance_datafusion_exec::expr::safe_coerce_scalar has cyclomatic complexity 211 (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.
  • lance_datafusion_exec::exec::collect_execution_metrics (cyclomatic 18) rust/lance-datafusion-exec/src/exec.rs:772 — lance_datafusion_exec::exec::collect_execution_metrics has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · CreateIndexBuilder · ×2
  • CreateIndexBuilder::execute_uncommitted_impl (cyclomatic 49) rust/lance/src/index/create.rs:221 — CreateIndexBuilder::execute_uncommitted_impl 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.
  • CreateIndexBuilder::execute_multi_segment_fmindex (cyclomatic 18) rust/lance/src/index/create.rs:823 — CreateIndexBuilder::execute_multi_segment_fmindex has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DefaultCompactionPlanner · ×2
  • DefaultCompactionPlanner::plan_groups_with_budget (cyclomatic 39) rust/lance/src/dataset/optimize/planning.rs:954 — DefaultCompactionPlanner::plan_groups_with_budget has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • DefaultCompactionPlanner::plan_with_budget (cyclomatic 25) rust/lance/src/dataset/optimize/planning.rs:1385 — DefaultCompactionPlanner::plan_with_budget has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Number · ×2
  • Number::cmp (cyclomatic 39) rust/lance-jsonb/src/number.rs:840 — Number::cmp has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Number::compact_encode (cyclomatic 20) rust/lance-jsonb/src/core/util.rs:293 — Number::compact_encode has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Number::decode (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 · DecodeMiniBlockTask · ×2
  • DecodeMiniBlockTask::map_range (cyclomatic 35) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:552 — DecodeMiniBlockTask::map_range 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.
  • DecodeMiniBlockTask::decode (cyclomatic 28) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:938 — DecodeMiniBlockTask::decode 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.
D1 · Cyclomatic Complexity · fsst · ×2
  • fsst::fsst::build_symbol_table (cyclomatic 29) rust/compression/fsst/src/fsst.rs:628 — fsst::fsst::build_symbol_table 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.
  • fsst::fsst::decompress_bulk (cyclomatic 20) rust/compression/fsst/src/fsst.rs:1064 — fsst::fsst::decompress_bulk 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 · RawJsonb · ×2
  • RawJsonb::serialize (cyclomatic 29) rust/lance-jsonb/src/core/ser.rs:25 — RawJsonb::serialize 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.
  • RawJsonb::partial_cmp (cyclomatic 17) rust/lance-jsonb/src/raw.rs:162 — RawJsonb::partial_cmp has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LsmVectorSearchPlanner · ×2
  • LsmVectorSearchPlanner::build_knn_plan (cyclomatic 28) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:605 — LsmVectorSearchPlanner::build_knn_plan 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.
  • LsmVectorSearchPlanner::plan_search_with_probe_bounds (cyclomatic 17) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:385 — LsmVectorSearchPlanner::plan_search_with_probe_bounds 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 · SerializerContext · ×2
  • SerializerContext::normalize_specials_and_plan_splits (cyclomatic 28) rust/lance-encoding/src/repdef.rs:1271 — SerializerContext::normalize_specials_and_plan_splits 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.
  • SerializerContext::record_offsets (cyclomatic 18) rust/lance-encoding/src/repdef.rs:1046 — SerializerContext::record_offsets 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 · PyLance · ×2
  • PyLance::into_pyobject (cyclomatic 27) python/src/transaction.rs:1005 — PyLance::into_pyobject 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.
  • PyLance::extract (cyclomatic 22) python/src/transaction.rs:731 — PyLance::extract has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PlanarSparseScheduler · ×2
  • PlanarSparseScheduler::try_new (cyclomatic 26) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:505 — PlanarSparseScheduler::try_new has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PlanarSparseScheduler::init_from_buffers (cyclomatic 22) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:721 — PlanarSparseScheduler::init_from_buffers 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 · BlobPreprocessor · ×2
  • BlobPreprocessor::logical_to_prepared_blob_array (cyclomatic 25) rust/lance/src/dataset/blob/write.rs:1198 — BlobPreprocessor::logical_to_prepared_blob_array 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.
  • BlobPreprocessor::preprocess_field (cyclomatic 17) rust/lance/src/dataset/blob/write.rs:949 — BlobPreprocessor::preprocess_field 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 · FilteredReadExec · ×2
  • FilteredReadExec::try_new_row_stream (cyclomatic 21) rust/lance/src/io/exec/filtered_read.rs:2581 — FilteredReadExec::try_new_row_stream 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.
  • FilteredReadExec::statistics_from_inputs (cyclomatic 17) rust/lance/src/io/exec/filtered_read.rs:3818 — FilteredReadExec::statistics_from_inputs 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 · ManifestNamespace · ×2
  • ManifestNamespace::create_table (cyclomatic 21) rust/lance-namespace-impls/src/dir/manifest.rs:3398 — ManifestNamespace::create_table 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.
  • ManifestNamespace::rewrite_manifest (cyclomatic 17) rust/lance-namespace-impls/src/dir/manifest.rs:2226 — ManifestNamespace::rewrite_manifest 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 · LsmFtsSearchPlanner · ×2
  • LsmFtsSearchPlanner::build_source_plan (cyclomatic 20) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1232 — LsmFtsSearchPlanner::build_source_plan 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.
  • LsmFtsSearchPlanner::plan_bound_search (cyclomatic 19) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:914 — LsmFtsSearchPlanner::plan_bound_search 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 · FragmentScanner · ×2
  • FragmentScanner::read_batch (cyclomatic 17) rust/lance/src/io/exec/pushdown_scan.rs:401 — FragmentScanner::read_batch 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.
  • FragmentScanner::extract_guarantees (cyclomatic 17) rust/lance/src/io/exec/pushdown_scan.rs:589 — FragmentScanner::extract_guarantees 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.
D17 · Explicit Debt · HackComment · ×2
  • HackComment rust/lance-datafusion/src/sql.rs:100 — // Hack to allow == as equals — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment python/python/lance/vector.py:773 — # Hack for Windows due to — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · Parser · ×2
  • Parser::parse_json_number (cognitive 96) rust/lance-jsonb/src/parser.rs:410 — Parser::parse_json_number has cognitive complexity 96 (threshold 15). Drivers by points: if/else 40 (84 pts), boolean chains 6, match/switch 2 (4 pts), loops 2 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Parser::parse_quoted_string (cognitive 17) rust/lance-jsonb/src/parser.rs:661 — Parser::parse_quoted_string has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 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 · CreateIndexBuilder · ×2
  • CreateIndexBuilder::execute_uncommitted_impl (cognitive 85) rust/lance/src/index/create.rs:221 — CreateIndexBuilder::execute_uncommitted_impl has cognitive complexity 85 (threshold 15). Drivers by points: if/else 47 (70 pts), boolean chains 8, match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CreateIndexBuilder::execute_multi_segment_fmindex (cognitive 25) rust/lance/src/index/create.rs:823 — CreateIndexBuilder::execute_multi_segment_fmindex has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Branches · ×2
  • Branches::cleanup_branch_directories (cognitive 75) rust/lance/src/dataset/refs.rs:654 — Branches::cleanup_branch_directories has cognitive complexity 75 (threshold 15). Drivers by points: if/else 22 (49 pts), match/switch 7 (16 pts), loops 3 (6 pts), boolean chains 4 (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.
  • Branches::collect_local_owned_directories (cognitive 23) rust/lance/src/dataset/refs.rs:875 — Branches::collect_local_owned_directories has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lance_datafusion_exec · ×2
  • lance_datafusion_exec::expr::safe_coerce_scalar (cognitive 71) rust/lance-datafusion-exec/src/expr.rs:112 — lance_datafusion_exec::expr::safe_coerce_scalar has cognitive complexity 71 (threshold 15). Drivers by points: match/switch 36 (55 pts), if/else 8 (16 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.
  • lance_datafusion_exec::exec::collect_execution_metrics (cognitive 21) rust/lance-datafusion-exec/src/exec.rs:772 — lance_datafusion_exec::exec::collect_execution_metrics has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 3 (6 pts), match/switch 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 · DefaultCompactionPlanner · ×2
  • DefaultCompactionPlanner::plan_groups_with_budget (cognitive 70) rust/lance/src/dataset/optimize/planning.rs:954 — DefaultCompactionPlanner::plan_groups_with_budget has cognitive complexity 70 (threshold 15). Drivers by points: if/else 23 (42 pts), loops 10 (20 pts), boolean chains 8 (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.
  • DefaultCompactionPlanner::plan_with_budget (cognitive 33) rust/lance/src/dataset/optimize/planning.rs:1385 — DefaultCompactionPlanner::plan_with_budget has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, loops 4 (6 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactRowAddrRemap · ×2
  • CompactRowAddrRemap::remap_in_place_by_fragment (cognitive 60) rust/lance-core/src/utils/row_addr_remap.rs:956 — CompactRowAddrRemap::remap_in_place_by_fragment has cognitive complexity 60 (threshold 15). Drivers by points: if/else 8 (32 pts), loops 6 (25 pts), match/switch 1 (3 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CompactRowAddrRemap::get_by_fragment (cognitive 19) rust/lance-core/src/utils/row_addr_remap.rs:890 — CompactRowAddrRemap::get_by_fragment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LsmVectorSearchPlanner · ×2
  • LsmVectorSearchPlanner::build_knn_plan (cognitive 51) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:605 — LsmVectorSearchPlanner::build_knn_plan has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (35 pts), match/switch 8 (15 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.
  • LsmVectorSearchPlanner::plan_search_with_probe_bounds (cognitive 22) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:385 — LsmVectorSearchPlanner::plan_search_with_probe_bounds has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · fsst · ×2
  • fsst::fsst::build_symbol_table (cognitive 50) rust/compression/fsst/src/fsst.rs:628 — fsst::fsst::build_symbol_table has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 11 (15 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.
  • fsst::fsst::decompress_bulk (cognitive 38) rust/compression/fsst/src/fsst.rs:1064 — fsst::fsst::decompress_bulk has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 5 (9 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · U64Segment · ×2
  • U64Segment::with_new_high (cognitive 38) rust/lance-table/src/rowids/segment.rs:609 — U64Segment::with_new_high has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • U64Segment::from_stats_and_sequence (cognitive 17) rust/lance-table/src/rowids/segment.rs:197 — U64Segment::from_stats_and_sequence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatasetBuilder · ×2
  • DatasetBuilder::load_impl (cognitive 37) rust/lance/src/dataset/builder.rs:692 — DatasetBuilder::load_impl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 8, match/switch 4 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DatasetBuilder::load_by_uri (cognitive 17) rust/lance/src/dataset/builder.rs:876 — DatasetBuilder::load_by_uri has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SerializerContext · ×2
  • SerializerContext::record_offsets (cognitive 35) rust/lance-encoding/src/repdef.rs:1046 — SerializerContext::record_offsets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SerializerContext::normalize_specials_and_plan_splits (cognitive 34) rust/lance-encoding/src/repdef.rs:1271 — SerializerContext::normalize_specials_and_plan_splits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FilteredReadExec · ×2
  • FilteredReadExec::statistics_from_inputs (cognitive 34) rust/lance/src/io/exec/filtered_read.rs:3818 — FilteredReadExec::statistics_from_inputs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (29 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FilteredReadExec::try_new_row_stream (cognitive 24) rust/lance/src/io/exec/filtered_read.rs:2581 — FilteredReadExec::try_new_row_stream has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FragmentReuseIndex · ×2
  • FragmentReuseIndex::remap_row_ids_excluding (cognitive 33) rust/lance/src/index/frag_reuse_reader.rs:426 — FragmentReuseIndex::remap_row_ids_excluding has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 4 (8 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.
  • FragmentReuseIndex::segment_plans (cognitive 28) rust/lance/src/index/frag_reuse_reader.rs:272 — FragmentReuseIndex::segment_plans has cognitive complexity 28 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 3 (8 pts), match/switch 2 (5 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ObjectStore · ×2
  • ObjectStore::read_local_staging_files (cognitive 33) rust/lance-io/src/object_store/local_staging.rs:97 — ObjectStore::read_local_staging_files has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 6 (13 pts), boolean chains 3, 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.
  • ObjectStore::copy_via_stream_inner (cognitive 18) rust/lance-io/src/object_store.rs:1695 — ObjectStore::copy_via_stream_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopKLateMaterialization · ×2
  • TopKLateMaterialization::rewrite (cognitive 32) rust/lance/src/io/exec/topk_late_materialization.rs:145 — TopKLateMaterialization::rewrite has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3, loops 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TopKLateMaterialization::check_pass_through (cognitive 17) rust/lance/src/io/exec/topk_late_materialization.rs:278 — TopKLateMaterialization::check_pass_through has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Schema · ×2
  • Schema::do_project (cognitive 32) rust/lance-core/src/datatypes/schema.rs:267 — Schema::do_project has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 2, loops 2, 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.
  • Schema::validate (cognitive 17) rust/lance-core/src/datatypes/schema.rs:370 — Schema::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoreFieldDecoderStrategy · ×2
  • CoreFieldDecoderStrategy::create_array_field_scheduler (cognitive 32) rust/lance-encoding/src/decoder.rs:1078 — CoreFieldDecoderStrategy::create_array_field_scheduler has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 1 (3 pts), boolean chains 1, match/switch 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.
  • CoreFieldDecoderStrategy::create_structural_field_scheduler_with_mode (cognitive 18) rust/lance-encoding/src/decoder.rs:933 — CoreFieldDecoderStrategy::create_structural_field_scheduler_with_mode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlanarSparseScheduler · ×2
  • PlanarSparseScheduler::try_new (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:505 — PlanarSparseScheduler::try_new has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, match/switch 3 (4 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.
  • PlanarSparseScheduler::init_from_buffers (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:721 — PlanarSparseScheduler::init_from_buffers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, loops 1 (2 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentScanner · ×2
  • FragmentScanner::extract_guarantees (cognitive 31) rust/lance/src/io/exec/pushdown_scan.rs:589 — FragmentScanner::extract_guarantees has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 3 (6 pts), loops 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FragmentScanner::read_batch (cognitive 30) rust/lance/src/io/exec/pushdown_scan.rs:401 — FragmentScanner::read_batch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 2 (3 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.
D2 · Cognitive Complexity · MinHashLshIndex · ×2
  • MinHashLshIndex::refine (cognitive 31) rust/lance-index/src/scalar/minhash_lsh/index.rs:866 — MinHashLshIndex::refine has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MinHashLshIndex::read_queued (cognitive 25) rust/lance-index/src/scalar/minhash_lsh/index.rs:971 — MinHashLshIndex::read_queued has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HNSW · ×2
  • HNSW::flat_search (cognitive 31) rust/lance-index/src/vector/hnsw/builder.rs:637 — HNSW::flat_search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (6 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.
  • HNSW::search (cognitive 19) rust/lance-index/src/vector/hnsw/builder.rs:1709 — HNSW::search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PyLance · ×2
  • PyLance::into_pyobject (cognitive 30) python/src/transaction.rs:1005 — PyLance::into_pyobject has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 5 (10 pts), loops 1 (4 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.
  • PyLance::extract (cognitive 16) python/src/transaction.rs:731 — PyLance::extract has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), match/switch 4 (6 pts), loops 1 (3 pts), boolean chains 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 · DatasetIndexRemapper · ×2
  • DatasetIndexRemapper::remap_indices_with_context (cognitive 29) rust/lance/src/dataset/index.rs:289 — DatasetIndexRemapper::remap_indices_with_context has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 6 (12 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DatasetIndexRemapper::remap_and_merge_vector_segments (cognitive 16) rust/lance/src/dataset/index.rs:170 — DatasetIndexRemapper::remap_and_merge_vector_segments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SegmentCursorState · ×2
  • SegmentCursorState::extend_dense_bitmap_range (cognitive 28) rust/lance-table/src/rowids/segment.rs:959 — SegmentCursorState::extend_dense_bitmap_range has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (7 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.
  • SegmentCursorState::extend_range (cognitive 20) rust/lance-table/src/rowids/segment.rs:874 — SegmentCursorState::extend_range has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lance_core · ×2
  • lance_core::datatypes::schema::compare_fields (cognitive 27) rust/lance-core/src/datatypes/schema.rs:1161 — lance_core::datatypes::schema::compare_fields has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_core::datatypes::schema::parse_field_path (cognitive 27) rust/lance-core/src/datatypes/schema.rs:1838 — lance_core::datatypes::schema::parse_field_path has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InvertedPartition · ×2
  • InvertedPartition::stale_row_stats_for_terms (cognitive 27) rust/lance-index/src/scalar/inverted/index/partition.rs:784 — InvertedPartition::stale_row_stats_for_terms has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (9 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InvertedPartition::fetch_posting_lists (cognitive 22) rust/lance-index/src/scalar/inverted/index/partition.rs:1397 — InvertedPartition::fetch_posting_lists has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, match/switch 3 (5 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 · lance_jsonb · ×2
  • lance_jsonb::number::format_decimal_i256 (cognitive 27) rust/lance-jsonb/src/number.rs:1211 — lance_jsonb::number::format_decimal_i256 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (27 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.
  • lance_jsonb::util::parse_escaped_string (cognitive 21) rust/lance-jsonb/src/util.rs:53 — lance_jsonb::util::parse_escaped_string has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (9 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 · TopKCollector · ×2
  • TopKCollector::collect_mapped (cognitive 25) rust/lance-index/src/scalar/inverted/compound.rs:2067 — TopKCollector::collect_mapped has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TopKCollector::insert (cognitive 23) rust/lance-index/src/scalar/inverted/compound.rs:1987 — TopKCollector::insert has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (8 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LsmScanPlanner · ×2
  • LsmScanPlanner::plan_scan (cognitive 24) rust/lance/src/dataset/mem_wal/scanner/planner.rs:150 — LsmScanPlanner::plan_scan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 4 (6 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • LsmScanPlanner::build_source_scan (cognitive 24) rust/lance/src/dataset/mem_wal/scanner/planner.rs:373 — LsmScanPlanner::build_source_scan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 5 (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 · SortedPatchCursor · ×2
  • SortedPatchCursor::load_next_batch (cognitive 24) rust/lance/src/dataset/update_join.rs:1244 — SortedPatchCursor::load_next_batch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SortedPatchCursor::merge_batch (cognitive 18) rust/lance/src/dataset/update_join.rs:1301 — SortedPatchCursor::merge_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KeyCodec · ×2
  • KeyCodec::ranges_of (cognitive 23) rust/lance-index/src/scalar/list_element.rs:460 — KeyCodec::ranges_of has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), match/switch 1 (4 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.
  • KeyCodec::seek_range (cognitive 17) rust/lance-index/src/scalar/list_element.rs:329 — KeyCodec::seek_range has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 7 (11 pts), if/else 4 (5 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.
D2 · Cognitive Complexity · ShardWriter · ×2
  • ShardWriter::drain_for_close (cognitive 21) rust/lance/src/dataset/mem_wal/write/writer.rs:2463 — ShardWriter::drain_for_close has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 pts), loops 1 (3 pts), boolean chains 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.
  • ShardWriter::open_inner (cognitive 20) rust/lance/src/dataset/mem_wal/write/writer.rs:934 — ShardWriter::open_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NGramIndexBuilder · ×2
  • NGramIndexBuilder::stream_spill_reader (cognitive 21) rust/lance-index/src/scalar/ngram.rs:1482 — NGramIndexBuilder::stream_spill_reader has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NGramIndexBuilder::merge_spill_streams (cognitive 18) rust/lance-index/src/scalar/ngram.rs:1659 — NGramIndexBuilder::merge_spill_streams has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DictionaryDataBlock · ×2
  • DictionaryDataBlock::gather_fixed_width (cognitive 20) rust/lance-encoding/src/data.rs:1315 — DictionaryDataBlock::gather_fixed_width has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DictionaryDataBlock::into_arrow (cognitive 19) rust/lance-encoding/src/data.rs:1638 — DictionaryDataBlock::into_arrow has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 3 (4 pts), boolean chains 3 (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 · Value · ×2
  • Value::cmp (cognitive 20) rust/lance-jsonb/src/value.rs:80 — Value::cmp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Value::fmt (cognitive 16) rust/lance-jsonb/src/value.rs:168 — Value::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 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 · DatasetDelta · ×2
  • DatasetDelta::resolve_range (cognitive 19) rust/lance/src/dataset/delta.rs:263 — DatasetDelta::resolve_range has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DatasetDelta::scan_rows (cognitive 18) rust/lance/src/dataset/delta.rs:553 — DatasetDelta::scan_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BTreeIndex · ×2
  • BTreeIndex::merge_segments (cognitive 19) rust/lance-index/src/scalar/btree.rs:2752 — BTreeIndex::merge_segments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BTreeIndex::search_with_options (cognitive 17) rust/lance-index/src/scalar/btree.rs:3207 — BTreeIndex::search_with_options has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 4 (6 pts), loops 1 (2 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · InvertedIndex · ×2
  • InvertedIndex::bm25_search_modern_candidates (cognitive 19) rust/lance-index/src/scalar/inverted/index/search.rs:1030 — InvertedIndex::bm25_search_modern_candidates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (4 pts), boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InvertedIndex::expand_fuzzy_tokens (cognitive 17) rust/lance-index/src/scalar/inverted/index/search.rs:423 — InvertedIndex::expand_fuzzy_tokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostingListReader · ×2
  • PostingListReader::build_packed_groups (cognitive 19) rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:570 — PostingListReader::build_packed_groups has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 5 (8 pts), match/switch 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • PostingListReader::posting_read_chunk_ranges (cognitive 16) rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:862 — PostingListReader::posting_read_chunk_ranges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RowAddrTreeMap · ×2
  • RowAddrTreeMap::from (cognitive 19) rust/lance-table/src/rowids.rs:915 — RowAddrTreeMap::from has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 1 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • RowAddrTreeMap::insert_range (cognitive 16) rust/lance-select/src/mask.rs:700 — RowAddrTreeMap::insert_range has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 5 (7 pts), loops 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.
D2 · Cognitive Complexity · lance_tools · ×2
  • lance_tools::dataset::verify_data_files (cognitive 17) rust/lance-tools/src/dataset.rs:50 — lance_tools::dataset::verify_data_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_tools::dataset::repair_manifest (cognitive 17) rust/lance-tools/src/dataset.rs:141 — lance_tools::dataset::repair_manifest has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (7 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · BlobV2FieldRewritePlan · ×2
  • BlobV2FieldRewritePlan::try_new (cognitive 16) rust/lance/src/dataset/blob/rewrite.rs:378 — BlobV2FieldRewritePlan::try_new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BlobV2FieldRewritePlan::transform (cognitive 16) rust/lance/src/dataset/blob/rewrite.rs:519 — BlobV2FieldRewritePlan::transform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (3 pts), loops 1 (2 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (55 shared lines) · ×2
  • Near-duplicate member pair (55 shared lines) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:335 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:335-397 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:405-467 — These two members are variants of one another: 55 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (55 shared lines) rust/lance-io/src/object_store/providers/azure.rs:257 — rust/lance-io/src/object_store/providers/azure.rs:257-332 | rust/lance-io/src/object_store/providers/gcp.rs:303-370 — These two members are variants of one another: 55 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) · ×2
  • Near-duplicate member pair (33 shared lines) rust/lance-namespace-impls/src/dir/manifest.rs:2465 — rust/lance-namespace-impls/src/dir/manifest.rs:2465-2539 | rust/lance-namespace-impls/src/dir/manifest.rs:2845-2915 — 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.
  • Near-duplicate member pair (33 shared lines) rust/lance-namespace-impls/src/dir/manifest.rs:3159 — rust/lance-namespace-impls/src/dir/manifest.rs:3159-3248 | rust/lance-namespace-impls/src/dir/manifest.rs:3754-3814 — 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 · Edited copy of a member (58 corresponding lines) · ×2
  • Edited copy of a member (58 corresponding lines) rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:453 — rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:453-510 | rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:512-571 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (58 corresponding lines) rust/lance-table/src/io/commit/external_manifest.rs:46 — rust/lance-table/src/io/commit/external_manifest.rs:46-103 | rust/lance-table/src/io/commit/external_manifest.rs:644-710 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×2
  • Edited copy of a member (59 corresponding lines) rust/lance-core/src/cache/mod.rs:956 — rust/lance-core/src/cache/mod.rs:956-1014 | rust/lance-core/src/cache/mod.rs:1103-1161 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (59 corresponding lines) rust/lance-namespace-impls/src/credentials/gcp.rs:695 — rust/lance-namespace-impls/src/credentials/gcp.rs:695-753 | rust/lance-namespace-impls/src/credentials/gcp.rs:773-842 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×2
  • Edited copy of a member (57 corresponding lines) rust/lance-file/src/reader.rs:1691 — rust/lance-file/src/reader.rs:1691-1747 | rust/lance-file/src/reader.rs:2113-2172 — 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.
  • Edited copy of a member (57 corresponding lines) rust/lance-namespace-impls/src/credentials/azure.rs:899 — rust/lance-namespace-impls/src/credentials/azure.rs:899-969 | rust/lance-namespace-impls/src/credentials/gcp.rs:949-1005 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×2
  • Edited copy of a member (49 corresponding lines) rust/lance/src/index/frag_reuse.rs:2367 — rust/lance/src/index/frag_reuse.rs:2367-2422 | rust/lance/src/index/frag_reuse.rs:2430-2478 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) rust/lance-file/src/versions/v2_0/writer.rs:713 — rust/lance-file/src/versions/v2_0/writer.rs:713-761 | rust/lance-file/src/writer/structural.rs:734-786 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (72 corresponding lines) · ×2
  • Edited copy of a member (72 corresponding lines) rust/lance-file/src/versions/v1/writer/statistics.rs:241 — rust/lance-file/src/versions/v1/writer/statistics.rs:241-314 | rust/lance-file/src/versions/v1/writer/statistics.rs:316-387 — 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/lance-datafusion-exec/src/chunker.rs:263 — rust/lance-datafusion-exec/src/chunker.rs:263-346 | rust/lance-datafusion-exec/src/chunker.rs:371-442 — 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 copies of one member (3 members, 42+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 42+ corresponding lines) rust/lance-jsonb/src/number.rs:409 — rust/lance-jsonb/src/number.rs:409-450 | rust/lance-jsonb/src/number.rs:485-526 | rust/lance-jsonb/src/number.rs:543-606 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 42+ corresponding lines) rust/lance-namespace-impls/src/credentials/gcp.rs:260 — rust/lance-namespace-impls/src/credentials/gcp.rs:260-305 | rust/lance-namespace-impls/src/credentials/gcp.rs:419-460 | rust/lance-namespace-impls/src/credentials/gcp.rs:581-626 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is 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 (52 corresponding lines) · ×2
  • Edited copy of a member (52 corresponding lines) rust/lance-encoding/src/encodings/physical/alp.rs:735 — rust/lance-encoding/src/encodings/physical/alp.rs:735-786 | rust/lance-encoding/src/encodings/physical/alp.rs:967-1018 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (52 corresponding lines) java/src/main/java/org/lance/Fragment.java:312 — java/src/main/java/org/lance/Fragment.java:312-369 | java/src/main/java/org/lance/Fragment.java:390-441 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×2
  • Edited copy of a member (39 corresponding lines) rust/lance-index/src/scalar/bloomfilter.rs:520 — rust/lance-index/src/scalar/bloomfilter.rs:520-558 | rust/lance-index/src/scalar/zonemap.rs:1121-1159 — 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/lance-index/src/scalar/bitmap.rs:564 — rust/lance-index/src/scalar/bitmap.rs:564-602 | rust/lance-index/src/scalar/bitmap.rs:611-650 — 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 copy of a member (47 corresponding lines) · ×2
  • Edited copy of a member (47 corresponding lines) rust/lance-file/src/versions/v2_0/writer.rs:539 — rust/lance-file/src/versions/v2_0/writer.rs:539-586 | rust/lance-file/src/writer/structural.rs:666-712 — 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/lance/src/index/vector/ivf.rs:3443 — rust/lance/src/index/vector/ivf.rs:3443-3489 | rust/lance/src/index/vector/ivf.rs:3499-3547 — 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 (45 corresponding lines) · ×2
  • Edited copy of a member (45 corresponding lines) rust/lance-encoding/src/encodings/physical/alp.rs:1209 — rust/lance-encoding/src/encodings/physical/alp.rs:1209-1253 | rust/lance-encoding/src/encodings/physical/alp.rs:1264-1308 — 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/lance-encoding/src/encodings/physical/alp.rs:2098 — rust/lance-encoding/src/encodings/physical/alp.rs:2098-2142 | rust/lance-encoding/src/encodings/physical/alp.rs:2150-2194 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 28+ corresponding lines) java/lance-jni/src/blocking_dataset/read.rs:756 — java/lance-jni/src/blocking_dataset/read.rs:756-784 | java/lance-jni/src/blocking_dataset/read.rs:807-834 | java/lance-jni/src/blocking_dataset/read.rs:859-890 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 28+ corresponding lines) rust/lance-io/src/object_store/providers/azure.rs:46 — rust/lance-io/src/object_store/providers/azure.rs:46-92 | rust/lance-io/src/object_store/providers/oss.rs:69-96 | rust/lance-io/src/object_store/providers/tos.rs:75-102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 21+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 21+ corresponding lines) rust/lance-linalg/src/simd/f64.rs:699 — rust/lance-linalg/src/simd/f64.rs:699-719 | rust/lance-linalg/src/simd/f64.rs:767-787 | rust/lance-linalg/src/simd/f64.rs:823-843 | rust/lance-linalg/src/simd/f64.rs:850-870 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 21+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:486 — rust/lance-linalg/src/simd/f32.rs:486-506 | rust/lance-linalg/src/simd/f32.rs:538-558 | rust/lance-linalg/src/simd/f64.rs:336-356 | rust/lance-linalg/src/simd/f64.rs:388-408 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 26+ corresponding lines) rust/lance/src/index/scalar/bitmap.rs:38 — rust/lance/src/index/scalar/bitmap.rs:38-63 | rust/lance/src/index/scalar/btree.rs:68-93 | rust/lance/src/index/scalar/rtree.rs:85-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 26+ corresponding lines) rust/lance-index/src/vector/pq/storage.rs:449 — rust/lance-index/src/vector/pq/storage.rs:449-475 | rust/lance-index/src/vector/quantizer.rs:403-430 | rust/lance-index/src/vector/sq/storage.rs:230-255 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 23+ corresponding lines) rust/lance-index/src/vector/bq/ex_dot.rs:1284 — rust/lance-index/src/vector/bq/ex_dot.rs:1284-1306 | rust/lance-index/src/vector/bq/ex_dot.rs:1329-1356 | rust/lance-index/src/vector/bq/ex_dot.rs:1364-1391 — 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) java/lance-jni/src/schema.rs:255 — java/lance-jni/src/schema.rs:255-277 | java/lance-jni/src/schema.rs:283-308 | java/lance-jni/src/schema.rs:313-335 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) rust/lance/src/io/exec/fts/flat_match.rs:856 — rust/lance/src/io/exec/fts/flat_match.rs:856-873 | rust/lance/src/io/exec/fts/match_query.rs:400-418 | rust/lance/src/io/exec/fts/phrase.rs:327-344 — 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/lance/src/dataset/write/merge_insert/exec/delete.rs:247 — rust/lance/src/dataset/write/merge_insert/exec/delete.rs:247-264 | rust/lance/src/dataset/write/merge_insert/exec/in_place.rs:425-445 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1166-1189 — 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, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) rust/lance/src/dataset/scanner/fts.rs:211 — rust/lance/src/dataset/scanner/fts.rs:211-236 | rust/lance/src/io/exec/fts/matches.rs:173-192 | rust/lance/src/io/exec/fts/matches.rs:248-268 — 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/lance-index/src/vector/pq.rs:679 — rust/lance-index/src/vector/pq.rs:679-698 | rust/lance-index/src/vector/pq/storage.rs:579-606 | rust/lance-index/src/vector/pq/storage.rs:613-636 — 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 (4 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 10+ corresponding lines) java/lance-jni/src/namespace.rs:3521 — java/lance-jni/src/namespace.rs:3521-3530 | java/lance-jni/src/namespace.rs:3566-3576 | java/lance-jni/src/namespace.rs:3650-3659 | java/lance-jni/src/namespace.rs:3695-3705 — 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) java/lance-jni/src/namespace.rs:3484 — java/lance-jni/src/namespace.rs:3484-3493 | java/lance-jni/src/namespace.rs:3505-3514 | java/lance-jni/src/namespace.rs:3613-3622 | java/lance-jni/src/namespace.rs:3634-3643 — 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 (6 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 18+ corresponding lines) rust/lance-linalg/src/simd/u8.rs:110 — rust/lance-linalg/src/simd/u8.rs:110-127 | rust/lance-linalg/src/simd/u8.rs:162-179 | rust/lance-linalg/src/simd/u8.rs:246-263 | rust/lance-linalg/src/simd/u8.rs:271-288 | rust/lance-linalg/src/simd/u8.rs:296-313 | rust/lance-linalg/src/simd/u8.rs:379-396 — 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.
  • Edited copies of one member (6 members, 18+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:220 — rust/lance-linalg/src/simd/f32.rs:220-237 | rust/lance-linalg/src/simd/f32.rs:240-260 | rust/lance-linalg/src/simd/f64.rs:113-130 | rust/lance-linalg/src/simd/f64.rs:133-153 | rust/lance-linalg/src/simd/i32.rs:120-137 | rust/lance-linalg/src/simd/i32.rs:140-160 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 8+ corresponding lines) python/src/namespace.rs:314 — python/src/namespace.rs:314-321 | python/src/namespace.rs:450-457 | python/src/namespace.rs:464-471 | python/src/namespace.rs:1061-1068 | python/src/namespace.rs:1197-1204 | python/src/namespace.rs:1211-1218 — 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.
  • Edited copies of one member (6 members, 8+ corresponding lines) java/lance-jni/src/async_scanner.rs:392 — java/lance-jni/src/async_scanner.rs:392-400 | java/lance-jni/src/blocking_dataset/read.rs:324-334 | java/lance-jni/src/blocking_scanner.rs:912-921 | java/lance-jni/src/file_reader.rs:205-212 | java/lance-jni/src/mem_wal.rs:588-598 | java/lance-jni/src/mem_wal.rs:616-626 — 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 (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) java/lance-jni/src/mem_wal.rs:1209 — java/lance-jni/src/mem_wal.rs:1209-1222 | python/src/mem_wal.rs:974-987 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:115-126 — 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/lance-file/src/versions/v2_1/reader.rs:250 — rust/lance-file/src/versions/v2_1/reader.rs:250-261 | rust/lance-file/src/versions/v2_2/reader.rs:252-263 | rust/lance-file/src/versions/v2_3/reader.rs:415-426 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 8+ corresponding lines) python/src/fragment.rs:1141 — python/src/fragment.rs:1141-1150 | python/src/scanner.rs:141-148 | python/src/scanner.rs:151-160 | python/src/scanner.rs:163-176 | python/src/scanner.rs:186-195 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 8+ corresponding lines) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:593 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:593-600 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:176-183 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:702-709 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:215-222 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:339-346 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:1419 — rust/lance-encoding/src/encodings/physical/alp.rs:1419-1450 | rust/lance-encoding/src/encodings/physical/alp.rs:1543-1574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:1419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (32 lines × 2) rust/lance-file/src/versions/v2_2/mod.rs:79 — rust/lance-file/src/versions/v2_2/mod.rs:79-110 | rust/lance-file/src/versions/v2_3/mod.rs:91-122 — `rust/lance-file/src/versions/v2_2/mod.rs` and `rust/lance-file/src/versions/v2_3/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_2/mod.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–29 lines × 2) · ×2
  • Duplicated block (27–29 lines × 2) java/lance-jni/src/otel.rs:244 — java/lance-jni/src/otel.rs:244-270 | python/src/otel.rs:302-330 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (27–29 lines × 2) rust/lance/src/io/exec/scan.rs:473 — rust/lance/src/io/exec/scan.rs:473-499 | rust/lance/src/io/exec/scan.rs:507-535 — both copies are in the same file, so extract the 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 (28–29 lines × 2) · ×2
  • Duplicated block (28–29 lines × 2) rust/lance-index/src/scalar/inverted.rs:164 — rust/lance-index/src/scalar/inverted.rs:164-191 | rust/lance-index/src/scalar/inverted/index/search.rs:424-452 — before extracting anything, compare `rust/lance-index/src/scalar/inverted.rs` and `rust/lance-index/src/scalar/inverted/index/search.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-index/src/scalar/inverted.rs:164` it does not close everything it opens, so those exact lines 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/lance/src/index/create.rs:921 — rust/lance/src/index/create.rs:921-949 | rust/lance/src/index/create.rs:1009-1036 — both copies are in the same file, so extract the 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 (25–26 lines × 2) · ×2
  • Duplicated block (25–26 lines × 2) rust/lance-datafusion-exec/src/chunker.rs:278 — rust/lance-datafusion-exec/src/chunker.rs:278-302 | rust/lance-datafusion-exec/src/chunker.rs:384-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-datafusion-exec/src/chunker.rs:278` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (25–26 lines × 2) rust/lance/src/index/vector/ivf/io.rs:214 — rust/lance/src/index/vector/ivf/io.rs:214-239 | rust/lance/src/index/vector/ivf/io.rs:322-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1191 — rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1191-1216 | rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1228-1253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (26 lines × 2) java/src/main/java/org/lance/ipc/AsyncScanner.java:70 — java/src/main/java/org/lance/ipc/AsyncScanner.java:70-95 | java/src/main/java/org/lance/ipc/LanceScanner.java:66-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `java/src/main/java/org/lance/ipc/LanceScanner.java:92` calls `isCollectStats` and `java/src/main/java/org/lance/ipc/AsyncScanner.java:96` 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 (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) java/lance-jni/src/optimize.rs:106 — java/lance-jni/src/optimize.rs:106-128 | java/lance-jni/src/optimize.rs:326-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/optimize.rs:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `java/lance-jni/src/optimize.rs:325` calls `extract_object` and `java/lance-jni/src/optimize.rs:105` 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/lance/src/io/commit.rs:2136 — rust/lance/src/io/commit.rs:2136-2158 | rust/lance/src/io/commit.rs:2209-2231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/io/commit.rs:2136` it does not close everything it opens, so those 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/lance/src/io/commit.rs:2232` calls `propagate_commit_error_after_success`, `Err` and `rust/lance/src/io/commit.rs:2159` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) rust/lance-io/src/uring/current_thread.rs:371 — rust/lance-io/src/uring/current_thread.rs:371-391 | rust/lance-io/src/uring/reader.rs:181-202 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21–22 lines × 2) ci/new_contributors.py:159 — ci/new_contributors.py:159-180 | ci/review_stats.py:112-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×2
  • Duplicated block (19–22 lines × 2) rust/lance/src/dataset/scanner/fts.rs:1666 — rust/lance/src/dataset/scanner/fts.rs:1666-1684 | rust/lance/src/dataset/scanner/fts.rs:2032-2053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/scanner/fts.rs:1666` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (19–22 lines × 2) rust/lance/src/index/scalar/inverted.rs:546 — rust/lance/src/index/scalar/inverted.rs:546-567 | rust/lance/src/index/scalar/inverted.rs:607-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/lance/src/index/scalar/inverted.rs:546` it does not close everything it opens, so those 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–18 lines × 2) · ×2
  • Duplicated block (15–18 lines × 2) rust/lance/src/dataset/optimize/planning.rs:959 — rust/lance/src/dataset/optimize/planning.rs:959-973 | rust/lance/src/dataset/optimize/planning.rs:1386-1403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/optimize/planning.rs:959` it does not close everything it opens, so those exact lines 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–18 lines × 2) rust/lance/src/index/vector/ivf.rs:5588 — rust/lance/src/index/vector/ivf.rs:5588-5605 | rust/lance/src/index/vector/ivf/streaming_hamming.rs:763-777 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) rust/lance/src/index/loading.rs:1509 — rust/lance/src/index/loading.rs:1509-1526 | rust/lance/src/index/loading.rs:1560-1575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/loading.rs:1509` it does not close everything it opens, so those exact lines 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–18 lines × 2) rust/lance/src/dataset/hash_joiner.rs:209 — rust/lance/src/dataset/hash_joiner.rs:209-226 | rust/lance/src/dataset/hash_joiner.rs:294-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/lance/src/dataset/hash_joiner.rs:209` it does not close everything it opens, so those 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–16 lines × 2) · ×2
  • Duplicated block (13–16 lines × 2) rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:137 — rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:137-152 | rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:266-278 — both copies are in the same file, so extract the 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–16 lines × 2) rust/lance/src/dataset/hash_joiner.rs:172 — rust/lance/src/dataset/hash_joiner.rs:172-187 | rust/lance/src/dataset/hash_joiner.rs:261-273 — both copies are in the same file, so extract the 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 (15 lines × 4) · ×2
  • Duplicated block (15 lines × 4) rust/lance-encoding/src/encodings/physical/alp.rs:849 — rust/lance-encoding/src/encodings/physical/alp.rs:849-863 | rust/lance-encoding/src/encodings/physical/alp.rs:923-937 | rust/lance-encoding/src/encodings/physical/alp.rs:1089-1103 | rust/lance-encoding/src/encodings/physical/alp.rs:1163-1177 — 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/lance-encoding/src/encodings/physical/alp.rs:849` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 4) rust/lance-index/src/vector/ivf.rs:161 — rust/lance-index/src/vector/ivf.rs:161-175 | rust/lance-index/src/vector/ivf.rs:189-203 | rust/lance-index/src/vector/ivf.rs:233-247 | rust/lance-index/src/vector/ivf.rs:283-297 — 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/lance-index/src/vector/ivf.rs:161` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×2
  • Duplicated block (11–15 lines × 2) java/lance-jni/src/blocking_dataset/schema.rs:201 — java/lance-jni/src/blocking_dataset/schema.rs:201-215 | java/lance-jni/src/blocking_dataset/schema.rs:246-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 `java/lance-jni/src/blocking_dataset/schema.rs:201` it does not close everything it opens, so those exact 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–15 lines × 2) rust/lance/src/dataset/fragment.rs:2352 — rust/lance/src/dataset/fragment.rs:2352-2366 | rust/lance/src/dataset/fragment/session.rs:61-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/fragment.rs:2352` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×2
  • Duplicated block (12–15 lines × 2) rust/lance-index/src/vector/pq/storage.rs:580 — rust/lance-index/src/vector/pq/storage.rs:580-594 | rust/lance-index/src/vector/pq/storage.rs:614-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.
  • Duplicated block (12–15 lines × 2) rust/lance/src/dataset/scanner/source.rs:684 — rust/lance/src/dataset/scanner/source.rs:684-698 | rust/lance/src/dataset/scanner/source.rs:832-843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/scanner/source.rs:684` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 × 3) · ×2
  • Duplicated block (12–13 lines × 3) python/src/file.rs:340 — python/src/file.rs:340-352 | python/src/file.rs:507-518 | python/src/file.rs:1004-1015 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/src/file.rs:340` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 3) rust/lance/src/io/exec/fts/compound.rs:1119 — rust/lance/src/io/exec/fts/compound.rs:1119-1130 | rust/lance/src/io/exec/fts/match_query.rs:631-643 | rust/lance/src/io/exec/fts/phrase.rs:544-556 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 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/lance/src/io/exec/fts/compound.rs:1119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) rust/lance-encoding/src/compression.rs:224 — rust/lance-encoding/src/compression.rs:224-236 | rust/lance-encoding/src/compression.rs:389-399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/compression.rs:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–13 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1125 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1125-1137 | rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1191-1201 — both copies are in the same file, so extract the 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 lines × 3) · ×2
  • Duplicated block (10 lines × 3) rust/lance-file/src/reader.rs:1581 — rust/lance-file/src/reader.rs:1581-1590 | rust/lance-file/src/reader.rs:1621-1630 | rust/lance-file/src/reader.rs:1661-1670 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-file/src/reader.rs:1581` it begins part-way through the construct above it, so those exact lines 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/lance-linalg/src/simd/dist_table.rs:241 — rust/lance-linalg/src/simd/dist_table.rs:241-250 | rust/lance-linalg/src/simd/dist_table.rs:455-464 | rust/lance-linalg/src/simd/dist_table.rs:500-509 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-linalg/src/simd/dist_table.rs:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–9 lines × 2) · ×2
  • Duplicated block (6–9 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/planar.rs:365 — rust/lance-encoding/src/encodings/logical/primitive/planar.rs:365-373 | rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:650-655 — 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 (6–9 lines × 2) rust/lance/src/index/vector/ivf/io.rs:243 — rust/lance/src/index/vector/ivf/io.rs:243-248 | rust/lance/src/index/vector/ivf/io.rs:372-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector/ivf/io.rs:243` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×2
  • Duplicated block (7–9 lines × 2) rust/lance-index/src/vector/bq/dist_table_quant.rs:63 — rust/lance-index/src/vector/bq/dist_table_quant.rs:63-71 | rust/lance-index/src/vector/bq/dist_table_quant.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `quantized_dist_table` to `&mut Vec<u8>` in one and `&mut Vec<u16>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7–9 lines × 2) rust/lance-io/src/object_store/providers.rs:335 — rust/lance-io/src/object_store/providers.rs:335-341 | rust/lance-io/src/object_store/providers.rs:381-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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–8 lines × 4) · ×2
  • Duplicated block (7–8 lines × 4) rust/lance/src/index/scalar/bloomfilter.rs:26 — rust/lance/src/index/scalar/bloomfilter.rs:26-33 | rust/lance/src/index/scalar/label_list.rs:108-114 | rust/lance/src/index/scalar/minhash_lsh.rs:31-38 | rust/lance/src/index/scalar/rtree.rs:27-34 — before extracting anything, compare `rust/lance/src/index/scalar/bloomfilter.rs` and `rust/lance/src/index/scalar/minhash_lsh.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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 × 4) rust/lance/src/io/exec/fts/flat_match.rs:527 — rust/lance/src/io/exec/fts/flat_match.rs:527-533 | rust/lance/src/io/exec/knn.rs:1053-1059 | rust/lance/src/io/exec/rowids.rs:224-231 | rust/lance/src/io/exec/scalar_index.rs:776-783 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/io/exec/rowids.rs:224` it does not close everything it opens, so those exact 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 × 4) · ×2
  • Duplicated block (9 lines × 4) python/src/dataset/optimize.rs:251 — python/src/dataset/optimize.rs:251-259 | python/src/dataset/optimize.rs:363-371 | python/src/fragment.rs:1008-1016 | python/src/fragment.rs:1067-1075 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `other` to `PyRef<'_, Self>` in one and `Self` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 4) rust/lance-namespace-impls/src/credentials/azure.rs:404 — rust/lance-namespace-impls/src/credentials/azure.rs:404-415 | rust/lance-namespace-impls/src/credentials/azure.rs:461-470 | rust/lance-namespace-impls/src/credentials/azure.rs:517-528 | rust/lance-namespace-impls/src/credentials/gcp.rs:1107-1115 — before extracting anything, compare `rust/lance-namespace-impls/src/credentials/azure.rs` and `rust/lance-namespace-impls/src/credentials/gcp.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/credentials/azure.rs:404` it begins part-way through the construct above it, so those 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 × 4) · ×2
  • Duplicated block (5 lines × 4) java/lance-jni/src/blocking_dataset/conversions.rs:168 — java/lance-jni/src/blocking_dataset/conversions.rs:168-181 | java/lance-jni/src/blocking_scanner.rs:825-838 | java/lance-jni/src/file_reader.rs:85-89 | java/lance-jni/src/file_writer.rs:51-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/blocking_dataset/conversions.rs:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) rust/lance-datafusion-exec/src/expr.rs:200 — rust/lance-datafusion-exec/src/expr.rs:200-204 | rust/lance-datafusion-exec/src/expr.rs:231-235 | rust/lance-datafusion-exec/src/expr.rs:309-313 | rust/lance-datafusion-exec/src/expr.rs:340-344 — 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/lance-datafusion-exec/src/expr.rs:307` calls `UInt64`, `Some`, `from` and `rust/lance-datafusion-exec/src/expr.rs:338` 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 × 4) · ×2
  • Duplicated block (6 lines × 4) java/src/main/java/org/lance/Dataset.java:1584 — java/src/main/java/org/lance/Dataset.java:1584-1589 | java/src/main/java/org/lance/Dataset.java:1625-1630 | java/src/main/java/org/lance/Dataset.java:2279-2284 | java/src/main/java/org/lance/Dataset.java:2401-2406 — 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 `java/src/main/java/org/lance/Dataset.java:1584` it does not close everything it opens, so those exact lines 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) java/src/main/java/org/lance/Dataset.java:1773 — java/src/main/java/org/lance/Dataset.java:1773-1778 | java/src/main/java/org/lance/Dataset.java:2059-2064 | java/src/main/java/org/lance/Dataset.java:2853-2858 | java/src/main/java/org/lance/ipc/LanceScanner.java:271-276 — 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.
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/lance-index/src/scalar/fmindex.rs:1070 — `count` is read from the bytes being parsed at line 1068 (`u32::from_le_bytes`), then used to size a `Vec::with_capacity` at line 1070 — and nowhere in its scope is `count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rust/lance-arrow/src/ipc.rs:59 — `len` is read from the bytes being parsed at line 58 (`u64::from_le_bytes`), then used to size a `vec![…; n]` at line 59 — 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.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement docs/theme/assets/site.css:706 — `.ld-search__input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D1 · Cyclomatic Complexity · Operation · ×1
  • Operation::eq (cyclomatic 241) rust/lance-table/src/transaction/conflicts.rs:19 — Operation::eq has cyclomatic complexity 241 (threshold 15). Of this number, 240 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.
D1 · Cyclomatic Complexity · OrderableScalarValue · ×1
  • OrderableScalarValue::cmp (cyclomatic 188) rust/lance-index/src/scalar/btree.rs:197 — OrderableScalarValue::cmp has cyclomatic complexity 188 (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 · LanceDataset._create_index_impl (cyclomatic 79) · ×1
  • LanceDataset._create_index_impl (cyclomatic 79) python/python/lance/dataset.py:3667 — LanceDataset._create_index_impl has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ZoneMapIndex · ×1
  • ZoneMapIndex::evaluate_zone_against_query (cyclomatic 70) rust/lance-index/src/scalar/zonemap.rs:539 — ZoneMapIndex::evaluate_zone_against_query has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Planner · ×1
  • Planner::parse_sql_expr (cyclomatic 56) rust/lance-datafusion/src/planner.rs:840 — Planner::parse_sql_expr 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.
D1 · Cyclomatic Complexity · BloomFilterIndex · ×1
  • BloomFilterIndex::evaluate_block_against_query (cyclomatic 56) rust/lance-index/src/scalar/bloomfilter.rs:320 — BloomFilterIndex::evaluate_block_against_query 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.
D1 · Cyclomatic Complexity · lance_arrow_scalar · ×1
  • lance_arrow_scalar::serde::format_string_to_data_type (cyclomatic 49) rust/arrow-scalar/src/serde.rs:161 — lance_arrow_scalar::serde::format_string_to_data_type has cyclomatic complexity 49 (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 · lance_namespace · ×1
  • lance_namespace::schema::arrow_type_to_json (cyclomatic 45) rust/lance-namespace/src/schema.rs:51 — lance_namespace::schema::arrow_type_to_json 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.
D1 · Cyclomatic Complexity · Parser · ×1
  • Parser::parse_json_number (cyclomatic 44) rust/lance-jsonb/src/parser.rs:410 — Parser::parse_json_number has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lance_arrow_stats · ×1
  • lance_arrow_stats::find_min_max_indices (cyclomatic 41) rust/arrow-stats/src/lib.rs:453 — lance_arrow_stats::find_min_max_indices 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.
D1 · Cyclomatic Complexity · LogicalType · ×1
  • LogicalType::try_from (cyclomatic 39) rust/lance-core/src/datatypes.rs:331 — LogicalType::try_from 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.
D1 · Cyclomatic Complexity · PQDistCalculator · ×1
  • PQDistCalculator::accumulate_topk_with_scratch (cyclomatic 36) rust/lance-index/src/vector/pq/storage.rs:1200 — PQDistCalculator::accumulate_topk_with_scratch has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Branches · ×1
  • Branches::cleanup_branch_directories (cyclomatic 35) rust/lance/src/dataset/refs.rs:654 — Branches::cleanup_branch_directories has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackedStructVariablePerValueDecompressor · ×1
  • PackedStructVariablePerValueDecompressor::decompress (cyclomatic 32) rust/lance-encoding/src/encodings/physical/packed.rs:642 — PackedStructVariablePerValueDecompressor::decompress 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 · scanner._build_vector_search_query (cyclomatic 32) · ×1
  • scanner._build_vector_search_query (cyclomatic 32) python/python/lance/_dataset/scanner.py:472 — scanner._build_vector_search_query has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Merger · ×1
  • Merger::execute_batch (cyclomatic 31) rust/lance/src/dataset/write/merge_insert/merger.rs:271 — Merger::execute_batch has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RawInvertedIndexParams · ×1
  • RawInvertedIndexParams::resolve (cyclomatic 31) rust/lance-index/src/scalar/inverted/tokenizer.rs:288 — RawInvertedIndexParams::resolve has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VariableFullZipDecoder · ×1
  • VariableFullZipDecoder::unzip (cyclomatic 29) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1138 — VariableFullZipDecoder::unzip has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommitBuilder · ×1
  • CommitBuilder::execute_inner (cyclomatic 28) rust/lance/src/dataset/write/commit.rs:378 — CommitBuilder::execute_inner has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IndexWorker · ×1
  • IndexWorker::process_document (cyclomatic 28) rust/lance-index/src/scalar/inverted/builder.rs:1852 — IndexWorker::process_document has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RowIdSequence · ×1
  • RowIdSequence::mask_to_offset_ranges (cyclomatic 28) rust/lance-table/src/rowids.rs:658 — RowIdSequence::mask_to_offset_ranges has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatasetBuilder · ×1
  • DatasetBuilder::load_impl (cyclomatic 27) rust/lance/src/dataset/builder.rs:692 — DatasetBuilder::load_impl 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 · FilteredReadStream · ×1
  • FilteredReadStream::plan_scan (cyclomatic 27) rust/lance/src/io/exec/filtered_read.rs:902 — FilteredReadStream::plan_scan 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 · CompoundQueryExec · ×1
  • CompoundQueryExec::execute (cyclomatic 27) rust/lance/src/io/exec/fts/compound.rs:1049 — CompoundQueryExec::execute 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 · JsonbItem · ×1
  • JsonbItem::partial_cmp (cyclomatic 27) rust/lance-jsonb/src/core/item.rs:167 — JsonbItem::partial_cmp 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 · LanceDataset._prepare_scalar_index_request (cyclomatic 27) · ×1
  • LanceDataset._prepare_scalar_index_request (cyclomatic 27) python/python/lance/dataset.py:3183 — LanceDataset._prepare_scalar_index_request 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 · FtsMemIndex · ×1
  • FtsMemIndex::to_index_builder (cyclomatic 26) rust/lance/src/dataset/mem_wal/index/fts.rs:2941 — FtsMemIndex::to_index_builder has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactionOptions · ×1
  • CompactionOptions::apply_dataset_config (cyclomatic 26) rust/lance/src/dataset/optimize/planning.rs:402 — CompactionOptions::apply_dataset_config has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ObjectStore · ×1
  • ObjectStore::read_local_staging_files (cyclomatic 26) rust/lance-io/src/object_store/local_staging.rs:97 — ObjectStore::read_local_staging_files has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PostingIterator · ×1
  • PostingIterator::merge_optional_freqs (cyclomatic 25) rust/lance-index/src/scalar/inverted/wand/maxscore.rs:966 — PostingIterator::merge_optional_freqs has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · U64Segment · ×1
  • U64Segment::with_new_high (cyclomatic 25) rust/lance-table/src/rowids/segment.rs:609 — U64Segment::with_new_high has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FtsIndexExec · ×1
  • FtsIndexExec::materialize_rows_sorted (cyclomatic 24) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:332 — FtsIndexExec::materialize_rows_sorted 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 · DefaultDecompressionStrategy · ×1
  • DefaultDecompressionStrategy::create_miniblock_decompressor (cyclomatic 24) rust/lance-encoding/src/compression.rs:1368 — DefaultDecompressionStrategy::create_miniblock_decompressor has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · FtsTokenizerOptions · ×1
  • FtsTokenizerOptions::apply (cyclomatic 23) python/src/fts.rs:63 — FtsTokenizerOptions::apply has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TakeOperation · ×1
  • TakeOperation::try_from_expr (cyclomatic 23) rust/lance/src/dataset/scanner/source.rs:128 — TakeOperation::try_from_expr 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 · TopKLateMaterialization · ×1
  • TopKLateMaterialization::rewrite (cyclomatic 23) rust/lance/src/io/exec/topk_late_materialization.rs:145 — TopKLateMaterialization::rewrite 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 · BitmapIndex · ×1
  • BitmapIndex::search_with_options (cyclomatic 23) rust/lance-index/src/scalar/bitmap.rs:1078 — BitmapIndex::search_with_options 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 · BTreeLookup · ×1
  • BTreeLookup::pages_between (cyclomatic 23) rust/lance-index/src/scalar/btree.rs:1181 — BTreeLookup::pages_between 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 · CompoundScorerPlan · ×1
  • CompoundScorerPlan::analyze_node (cyclomatic 23) rust/lance-index/src/scalar/inverted/compound.rs:497 — CompoundScorerPlan::analyze_node 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 · Deserializer · ×1
  • Deserializer::read_with_jentry (cyclomatic 23) rust/lance-jsonb/src/core/de.rs:264 — Deserializer::read_with_jentry 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 · dataset.write_dataset (cyclomatic 23) · ×1
  • dataset.write_dataset (cyclomatic 23) python/python/lance/dataset.py:5777 — dataset.write_dataset 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 · BatchRefineExec · ×1
  • BatchRefineExec::refine (cyclomatic 22) rust/lance/src/io/exec/knn/refine.rs:127 — BatchRefineExec::refine 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 · DataBlock · ×1
  • DataBlock::from_arrays_impl (cyclomatic 22) rust/lance-encoding/src/data.rs:2676 — DataBlock::from_arrays_impl has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RleEncoder · ×1
  • RleEncoder::encode_chunk_rolling_slice (cyclomatic 22) rust/lance-encoding/src/encodings/physical/rle.rs:776 — RleEncoder::encode_chunk_rolling_slice 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 · LanceDataset.__iter__ (cyclomatic 22) · ×1
  • LanceDataset.__iter__ (cyclomatic 22) python/python/lance/torch/data.py:369 — LanceDataset.__iter__ 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 · ScalarBackend · ×1
  • ScalarBackend::insert_array_and_report_existing (cyclomatic 21) rust/lance/src/dataset/mem_wal/index/btree.rs:792 — ScalarBackend::insert_array_and_report_existing has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · IndexDescriptionImpl · ×1
  • IndexDescriptionImpl::try_new (cyclomatic 21) rust/lance/src/index/statistics.rs:152 — IndexDescriptionImpl::try_new 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 · ChunkInstructions · ×1
  • ChunkInstructions::schedule_instructions (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1686 — ChunkInstructions::schedule_instructions 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 · RepDefUnraveler · ×1
  • RepDefUnraveler::unravel_offsets (cyclomatic 21) rust/lance-encoding/src/repdef.rs:2041 — RepDefUnraveler::unravel_offsets 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 · Selector · ×1
  • Selector::convert_expr_val (cyclomatic 21) rust/lance-jsonb/src/jsonpath/selector.rs:754 — Selector::convert_expr_val has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · data._to_tensor (cyclomatic 21) · ×1
  • data._to_tensor (cyclomatic 21) python/python/lance/torch/data.py:114 — data._to_tensor 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 · Checker.run (cyclomatic 21) · ×1
  • Checker.run (cyclomatic 21) skills/lance-table-maintenance/scripts/conformance.py:80 — Checker.run has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BytesBackend · ×1
  • BytesBackend::insert_array_and_report_existing (cyclomatic 20) rust/lance/src/dataset/mem_wal/index/btree.rs:538 — BytesBackend::insert_array_and_report_existing 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 · ScalarMemIndexExec · ×1
  • ScalarMemIndexExec::read_rows (cyclomatic 20) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scalar_index.rs:193 — ScalarMemIndexExec::read_rows 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 · BitpackedPageDecoder · ×1
  • BitpackedPageDecoder::decode (cyclomatic 20) rust/lance-encoding/src/array_encoding/physical/bitpack.rs:381 — BitpackedPageDecoder::decode 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 · ArrayFieldEncodingStrategy · ×1
  • ArrayFieldEncodingStrategy::validate_v2_0_array_reachability (cyclomatic 20) rust/lance-encoding/src/array_encoding/strategy.rs:298 — ArrayFieldEncodingStrategy::validate_v2_0_array_reachability 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 · LookupKeys · ×1
  • LookupKeys::match_page (cyclomatic 20) rust/lance-index/src/scalar/btree.rs:1765 — LookupKeys::match_page has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: BTreeLookup::candidate_pages_for_values (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · FetchedPostings · ×1
  • FetchedPostings::into_loaded (cyclomatic 20) rust/lance-index/src/scalar/inverted/index/partition.rs:1706 — FetchedPostings::into_loaded 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 · JsonFlattener · ×1
  • JsonFlattener::flatten (cyclomatic 20) rust/lance-index/src/scalar/inverted/tokenizer/document_tokenizer.rs:526 — JsonFlattener::flatten 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 · RQPairScorer · ×1
  • RQPairScorer::stage (cyclomatic 20) rust/lance-index/src/vector/bq/pairwise.rs:138 — RQPairScorer::stage has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RowAddrMask · ×1
  • RowAddrMask::for_each_selected (cyclomatic 20) rust/lance-select/src/mask.rs:126 — RowAddrMask::for_each_selected 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 · Updater · ×1
  • Updater::update_batches (cyclomatic 19) rust/lance/src/dataset/updater.rs:314 — Updater::update_batches 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 · UpdateJob · ×1
  • UpdateJob::execute_impl (cyclomatic 19) rust/lance/src/dataset/write/update.rs:407 — UpdateJob::execute_impl 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 · TakeStream · ×1
  • TakeStream::map_batch (cyclomatic 19) rust/lance/src/io/exec/take.rs:255 — TakeStream::map_batch 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 · FixedWidthDataBlock · ×1
  • FixedWidthDataBlock::byte_position_entropy (cyclomatic 19) rust/lance-encoding/src/statistics.rs:514 — FixedWidthDataBlock::byte_position_entropy has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · FullZipScheduler · ×1
  • FullZipScheduler::schedule_list_structure (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode/structure.rs:29 — FullZipScheduler::schedule_list_structure 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 · PlanarSparseTask · ×1
  • PlanarSparseTask::decode_checked (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:1068 — PlanarSparseTask::decode_checked 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 · RepDefBuilder · ×1
  • RepDefBuilder::concat_layers (cyclomatic 19) rust/lance-encoding/src/repdef.rs:1722 — RepDefBuilder::concat_layers 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 · ReqOptScorer · ×1
  • ReqOptScorer::position (cyclomatic 19) rust/lance-index/src/scalar/inverted/compound.rs:3156 — ReqOptScorer::position 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 · lance_jsonb · ×1
  • lance_jsonb::util::parse_escaped_string (cyclomatic 19) rust/lance-jsonb/src/util.rs:53 — lance_jsonb::util::parse_escaped_string 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 · lance_linalg · ×1
  • lance_linalg::distance::arrow::dispatch (cyclomatic 19) rust/lance-linalg/src/distance/arrow.rs:140 — lance_linalg::distance::arrow::dispatch 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 · MemTableFlushHandler · ×1
  • MemTableFlushHandler::flush_memtable (cyclomatic 18) rust/lance/src/dataset/mem_wal/write/handlers.rs:456 — MemTableFlushHandler::flush_memtable 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 · KNNVectorDistanceExec · ×1
  • KNNVectorDistanceExec::execute_batch (cyclomatic 18) rust/lance/src/io/exec/knn.rs:786 — KNNVectorDistanceExec::execute_batch 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 · Schema · ×1
  • Schema::do_project (cyclomatic 18) rust/lance-core/src/datatypes/schema.rs:267 — Schema::do_project 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 · SharedStream · ×1
  • SharedStream::poll_next (cyclomatic 18) rust/lance-core/src/utils/futures.rs:130 — SharedStream::poll_next 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 · BinaryMiniBlockDecompressor · ×1
  • BinaryMiniBlockDecompressor::decompress_range (cyclomatic 18) rust/lance-encoding/src/encodings/physical/binary.rs:942 — BinaryMiniBlockDecompressor::decompress_range 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 · KeepFiniteVectors · ×1
  • KeepFiniteVectors::transform (cyclomatic 18) rust/lance-index/src/vector/transform.rs:112 — KeepFiniteVectors::transform 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 · GooseFsStoreProvider · ×1
  • GooseFsStoreProvider::parse_decimal_times_unit (cyclomatic 18) rust/lance-io/src/object_store/providers/goosefs.rs:296 — GooseFsStoreProvider::parse_decimal_times_unit has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Builder.tokenizerParams (cyclomatic 18) · ×1
  • Builder.tokenizerParams (cyclomatic 18) java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java:483 — Builder.tokenizerParams has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LanceDataset.shallow_clone (cyclomatic 18) · ×1
  • LanceDataset.shallow_clone (cyclomatic 18) python/python/lance/dataset.py:4978 — LanceDataset.shallow_clone has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · udf.normalize_transform (cyclomatic 18) · ×1
  • udf.normalize_transform (cyclomatic 18) REDACTED:189 — udf.normalize_transform 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 · DatasetDelta · ×1
  • DatasetDelta::scan_rows (cyclomatic 17) rust/lance/src/dataset/delta.rs:553 — DatasetDelta::scan_rows 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 · FixedIntBackend · ×1
  • FixedIntBackend::insert_array_and_report_existing (cyclomatic 17) rust/lance/src/dataset/mem_wal/index/btree.rs:334 — FixedIntBackend::insert_array_and_report_existing has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Partition · ×1
  • Partition::maxscore_loop (cyclomatic 17) rust/lance/src/dataset/mem_wal/index/fts.rs:4775 — Partition::maxscore_loop 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 · MemTableScanExec · ×1
  • MemTableScanExec::execute (cyclomatic 17) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:224 — MemTableScanExec::execute 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 · CompactRowAddrRemap · ×1
  • CompactRowAddrRemap::remap_in_place_by_fragment (cyclomatic 17) rust/lance-core/src/utils/row_addr_remap.rs:956 — CompactRowAddrRemap::remap_in_place_by_fragment 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 · CoreFieldDecoderStrategy · ×1
  • CoreFieldDecoderStrategy::create_array_field_scheduler (cyclomatic 17) rust/lance-encoding/src/decoder.rs:1078 — CoreFieldDecoderStrategy::create_array_field_scheduler 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 · PlanarPrimitiveEncoding · ×1
  • PlanarPrimitiveEncoding::try_plan_pages (cyclomatic 17) rust/lance-encoding/src/encodings/logical/primitive/planar.rs:82 — PlanarPrimitiveEncoding::try_plan_pages has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · InvertedPartition · ×1
  • InvertedPartition::fetch_posting_lists (cyclomatic 17) rust/lance-index/src/scalar/inverted/index/partition.rs:1397 — InvertedPartition::fetch_posting_lists 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 · SargableQuery · ×1
  • SargableQuery::to_expr (cyclomatic 17) rust/lance-index/src/scalar.rs:284 — SargableQuery::to_expr has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Value · ×1
  • Value::fmt (cyclomatic 17) rust/lance-jsonb/src/value.rs:168 — Value::fmt has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MemTableBruteForceVectorExec · ×1
  • MemTableBruteForceVectorExec::compute_topk (cyclomatic 16) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:363 — MemTableBruteForceVectorExec::compute_topk 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 · MemTableDedupScanExec · ×1
  • MemTableDedupScanExec::execute (cyclomatic 16) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:185 — MemTableDedupScanExec::execute 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 · CoalesceFirstStream · ×1
  • CoalesceFirstStream::poll_next (cyclomatic 16) rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs:213 — CoalesceFirstStream::poll_next 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 · LsmScanPlanner · ×1
  • LsmScanPlanner::plan_scan (cyclomatic 16) rust/lance/src/dataset/mem_wal/scanner/planner.rs:150 — LsmScanPlanner::plan_scan 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 · SeedHarvester · ×1
  • SeedHarvester::harvest (cyclomatic 16) rust/lance/src/index/append.rs:642 — SeedHarvester::harvest 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 · IvfIndexBuilder · ×1
  • IvfIndexBuilder::build_partitions (cyclomatic 16) rust/lance/src/index/vector/builder.rs:1126 — IvfIndexBuilder::build_partitions 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 · LanceStream · ×1
  • LanceStream::try_new_v2 (cyclomatic 16) rust/lance/src/io/exec/scan.rs:184 — LanceStream::try_new_v2 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 · AimdConfig · ×1
  • AimdConfig::validate (cyclomatic 16) rust/lance-core/src/utils/aimd.rs:103 — AimdConfig::validate 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 · DictionaryDataBlock · ×1
  • DictionaryDataBlock::gather_fixed_width (cyclomatic 16) rust/lance-encoding/src/data.rs:1315 — DictionaryDataBlock::gather_fixed_width 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 · AccumulationQueue · ×1
  • AccumulationQueue::insert_with_pages (cyclomatic 16) rust/lance-encoding/src/utils/accumulation.rs:164 — AccumulationQueue::insert_with_pages 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 · BTreeIndex · ×1
  • BTreeIndex::search_with_options (cyclomatic 16) rust/lance-index/src/scalar/btree.rs:3207 — BTreeIndex::search_with_options 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: BTreeLookup::candidate_pages_for_values (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ShouldMaxScoreScorer · ×1
  • ShouldMaxScoreScorer::ensure_confirmed (cyclomatic 16) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:345 — ShouldMaxScoreScorer::ensure_confirmed 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 · JsonIndexPlugin · ×1
  • JsonIndexPlugin::convert_batch_by_type (cyclomatic 16) rust/lance-index/src/scalar/json.rs:1046 — JsonIndexPlugin::convert_batch_by_type 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 · RQTransformer · ×1
  • RQTransformer::transform (cyclomatic 16) rust/lance-index/src/vector/bq/transform.rs:446 — RQTransformer::transform 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 · OwnedJsonb · ×1
  • OwnedJsonb::from_item (cyclomatic 16) rust/lance-jsonb/src/core/util.rs:216 — OwnedJsonb::from_item 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: Number::decode (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 · WriteDatasetBuilder.execute (cyclomatic 16) · ×1
  • WriteDatasetBuilder.execute (cyclomatic 16) java/src/main/java/org/lance/WriteDatasetBuilder.java:390 — WriteDatasetBuilder.execute 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 · lance.dataset (cyclomatic 16) · ×1
  • lance.dataset (cyclomatic 16) python/python/lance/__init__.py:148 — lance.dataset 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 · pydantic.is_nullable (cyclomatic 16) · ×1
  • pydantic.is_nullable (cyclomatic 16) python/python/lance/pydantic.py:344 — pydantic.is_nullable has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · maintain.load_job (cyclomatic 16) · ×1
  • maintain.load_job (cyclomatic 16) skills/lance-table-maintenance/scripts/maintain.py:51 — maintain.load_job 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 · OrderableScalarValue · ×1
  • OrderableScalarValue::cmp (cognitive 144) rust/lance-index/src/scalar/btree.rs:197 — OrderableScalarValue::cmp has cognitive complexity 144 (threshold 15). Drivers by points: if/else 90 (135 pts), match/switch 4 (5 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · LanceDataset._create_index_impl (cognitive 134) · ×1
  • LanceDataset._create_index_impl (cognitive 134) python/python/lance/dataset.py:3667 — LanceDataset._create_index_impl has cognitive complexity 134 (threshold 15). Drivers by points: if/else 56 (112 pts), boolean chains 20, error handling 1, loops 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZoneMapIndex · ×1
  • ZoneMapIndex::evaluate_zone_against_query (cognitive 129) rust/lance-index/src/scalar/zonemap.rs:539 — ZoneMapIndex::evaluate_zone_against_query has cognitive complexity 129 (threshold 15). Drivers by points: if/else 45 (91 pts), match/switch 11 (25 pts), boolean chains 13 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RowIdSequence · ×1
  • RowIdSequence::mask_to_offset_ranges (cognitive 78) rust/lance-table/src/rowids.rs:658 — RowIdSequence::mask_to_offset_ranges has cognitive complexity 78 (threshold 15). Drivers by points: if/else 14 (48 pts), loops 8 (23 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BatchRefineExec · ×1
  • BatchRefineExec::refine (cognitive 76) rust/lance/src/io/exec/knn/refine.rs:127 — BatchRefineExec::refine has cognitive complexity 76 (threshold 15). Drivers by points: if/else 11 (51 pts), loops 8 (23 pts), boolean chains 2 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Merger · ×1
  • Merger::execute_batch (cognitive 75) rust/lance/src/dataset/write/merge_insert/merger.rs:271 — Merger::execute_batch has cognitive complexity 75 (threshold 15). Drivers by points: if/else 22 (52 pts), match/switch 6 (12 pts), loops 4 (11 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.
D2 · Cognitive Complexity · VariableFullZipDecoder · ×1
  • VariableFullZipDecoder::unzip (cognitive 75) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1138 — VariableFullZipDecoder::unzip has cognitive complexity 75 (threshold 15). Drivers by points: if/else 27 (55 pts), loops 6 (17 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilteredReadStream · ×1
  • FilteredReadStream::plan_scan (cognitive 68) rust/lance/src/io/exec/filtered_read.rs:902 — FilteredReadStream::plan_scan has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (61 pts), boolean chains 5, loops 2 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ReqOptScorer · ×1
  • ReqOptScorer::position (cognitive 66) rust/lance-index/src/scalar/inverted/compound.rs:3156 — ReqOptScorer::position has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (60 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PQDistCalculator · ×1
  • PQDistCalculator::accumulate_topk_with_scratch (cognitive 66) rust/lance-index/src/vector/pq/storage.rs:1200 — PQDistCalculator::accumulate_topk_with_scratch has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (42 pts), loops 5 (11 pts), boolean chains 9, match/switch 1 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackedStructVariablePerValueDecompressor · ×1
  • PackedStructVariablePerValueDecompressor::decompress (cognitive 62) rust/lance-encoding/src/encodings/physical/packed.rs:642 — PackedStructVariablePerValueDecompressor::decompress has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (42 pts), match/switch 5 (11 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Planner · ×1
  • Planner::parse_sql_expr (cognitive 58) rust/lance-datafusion/src/planner.rs:840 — Planner::parse_sql_expr has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 12 (24 pts), loops 3 (7 pts) (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BitpackedPageDecoder · ×1
  • BitpackedPageDecoder::decode (cognitive 56) rust/lance-encoding/src/array_encoding/physical/bitpack.rs:381 — BitpackedPageDecoder::decode has cognitive complexity 56 (threshold 15). Drivers by points: if/else 9 (35 pts), loops 5 (15 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KNNVectorDistanceExec · ×1
  • KNNVectorDistanceExec::execute_batch (cognitive 52) rust/lance/src/io/exec/knn.rs:786 — KNNVectorDistanceExec::execute_batch has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChunkInstructions · ×1
  • ChunkInstructions::schedule_instructions (cognitive 52) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1686 — ChunkInstructions::schedule_instructions has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RleEncoder · ×1
  • RleEncoder::encode_chunk_rolling_slice (cognitive 52) rust/lance-encoding/src/encodings/physical/rle.rs:776 — RleEncoder::encode_chunk_rolling_slice has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (45 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ScalarMemIndexExec · ×1
  • ScalarMemIndexExec::read_rows (cognitive 50) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scalar_index.rs:193 — ScalarMemIndexExec::read_rows has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 4 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompoundQueryExec · ×1
  • CompoundQueryExec::execute (cognitive 46) rust/lance/src/io/exec/fts/compound.rs:1049 — CompoundQueryExec::execute has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (29 pts), match/switch 5 (12 pts), boolean chains 5 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndexWorker · ×1
  • IndexWorker::process_document (cognitive 46) rust/lance-index/src/scalar/inverted/builder.rs:1852 — IndexWorker::process_document has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 4 (8 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompoundScorerPlan · ×1
  • CompoundScorerPlan::analyze_node (cognitive 44) rust/lance-index/src/scalar/inverted/compound.rs:497 — CompoundScorerPlan::analyze_node has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 7 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CommitBuilder · ×1
  • CommitBuilder::execute_inner (cognitive 43) rust/lance/src/dataset/write/commit.rs:378 — CommitBuilder::execute_inner has cognitive complexity 43 (threshold 15). Drivers by points: if/else 25 (33 pts), match/switch 5 (6 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SequenceCursor · ×1
  • SequenceCursor::fill (cognitive 41) rust/lance/src/dataset/delta.rs:900 — SequenceCursor::fill has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RowAddrMask · ×1
  • RowAddrMask::for_each_selected (cognitive 41) rust/lance-select/src/mask.rs:126 — RowAddrMask::for_each_selected has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (13 pts), boolean chains 2, match/switch 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 · LanceDataset._prepare_scalar_index_request (cognitive 41) · ×1
  • LanceDataset._prepare_scalar_index_request (cognitive 41) python/python/lance/dataset.py:3183 — LanceDataset._prepare_scalar_index_request has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 7 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FetchedPostings · ×1
  • FetchedPostings::into_loaded (cognitive 40) rust/lance-index/src/scalar/inverted/index/partition.rs:1706 — FetchedPostings::into_loaded has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (8 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonFlattener · ×1
  • JsonFlattener::flatten (cognitive 40) rust/lance-index/src/scalar/inverted/tokenizer/document_tokenizer.rs:526 — JsonFlattener::flatten has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 5 (12 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 20). 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 · FtsIndexExec · ×1
  • FtsIndexExec::materialize_rows_sorted (cognitive 39) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:332 — FtsIndexExec::materialize_rows_sorted has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 5 (9 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TakeOperation · ×1
  • TakeOperation::try_from_expr (cognitive 38) rust/lance/src/dataset/scanner/source.rs:128 — TakeOperation::try_from_expr has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 4 (13 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlanarSparseTask · ×1
  • PlanarSparseTask::decode_checked (cognitive 38) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:1068 — PlanarSparseTask::decode_checked has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 3 (10 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LanceDataset.__iter__ (cognitive 38) · ×1
  • LanceDataset.__iter__ (cognitive 38) python/python/lance/torch/data.py:369 — LanceDataset.__iter__ has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanner._build_vector_search_query (cognitive 37) · ×1
  • scanner._build_vector_search_query (cognitive 37) python/python/lance/_dataset/scanner.py:472 — scanner._build_vector_search_query has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 10 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FixedWidthDataBlock · ×1
  • FixedWidthDataBlock::byte_position_entropy (cognitive 36) rust/lance-encoding/src/statistics.rs:514 — FixedWidthDataBlock::byte_position_entropy has cognitive complexity 36 (threshold 15). Drivers by points: loops 9 (18 pts), if/else 9 (16 pts), boolean chains 2 (nesting depth added 16). 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 · LazyLevels · ×1
  • LazyLevels::seek_row_start (cognitive 36) rust/lance-encoding/src/encodings/logical/primitive/all_null.rs:440 — LazyLevels::seek_row_start has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (11 pts), boolean chains 2, match/switch 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 · FullZipScheduler · ×1
  • FullZipScheduler::schedule_list_structure (cognitive 36) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode/structure.rs:29 — FullZipScheduler::schedule_list_structure has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndexDescriptionImpl · ×1
  • IndexDescriptionImpl::try_new (cognitive 35) rust/lance/src/index/statistics.rs:152 — IndexDescriptionImpl::try_new has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FixedFullZipDecodeTask · ×1
  • FixedFullZipDecodeTask::decode (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1733 — FixedFullZipDecodeTask::decode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 3 (7 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BitmapIndex · ×1
  • BitmapIndex::search_with_options (cognitive 35) rust/lance-index/src/scalar/bitmap.rs:1078 — BitmapIndex::search_with_options has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LateSearchProgress · ×1
  • LateSearchProgress::plan_round (cognitive 34) rust/lance/src/io/exec/knn/batch_probe.rs:295 — LateSearchProgress::plan_round has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobV2StructuralEncoder · ×1
  • BlobV2StructuralEncoder::maybe_encode (cognitive 34) rust/lance-encoding/src/encodings/logical/blob.rs:256 — BlobV2StructuralEncoder::maybe_encode has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · FileScheduler · ×1
  • FileScheduler::submit_request (cognitive 34) rust/lance-io/src/scheduler.rs:1432 — FileScheduler::submit_request has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemTableScanExec · ×1
  • MemTableScanExec::execute (cognitive 33) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:224 — MemTableScanExec::execute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 5 (10 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SharedStream · ×1
  • SharedStream::poll_next (cognitive 33) rust/lance-core/src/utils/futures.rs:130 — SharedStream::poll_next has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 6 (9 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytesBackend · ×1
  • BytesBackend::insert_array_and_report_existing (cognitive 32) rust/lance/src/dataset/mem_wal/index/btree.rs:538 — BytesBackend::insert_array_and_report_existing has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemTableFlushHandler · ×1
  • MemTableFlushHandler::flush_memtable (cognitive 32) rust/lance/src/dataset/mem_wal/write/handlers.rs:456 — MemTableFlushHandler::flush_memtable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 4 (7 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaskDispatcher · ×1
  • TaskDispatcher::run (cognitive 32) rust/lance/src/dataset/mem_wal/write/tasks.rs:47 — TaskDispatcher::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 4 (14 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartitionAdjuster · ×1
  • PartitionAdjuster::join_partitions_impl (cognitive 32) rust/lance/src/index/vector/builder.rs:2893 — PartitionAdjuster::join_partitions_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (14 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TakeStream · ×1
  • TakeStream::map_batch (cognitive 32) rust/lance/src/io/exec/take.rs:255 — TakeStream::map_batch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 4 (7 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RepDefUnraveler · ×1
  • RepDefUnraveler::unravel_offsets (cognitive 32) rust/lance-encoding/src/repdef.rs:2041 — RepDefUnraveler::unravel_offsets has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (5 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemTableDedupScanExec · ×1
  • MemTableDedupScanExec::execute (cognitive 31) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:185 — MemTableDedupScanExec::execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 3 (8 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.
D2 · Cognitive Complexity · RabitQuantizationStorage · ×1
  • RabitQuantizationStorage::raw_query_factors (cognitive 31) rust/lance-index/src/vector/bq/storage.rs:655 — RabitQuantizationStorage::raw_query_factors has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FlatIndex · ×1
  • FlatIndex::search_with_scratch (cognitive 31) rust/lance-index/src/vector/flat/index.rs:251 — FlatIndex::search_with_scratch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CoalesceFirstStream · ×1
  • CoalesceFirstStream::poll_next (cognitive 30) rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs:213 — CoalesceFirstStream::poll_next has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 3 (7 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 · LanceStream · ×1
  • LanceStream::try_new_v2 (cognitive 30) rust/lance/src/io/exec/scan.rs:184 — LanceStream::try_new_v2 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LookupKeys · ×1
  • LookupKeys::match_page (cognitive 30) rust/lance-index/src/scalar/btree.rs:1765 — LookupKeys::match_page has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4 (8 pts), boolean chains 7, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonbItem · ×1
  • JsonbItem::partial_cmp (cognitive 30) rust/lance-jsonb/src/core/item.rs:167 — JsonbItem::partial_cmp has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (29 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · udf.normalize_transform (cognitive 30) · ×1
  • udf.normalize_transform (cognitive 30) REDACTED:189 — udf.normalize_transform has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KMeans · ×1
  • KMeans::train_kmeans (cognitive 29) rust/lance-index/src/vector/kmeans.rs:1191 — KMeans::train_kmeans has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataset.write_dataset (cognitive 29) · ×1
  • dataset.write_dataset (cognitive 29) python/python/lance/dataset.py:5777 — dataset.write_dataset has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LanceEncodingsIo · ×1
  • LanceEncodingsIo::submit_request (cognitive 28) rust/lance-file/src/io.rs:62 — LanceEncodingsIo::submit_request has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 5 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragReuseLedger · ×1
  • FragReuseLedger::decode_content (cognitive 28) rust/lance-table/src/system_index/frag_reuse/ledger.rs:182 — FragReuseLedger::decode_content has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (7 pts), match/switch 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 · Checker.run (cognitive 28) · ×1
  • Checker.run (cognitive 28) skills/lance-table-maintenance/scripts/conformance.py:80 — Checker.run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 6 (10 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddRowAddrExec · ×1
  • AddRowAddrExec::compute_row_addrs (cognitive 27) rust/lance/src/io/exec/rowids.rs:131 — AddRowAddrExec::compute_row_addrs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (6 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RawInvertedIndexParams · ×1
  • RawInvertedIndexParams::resolve (cognitive 27) rust/lance-index/src/scalar/inverted/tokenizer.rs:288 — RawInvertedIndexParams::resolve has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 3, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · JsonIndexPlugin · ×1
  • JsonIndexPlugin::convert_batch_by_type (cognitive 27) rust/lance-index/src/scalar/json.rs:1046 — JsonIndexPlugin::convert_batch_by_type has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RQPairScorer · ×1
  • RQPairScorer::stage (cognitive 27) rust/lance-index/src/vector/bq/pairwise.rs:138 — RQPairScorer::stage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 3 (6 pts), match/switch 3 (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 · FixedFullZipDecoder · ×1
  • FixedFullZipDecoder::slice_next_task (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:666 — FixedFullZipDecoder::slice_next_task has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryMiniBlockDecompressor · ×1
  • BinaryMiniBlockDecompressor::decompress_range (cognitive 26) rust/lance-encoding/src/encodings/physical/binary.rs:942 — BinaryMiniBlockDecompressor::decompress_range has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BTreeLookup · ×1
  • BTreeLookup::pages_between (cognitive 26) rust/lance-index/src/scalar/btree.rs:1181 — BTreeLookup::pages_between has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 7 (10 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 · ZoneSplitAssembler · ×1
  • ZoneSplitAssembler::next_zone (cognitive 26) rust/lance-index/src/scalar/zoned.rs:364 — ZoneSplitAssembler::next_zone has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 5, 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 · ProductQuantizer · ×1
  • ProductQuantizer::transform_impl (cognitive 26) rust/lance-index/src/vector/pq.rs:205 — ProductQuantizer::transform_impl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pydantic.is_nullable (cognitive 26) · ×1
  • pydantic.is_nullable (cognitive 26) python/python/lance/pydantic.py:344 — pydantic.is_nullable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · BackgroundExecutor · ×1
  • BackgroundExecutor::block_on_pumping (cognitive 25) python/src/executor.rs:191 — BackgroundExecutor::block_on_pumping has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 4 (10 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SymbolTable · ×1
  • SymbolTable::finalize (cognitive 25) rust/compression/fsst/src/fsst.rs:428 — SymbolTable::finalize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (8 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HnswGraph · ×1
  • HnswGraph::visit_published_neighbors (cognitive 25) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:1023 — HnswGraph::visit_published_neighbors has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BucketScan · ×1
  • BucketScan::pop_candidate (cognitive 25) rust/lance-index/src/scalar/minhash_lsh/index.rs:1279 — BucketScan::pop_candidate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MergeState · ×1
  • MergeState::process_row_action (cognitive 24) rust/lance/src/dataset/write/merge_insert/exec/write.rs:160 — MergeState::process_row_action has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 3 (6 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.
D2 · Cognitive Complexity · IvfIndexBuilder · ×1
  • IvfIndexBuilder::build_partitions (cognitive 24) rust/lance/src/index/vector/builder.rs:1126 — IvfIndexBuilder::build_partitions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StablePartitionMapping · ×1
  • StablePartitionMapping::remap_row_ids (cognitive 24) rust/lance-index/src/frag_reuse/stable_partition.rs:165 — StablePartitionMapping::remap_row_ids has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatisticsAccumulator · ×1
  • StatisticsAccumulator::update_item (cognitive 23) rust/arrow-stats/src/lib.rs:207 — StatisticsAccumulator::update_item has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RepDefBuilder · ×1
  • RepDefBuilder::concat_layers (cognitive 23) rust/lance-encoding/src/repdef.rs:1722 — RepDefBuilder::concat_layers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (7 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TupleQuery · ×1
  • TupleQuery::try_new (cognitive 23) rust/lance-index/src/scalar/tuple.rs:107 — TupleQuery::try_new has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateConfig.<init> (cognitive 23) · ×1
  • UpdateConfig.<init> (cognitive 23) java/src/main/java/org/lance/operation/UpdateConfig.java:105 — UpdateConfig.<init> has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lance.dataset (cognitive 23) · ×1
  • lance.dataset (cognitive 23) python/python/lance/__init__.py:148 — lance.dataset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · maintain.load_job (cognitive 23) · ×1
  • maintain.load_job (cognitive 23) skills/lance-table-maintenance/scripts/maintain.py:51 — maintain.load_job has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlannedHopRemapper · ×1
  • PlannedHopRemapper::remap_row_ids (cognitive 22) rust/lance/src/dataset/optimize/remapping.rs:759 — PlannedHopRemapper::remap_row_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (8 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Updater · ×1
  • Updater::update_batches (cognitive 22) rust/lance/src/dataset/updater.rs:314 — Updater::update_batches has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UpdateJob · ×1
  • UpdateJob::execute_impl (cognitive 22) rust/lance/src/dataset/write/update.rs:407 — UpdateJob::execute_impl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 2, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TileJobs · ×1
  • TileJobs::next_job (cognitive 22) rust/lance/src/index/vector/dedup.rs:497 — TileJobs::next_job has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BooleanQueryExec · ×1
  • BooleanQueryExec::execute (cognitive 22) rust/lance/src/io/exec/fts/boolean.rs:478 — BooleanQueryExec::execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 7 (11 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 · ArrayFieldEncodingStrategy · ×1
  • ArrayFieldEncodingStrategy::validate_v2_0_array_reachability (cognitive 22) rust/lance-encoding/src/array_encoding/strategy.rs:298 — ArrayFieldEncodingStrategy::validate_v2_0_array_reachability has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageBufferReader · ×1
  • PageBufferReader::new (cognitive 22) rust/lance-file/src/concat.rs:755 — PageBufferReader::new has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenSet · ×1
  • TokenSet::get_many (cognitive 22) rust/lance-index/src/scalar/inverted/index/token_set.rs:263 — TokenSet::get_many has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 3 (6 pts), loops 3 (5 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.
D2 · Cognitive Complexity · IvfShuffler · ×1
  • IvfShuffler::shuffle_to_partitions (cognitive 22) rust/lance-index/src/vector/ivf/shuffler.rs:655 — IvfShuffler::shuffle_to_partitions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 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.
D2 · Cognitive Complexity · GooseFsStoreProvider · ×1
  • GooseFsStoreProvider::parse_decimal_times_unit (cognitive 22) rust/lance-io/src/object_store/providers/goosefs.rs:296 — GooseFsStoreProvider::parse_decimal_times_unit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (18 pts), match/switch 2 (3 pts), boolean chains 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.
D2 · Cognitive Complexity · AimdHttpService · ×1
  • AimdHttpService::call (cognitive 22) rust/lance-io/src/object_store/throttle.rs:950 — AimdHttpService::call has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WriteDatasetBuilder.executeWithNamespaceClient (cognitive 22) · ×1
  • WriteDatasetBuilder.executeWithNamespaceClient (cognitive 22) java/src/main/java/org/lance/WriteDatasetBuilder.java:442 — WriteDatasetBuilder.executeWithNamespaceClient has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, ternaries 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 · LanceDataset.shallow_clone (cognitive 22) · ×1
  • LanceDataset.shallow_clone (cognitive 22) python/python/lance/dataset.py:4978 — LanceDataset.shallow_clone has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · data._to_tensor (cognitive 22) · ×1
  • data._to_tensor (cognitive 22) python/python/lance/torch/data.py:114 — data._to_tensor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutputSeedAccumulator · ×1
  • OutputSeedAccumulator::finish (cognitive 21) rust/lance/src/dataset/optimize/binary_copy/seed_carry.rs:254 — OutputSeedAccumulator::finish has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (6 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeightedCoreset · ×1
  • WeightedCoreset::reduce_to_budget (cognitive 21) rust/lance/src/index/vector/ivf.rs:4934 — WeightedCoreset::reduce_to_budget has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (13 pts), if/else 5 (8 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ZoneMapSeedWriter · ×1
  • ZoneMapSeedWriter::decode_seed (cognitive 21) rust/lance-index/src/scalar/zonemap.rs:2436 — ZoneMapSeedWriter::decode_seed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Expr · ×1
  • Expr::fmt (cognitive 21) rust/lance-jsonb/src/jsonpath/path.rs:492 — Expr::fmt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 2, 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 · FragmentRowIdIndex · ×1
  • FragmentRowIdIndex::get_many (cognitive 21) rust/lance-table/src/rowids/index/sparse.rs:49 — FragmentRowIdIndex::get_many has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (17 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sampler._filtered_efficient_sample (cognitive 21) · ×1
  • sampler._filtered_efficient_sample (cognitive 21) python/python/lance/sampler.py:117 — sampler._filtered_efficient_sample has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FtsTokenizerOptions · ×1
  • FtsTokenizerOptions::apply (cognitive 20) python/src/fts.rs:63 — FtsTokenizerOptions::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DeletionVector · ×1
  • DeletionVector::build_keep_mask (cognitive 20) rust/lance-core/src/utils/deletion.rs:124 — DeletionVector::build_keep_mask has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 1 (4 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.
D2 · Cognitive Complexity · VariablePackedFieldData · ×1
  • VariablePackedFieldData::append_row_bytes (cognitive 20) rust/lance-encoding/src/encodings/physical/packed.rs:267 — VariablePackedFieldData::append_row_bytes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (3 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.
D2 · Cognitive Complexity · AccumulationQueue · ×1
  • AccumulationQueue::insert_with_pages (cognitive 20) rust/lance-encoding/src/utils/accumulation.rs:164 — AccumulationQueue::insert_with_pages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RTreeIndex · ×1
  • RTreeIndex::search_bbox (cognitive 20) rust/lance-geo/src/rtree.rs:477 — RTreeIndex::search_bbox has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BloomFilterIndex · ×1
  • BloomFilterIndex::evaluate_block_against_query (cognitive 20) rust/lance-index/src/scalar/bloomfilter.rs:320 — BloomFilterIndex::evaluate_block_against_query has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (6 pts), loops 1 (2 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 · Interval · ×1
  • Interval::fmt (cognitive 20) rust/lance-jsonb/src/extension.rs:157 — Interval::fmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (20 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawJsonb · ×1
  • RawJsonb::partial_cmp (cognitive 20) rust/lance-jsonb/src/raw.rs:162 — RawJsonb::partial_cmp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 5 (6 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChunkEncoder · ×1
  • ChunkEncoder::flush_chunk (cognitive 20) rust/lance-table/src/rowids.rs:1073 — ChunkEncoder::flush_chunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanner._coerce_query_vector (cognitive 20) · ×1
  • scanner._coerce_query_vector (cognitive 20) python/python/lance/_dataset/scanner.py:421 — scanner._coerce_query_vector has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorIndexExec · ×1
  • VectorIndexExec::materialize_rows (cognitive 19) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:201 — VectorIndexExec::materialize_rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlatCombinedFieldsExec · ×1
  • FlatCombinedFieldsExec::execute (cognitive 19) rust/lance/src/io/exec/fts/flat_combined_fields.rs:367 — FlatCombinedFieldsExec::execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveRows · ×1
  • LiveRows::filter (cognitive 19) rust/lance/src/io/exec/ordered_index_scan.rs:405 — LiveRows::filter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lance_arrow · ×1
  • lance_arrow::json::convert_json_array (cognitive 19) rust/lance-arrow/src/json.rs:461 — lance_arrow::json::convert_json_array has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BatchReaderChunker · ×1
  • BatchReaderChunker::next_sized (cognitive 19) rust/lance-datafusion-exec/src/chunker.rs:60 — BatchReaderChunker::next_sized has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobPageScheduler · ×1
  • BlobPageScheduler::schedule_ranges (cognitive 19) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:365 — BlobPageScheduler::schedule_ranges has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RTreeIndexPlugin · ×1
  • RTreeIndexPlugin::write_index (cognitive 19) rust/lance-geo/src/rtree.rs:1243 — RTreeIndexPlugin::write_index has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 4 (9 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ScalarIndexExpr · ×1
  • ScalarIndexExpr::optimize_and_leaves (cognitive 19) rust/lance-index/src/scalar/expression.rs:1859 — ScalarIndexExpr::optimize_and_leaves has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BooleanScorer · ×1
  • BooleanScorer::try_new (cognitive 19) rust/lance-index/src/scalar/inverted/compound.rs:3420 — BooleanScorer::try_new has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnlineHnswBuilder · ×1
  • OnlineHnswBuilder::insert_with_generator (cognitive 19) rust/lance-index/src/vector/hnsw/online.rs:238 — OnlineHnswBuilder::insert_with_generator has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 6 (9 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Deserializer · ×1
  • Deserializer::read_with_jentry (cognitive 19) rust/lance-jsonb/src/core/de.rs:264 — Deserializer::read_with_jentry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 2 (3 pts) (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 · scanner._needs_substrait_placeholder (cognitive 19) · ×1
  • scanner._needs_substrait_placeholder (cognitive 19) python/python/lance/_dataset/scanner.py:320 — scanner._needs_substrait_placeholder has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · new_contributors.resolve_usernames_via_api (cognitive 19) · ×1
  • new_contributors.resolve_usernames_via_api (cognitive 19) ci/new_contributors.py:105 — new_contributors.resolve_usernames_via_api has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · new_contributors.main (cognitive 19) · ×1
  • new_contributors.main (cognitive 19) ci/new_contributors.py:183 — new_contributors.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 6 (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 · LanceTableProvider · ×1
  • LanceTableProvider::scan (cognitive 18) rust/lance/src/datafusion/dataframe.rs:155 — LanceTableProvider::scan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SqlQueryBuilder · ×1
  • SqlQueryBuilder::build (cognitive 18) rust/lance/src/dataset/sql.rs:262 — SqlQueryBuilder::build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Evaluator · ×1
  • Evaluator::apply (cognitive 18) rust/lance/src/dataset/write/merge_insert/exec/condition.rs:254 — Evaluator::apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 2 (3 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DatasetPreFilter · ×1
  • DatasetPreFilter::create_deletion_mask_impl (cognitive 18) rust/lance/src/index/prefilter.rs:368 — DatasetPreFilter::create_deletion_mask_impl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PQIndex · ×1
  • PQIndex::search (cognitive 18) rust/lance/src/index/vector/pq.rs:304 — PQIndex::search has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoProbePolicy · ×1
  • AutoProbePolicy::apply (cognitive 18) rust/lance/src/io/exec/knn/adaptive_probe.rs:72 — AutoProbePolicy::apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 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.
D2 · Cognitive Complexity · BlobDescriptionDecodePageTask · ×1
  • BlobDescriptionDecodePageTask::decode (cognitive 18) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:148 — BlobDescriptionDecodePageTask::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SparsePositionPlan · ×1
  • SparsePositionPlan::validate_domain (cognitive 18) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:401 — SparsePositionPlan::validate_domain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), boolean chains 1, 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 · HuffmanWaveletTree · ×1
  • HuffmanWaveletTree::build (cognitive 18) rust/lance-index/src/scalar/fmindex.rs:282 — HuffmanWaveletTree::build has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (10 pts), if/else 4 (7 pts), match/switch 1 (nesting depth added 5). 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, 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 · InnerBuilder · ×1
  • InnerBuilder::write_posting_lists (cognitive 18) rust/lance-index/src/scalar/inverted/builder.rs:1419 — InnerBuilder::write_posting_lists has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadBatchParams · ×1
  • ReadBatchParams::slice (cognitive 18) rust/lance-io/src/lib.rs:159 — ReadBatchParams::slice has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). 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 · BitmapSlice · ×1
  • BitmapSlice::count_ones (cognitive 18) rust/lance-table/src/rowids/bitmap.rs:146 — BitmapSlice::count_ones has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HoleRuns · ×1
  • HoleRuns::from_bitmap (cognitive 18) rust/lance-table/src/rowids/runs.rs:87 — HoleRuns::from_bitmap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WalAppender · ×1
  • WalAppender::append_for_target (cognitive 17) rust/lance/src/dataset/mem_wal/wal.rs:1280 — WalAppender::append_for_target has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeleteOnlyMergeInsertExec · ×1
  • DeleteOnlyMergeInsertExec::collect_deletions (cognitive 17) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:114 — DeleteOnlyMergeInsertExec::collect_deletions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 1 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlatMatchQueryExec · ×1
  • FlatMatchQueryExec::execute (cognitive 17) rust/lance/src/io/exec/fts/flat_match.rs:1001 — FlatMatchQueryExec::execute has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 8 (11 pts), if/else 3 (6 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.
D2 · Cognitive Complexity · ANNIvfSubIndexExec · ×1
  • ANNIvfSubIndexExec::late_search (cognitive 17) rust/lance/src/io/exec/knn.rs:2261 — ANNIvfSubIndexExec::late_search has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AddRowOffsetExec · ×1
  • AddRowOffsetExec::compute_row_offsets (cognitive 17) rust/lance/src/io/exec/rowids.rs:469 — AddRowOffsetExec::compute_row_offsets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadGuard · ×1
  • LoadGuard::finish (cognitive 17) rust/lance-core/src/cache/diagnostics.rs:866 — LoadGuard::finish has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlanarPrimitiveEncoding · ×1
  • PlanarPrimitiveEncoding::try_plan_pages (cognitive 17) rust/lance-encoding/src/encodings/logical/primitive/planar.rs:82 — PlanarPrimitiveEncoding::try_plan_pages has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SparseStructuralUnraveler · ×1
  • SparseStructuralUnraveler::unravel_offsets (cognitive 17) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:986 — SparseStructuralUnraveler::unravel_offsets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 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 · RabitDistCalculator · ×1
  • RabitDistCalculator::accumulate_partition_survivor_rows (cognitive 17) rust/lance-index/src/vector/bq/storage/scan.rs:445 — RabitDistCalculator::accumulate_partition_survivor_rows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListRetryStream · ×1
  • ListRetryStream::poll_next (cognitive 17) rust/lance-io/src/object_store/list_retry.rs:116 — ListRetryStream::poll_next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (5 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 · RecursiveLevel · ×1
  • RecursiveLevel::check_recursive_level (cognitive 17) rust/lance-jsonb/src/jsonpath/path.rs:159 — RecursiveLevel::check_recursive_level has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Builder.tokenizerParams (cognitive 17) · ×1
  • Builder.tokenizerParams (cognitive 17) java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java:483 — Builder.tokenizerParams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WriteDatasetBuilder.execute (cognitive 17) · ×1
  • WriteDatasetBuilder.execute (cognitive 17) java/src/main/java/org/lance/WriteDatasetBuilder.java:390 — WriteDatasetBuilder.execute 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.
D2 · Cognitive Complexity · LanceDataset.scanner (cognitive 17) · ×1
  • LanceDataset.scanner (cognitive 17) python/python/lance/dataset.py:515 — LanceDataset.scanner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pydantic._pydantic_type_to_arrow_type (cognitive 17) · ×1
  • pydantic._pydantic_type_to_arrow_type (cognitive 17) python/python/lance/pydantic.py:270 — pydantic._pydantic_type_to_arrow_type has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (17 pts) (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · lance_arrow_stats · ×1
  • lance_arrow_stats::find_min_max_indices (cognitive 16) rust/arrow-stats/src/lib.rs:453 — lance_arrow_stats::find_min_max_indices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LocalBackpressureController · ×1
  • LocalBackpressureController::maybe_apply_backpressure (cognitive 16) rust/lance/src/dataset/mem_wal/write/backpressure.rs:536 — LocalBackpressureController::maybe_apply_backpressure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RowStreamRead · ×1
  • RowStreamRead::plan_batch_from_row_ids (cognitive 16) rust/lance/src/io/exec/filtered_read.rs:3346 — RowStreamRead::plan_batch_from_row_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AimdConfig · ×1
  • AimdConfig::validate (cognitive 16) rust/lance-core/src/utils/aimd.rs:103 — AimdConfig::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CycleNanGenerator · ×1
  • CycleNanGenerator::generate (cognitive 16) rust/lance-datagen/src/generator.rs:129 — CycleNanGenerator::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 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 · NullGenerator · ×1
  • NullGenerator::generate (cognitive 16) rust/lance-datagen/src/generator.rs:299 — NullGenerator::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataBlock · ×1
  • DataBlock::from_arrays_impl (cognitive 16) rust/lance-encoding/src/data.rs:2676 — DataBlock::from_arrays_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 3 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · StructuralPrimitiveFieldDecoder · ×1
  • StructuralPrimitiveFieldDecoder::plan_decoded_bytes (cognitive 16) rust/lance-encoding/src/encodings/logical/primitive/field.rs:1143 — StructuralPrimitiveFieldDecoder::plan_decoded_bytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResidentColumnStore · ×1
  • ResidentColumnStore::attach (cognitive 16) rust/lance-index/src/vector/bq/resident.rs:684 — ResidentColumnStore::attach has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (7 pts), if/else 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProductQuantizationStorage · ×1
  • ProductQuantizationStorage::new_with_remapper (cognitive 16) rust/lance-index/src/vector/pq/storage.rs:242 — ProductQuantizationStorage::new_with_remapper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lance_index_core · ×1
  • lance_index_core::remapping::materialize_remap (cognitive 16) rust/lance-index-core/src/remapping.rs:167 — lance_index_core::remapping::materialize_remap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (7 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 · ObjectWriter · ×1
  • ObjectWriter::poll_tasks (cognitive 16) rust/lance-io/src/object_writer.rs:400 — ObjectWriter::poll_tasks has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (12 pts), loops 2 (4 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 · lance_namespace_impls · ×1
  • lance_namespace_impls::dir::query::build_engine_fts_query (cognitive 16) rust/lance-namespace-impls/src/dir/query.rs:242 — lance_namespace_impls::dir::query::build_engine_fts_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (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.
D2 · Cognitive Complexity · fragment.write_fragments (cognitive 16) · ×1
  • fragment.write_fragments (cognitive 16) python/python/lance/fragment.py:1585 — fragment.write_fragments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, 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 · pydantic._unwrap_optional_annotation (cognitive 16) · ×1
  • pydantic._unwrap_optional_annotation (cognitive 16) python/python/lance/pydantic.py:312 — pydantic._unwrap_optional_annotation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (6 members, 31 shared lines) · ×1
  • Near-duplicate member family (6 members, 31 shared lines) java/lance-jni/src/namespace.rs:353 — java/lance-jni/src/namespace.rs:353-424 | java/lance-jni/src/namespace.rs:494-566 | java/lance-jni/src/namespace.rs:577-656 | java/lance-jni/src/namespace.rs:670-748 | java/lance-jni/src/namespace.rs:759-829 | java/lance-jni/src/namespace.rs:844-938 — These 6 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 31 shared lines) · ×1
  • Near-duplicate member family (5 members, 31 shared lines) java/lance-jni/src/namespace.rs:353 — java/lance-jni/src/namespace.rs:353-424 | java/lance-jni/src/namespace.rs:435-483 | java/lance-jni/src/namespace.rs:494-566 | java/lance-jni/src/namespace.rs:577-656 | java/lance-jni/src/namespace.rs:759-829 — These 5 members are variants of one another: a block of 31 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, 37 shared lines) · ×1
  • Near-duplicate member family (4 members, 37 shared lines) rust/lance/src/dataset/write/delete.rs:55 — rust/lance/src/dataset/write/delete.rs:55-96 | rust/lance/src/dataset/write/merge_insert/exec.rs:85-126 | rust/lance/src/dataset/write/merge_insert/job.rs:1823-1864 | rust/lance/src/dataset/write/update.rs:828-869 — These 4 members are variants of one another: a block of 37 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 (4 members, 18 shared lines) · ×1
  • Near-duplicate member family (4 members, 18 shared lines) rust/lance/src/index/scalar/bloomfilter.rs:21 — rust/lance/src/index/scalar/bloomfilter.rs:21-108 | rust/lance/src/index/scalar/minhash_lsh.rs:26-112 | rust/lance/src/index/scalar/rtree.rs:22-74 | rust/lance/src/index/scalar/zonemap.rs:37-112 — These 4 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 pair (111 shared lines) · ×1
  • Near-duplicate member pair (111 shared lines) rust/lance/src/dataset/scanner/fts.rs:1660 — rust/lance/src/dataset/scanner/fts.rs:1660-1830 | rust/lance/src/dataset/scanner/fts.rs:2022-2188 — These two members are variants of one another: 111 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (66 shared lines) · ×1
  • Near-duplicate member pair (66 shared lines) rust/lance-encoding/src/encodings/physical/alp.rs:1338 — rust/lance-encoding/src/encodings/physical/alp.rs:1338-1450 | rust/lance-encoding/src/encodings/physical/alp.rs:1463-1574 — These two members are variants of one another: 66 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (59 shared lines) · ×1
  • Near-duplicate member pair (59 shared lines) rust/lance/src/io/exec/fts/match_query.rs:579 — rust/lance/src/io/exec/fts/match_query.rs:579-721 | rust/lance/src/io/exec/fts/phrase.rs:503-622 — These two members are variants of one another: 59 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 (52 shared lines) · ×1
  • Near-duplicate member pair (52 shared lines) rust/lance-encoding/src/encodings/physical/alp.rs:803 — rust/lance-encoding/src/encodings/physical/alp.rs:803-958 | rust/lance-encoding/src/encodings/physical/alp.rs:1037-1198 — These two members are variants of one another: 52 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/lance/src/dataset/hash_joiner.rs:171 — rust/lance/src/dataset/hash_joiner.rs:171-236 | rust/lance/src/dataset/hash_joiner.rs:260-318 — 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 (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) rust/lance-file/src/versions/v2_0/writer.rs:858 — rust/lance-file/src/versions/v2_0/writer.rs:858-947 | rust/lance-file/src/writer/structural.rs:843-924 — These two members are variants of one another: 40 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 (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) rust/lance-io/src/object_store/providers/oss.rs:111 — rust/lance-io/src/object_store/providers/oss.rs:111-161 | rust/lance-io/src/object_store/providers/tos.rs:117-167 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) java/lance-jni/src/async_scanner.rs:277 — java/lance-jni/src/async_scanner.rs:277-325 | java/lance-jni/src/blocking_scanner.rs:760-801 — 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 · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) rust/lance-datafusion-exec/src/udf/json.rs:319 — rust/lance-datafusion-exec/src/udf/json.rs:319-341 | rust/lance-datafusion-exec/src/udf/json.rs:485-506 | rust/lance-datafusion-exec/src/udf/json.rs:547-572 | rust/lance-datafusion-exec/src/udf/json.rs:600-628 | rust/lance-datafusion-exec/src/udf/json.rs:656-684 | rust/lance-datafusion-exec/src/udf/json.rs:712-740 | rust/lance-datafusion-exec/src/udf/json.rs:768-796 | rust/lance-datafusion-exec/src/udf/json.rs:926-949 — 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/lance/src/io/exec/fts/flat_combined_fields.rs:371 — rust/lance/src/io/exec/fts/flat_combined_fields.rs:371-531 | rust/lance/src/io/exec/fts/flat_match.rs:411-535 | rust/lance/src/io/exec/fts/flat_match.rs:1005-1190 | rust/lance/src/io/exec/knn.rs:987-1061 | rust/lance/src/io/exec/rowids.rs:185-235 | rust/lance/src/io/exec/scalar_index.rs:708-787 — 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 (105 corresponding lines) · ×1
  • Edited copy of a member (105 corresponding lines) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:580 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:580-684 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:692-809 — These two members are one piece of code written twice and then edited apart: 105 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) rust/lance-file/src/versions/v2_1/reader.rs:26 — rust/lance-file/src/versions/v2_1/reader.rs:26-106 | rust/lance-file/src/versions/v2_2/reader.rs:26-112 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (99 corresponding lines) · ×1
  • Edited copy of a member (99 corresponding lines) rust/lance/src/dataset/fragment.rs:3976 — rust/lance/src/dataset/fragment.rs:3976-4089 | rust/lance/src/dataset/fragment.rs:4186-4284 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (85 corresponding lines) · ×1
  • Edited copy of a member (85 corresponding lines) rust/lance-index/src/vector/bq/storage.rs:1158 — rust/lance-index/src/vector/bq/storage.rs:1158-1272 | rust/lance-index/src/vector/bq/storage.rs:1282-1366 — These two members are one piece of code written twice and then edited apart: 85 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (82 corresponding lines) · ×1
  • Edited copy of a member (82 corresponding lines) rust/lance-encoding/src/encodings/physical/rle.rs:1840 — rust/lance-encoding/src/encodings/physical/rle.rs:1840-1936 | rust/lance-encoding/src/encodings/physical/rle.rs:2032-2113 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 66+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 66+ corresponding lines) rust/lance-encoding/src/encodings/physical/alp/restore.rs:365 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:365-438 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:450-519 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:602-667 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 66 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is 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 (87 corresponding lines) · ×1
  • Edited copy of a member (87 corresponding lines) rust/lance-table/src/rowids.rs:1180 — rust/lance-table/src/rowids.rs:1180-1269 | rust/lance-table/src/rowids/version.rs:566-652 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1497 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1497-1547 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:168-219 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 56+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 56+ corresponding lines) rust/lance-encoding/src/encodings/physical/alp/restore.rs:531 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:531-590 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:679-734 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:1021-1083 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 56 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (84 corresponding lines) · ×1
  • Edited copy of a member (84 corresponding lines) rust/lance/src/dataset/mem_wal/memtable/flush.rs:312 — rust/lance/src/dataset/mem_wal/memtable/flush.rs:312-395 | rust/lance/src/dataset/mem_wal/memtable/flush.rs:593-693 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) rust/lance-index/src/vector/graph.rs:403 — rust/lance-index/src/vector/graph.rs:403-475 | rust/lance-index/src/vector/graph.rs:504-570 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) rust/lance/src/io/exec/fts/segments.rs:207 — rust/lance/src/io/exec/fts/segments.rs:207-262 | rust/lance/src/io/exec/fts/segments.rs:274-333 — 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 copies of one member (3 members, 51+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 51+ corresponding lines) rust/lance-encoding/src/encodings/physical/alp.rs:533 — rust/lance-encoding/src/encodings/physical/alp.rs:533-590 | rust/lance-encoding/src/encodings/physical/alp.rs:606-663 | rust/lance-encoding/src/encodings/physical/alp.rs:1589-1639 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 51 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is 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 (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) rust/lance/src/dataset/mem_wal/index/fts.rs:2529 — rust/lance/src/dataset/mem_wal/index/fts.rs:2529-2591 | rust/lance/src/dataset/mem_wal/index/fts.rs:2599-2648 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 46+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 46+ corresponding lines) rust/lance-file/src/versions/v2_1/reader.rs:108 — rust/lance-file/src/versions/v2_1/reader.rs:108-162 | rust/lance-file/src/versions/v2_2/reader.rs:114-164 | rust/lance-file/src/versions/v2_3/reader.rs:235-280 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 46 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is 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, 32+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 32+ corresponding lines) rust/lance-index/src/vector/bq/pairwise.rs:656 — rust/lance-index/src/vector/bq/pairwise.rs:656-688 | rust/lance-index/src/vector/bq/pairwise.rs:742-773 | rust/lance-index/src/vector/bq/pairwise.rs:818-849 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 38+ corresponding lines) rust/lance-encoding/src/encodings/physical/alp/restore.rs:745 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:745-782 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:793-830 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:841-878 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:889-926 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:972-1009 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:1094-1132 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 39+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 39+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:392 — rust/lance-linalg/src/simd/f32.rs:392-430 | rust/lance-linalg/src/simd/f32.rs:891-938 | rust/lance-linalg/src/simd/i32.rs:232-270 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 1+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 1+ corresponding lines) rust/lance-linalg/src/distance/cosine.rs:575 — rust/lance-linalg/src/distance/cosine.rs:575-575 | rust/lance-linalg/src/distance/cosine.rs:696-696 | rust/lance-linalg/src/distance/cosine.rs:901-901 | rust/lance-linalg/src/distance/cosine.rs:947-947 | rust/lance-linalg/src/distance/dot.rs:656-656 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) rust/lance-io/src/uring/current_thread.rs:99 — rust/lance-io/src/uring/current_thread.rs:99-153 | rust/lance-io/src/uring/thread.rs:383-437 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
  • Edited copy of a member (46 corresponding lines) rust/lance-encoding/src/decoder.rs:1744 — rust/lance-encoding/src/decoder.rs:1744-1798 | rust/lance-encoding/src/decoder.rs:1981-2026 — 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 copies of one member (4 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 25+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:1001 — rust/lance-linalg/src/simd/f32.rs:1001-1025 | rust/lance-linalg/src/simd/f32.rs:1088-1112 | rust/lance-linalg/src/simd/f64.rs:792-816 | rust/lance-linalg/src/simd/f64.rs:875-899 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) rust/lance-io/src/object_store.rs:1156 — rust/lance-io/src/object_store.rs:1156-1203 | rust/lance-io/src/object_store.rs:1210-1268 — 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 (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) python/python/lance/pydantic.py:54 — python/python/lance/pydantic.py:54-114 | python/python/lance/pydantic.py:120-195 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 36+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 36+ corresponding lines) rust/lance-encoding/src/encodings/physical/alp/restore.rs:59 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:59-94 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:104-141 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:204-243 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:254-295 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:866 — rust/lance-linalg/src/simd/f32.rs:866-888 | rust/lance-linalg/src/simd/f32.rs:974-996 | rust/lance-linalg/src/simd/f32.rs:1032-1054 | rust/lance-linalg/src/simd/f32.rs:1061-1083 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) rust/lance/src/io/exec/fts/compound.rs:1016 — rust/lance/src/io/exec/fts/compound.rs:1016-1046 | rust/lance/src/io/exec/fts/compound.rs:1669-1698 | rust/lance/src/io/exec/minhash.rs:179-212 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:794 — rust/lance-linalg/src/simd/f32.rs:794-825 | rust/lance-linalg/src/simd/f64.rs:641-665 | rust/lance-linalg/src/simd/f64.rs:668-696 — 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 (6 members, 1+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 1+ corresponding lines) rust/lance-linalg/src/distance/dot.rs:791 — rust/lance-linalg/src/distance/dot.rs:791-791 | rust/lance-linalg/src/distance/dot.rs:823-823 | rust/lance-linalg/src/distance/dot.rs:855-855 | rust/lance-linalg/src/distance/l2.rs:856-856 | rust/lance-linalg/src/distance/l2.rs:892-892 | rust/lance-linalg/src/distance/l2.rs:928-928 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) rust/lance-namespace-impls/src/rest.rs:1014 — rust/lance-namespace-impls/src/rest.rs:1014-1032 | rust/lance-namespace-impls/src/rest.rs:1105-1128 | rust/lance-namespace-impls/src/rest.rs:1772-1790 | rust/lance-namespace-impls/src/rest.rs:1860-1878 — 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 (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) java/lance-jni/src/fragment.rs:485 — java/lance-jni/src/fragment.rs:485-512 | java/lance-jni/src/fragment.rs:545-571 | java/lance-jni/src/fragment.rs:723-759 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) java/lance-jni/src/optimize.rs:105 — java/lance-jni/src/optimize.rs:105-139 | java/lance-jni/src/optimize.rs:206-248 | java/lance-jni/src/optimize.rs:324-366 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 21+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:370 — rust/lance-linalg/src/simd/f32.rs:370-390 | rust/lance-linalg/src/simd/f64.rs:249-269 | rust/lance-linalg/src/simd/i32.rs:210-230 | rust/lance-linalg/src/simd/i32.rs:277-297 | rust/lance-linalg/src/simd/i32.rs:329-349 | rust/lance-linalg/src/simd/i32.rs:394-414 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) python/python/lance/dataset.py:2887 — python/python/lance/dataset.py:2887-2998 | python/python/lance/dataset.py:3109-3181 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) rust/lance-file/src/versions/v2_2/compression.rs:113 — rust/lance-file/src/versions/v2_2/compression.rs:113-134 | rust/lance-file/src/versions/v2_3/compression.rs:105-131 | rust/lance-file/src/versions/v2_3/compression.rs:137-161 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 1+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 1+ corresponding lines) rust/lance-linalg/src/distance/norm_l2.rs:275 — rust/lance-linalg/src/distance/norm_l2.rs:275-275 | rust/lance-linalg/src/distance/norm_l2.rs:353-353 | rust/lance-linalg/src/distance/norm_l2.rs:374-374 | rust/lance-linalg/src/distance/norm_l2.rs:396-396 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) python/src/file.rs:338 — python/src/file.rs:338-364 | python/src/file.rs:505-521 | python/src/file.rs:1002-1018 — 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 (4 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 22+ corresponding lines) rust/lance/src/io/exec/fts/flat_match.rs:156 — rust/lance/src/io/exec/fts/flat_match.rs:156-177 | rust/lance/src/io/exec/fts/flat_match.rs:698-719 | rust/lance/src/io/exec/fts/match_query.rs:122-143 | rust/lance/src/io/exec/fts/phrase.rs:105-126 — 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 (8 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 25+ corresponding lines) rust/lance/src/io/exec/fts/flat_match.rs:750 — rust/lance/src/io/exec/fts/flat_match.rs:750-774 | rust/lance/src/io/exec/fts/flat_match.rs:809-833 | rust/lance/src/io/exec/fts/match_query.rs:180-206 | rust/lance/src/io/exec/fts/match_query.rs:245-271 | rust/lance/src/io/exec/fts/match_query.rs:313-339 | rust/lance/src/io/exec/fts/phrase.rs:154-180 | rust/lance/src/io/exec/fts/phrase.rs:210-236 | rust/lance/src/io/exec/fts/phrase.rs:278-304 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) rust/lance-select/src/mask.rs:251 — rust/lance-select/src/mask.rs:251-258 | rust/lance-select/src/mask.rs:436-443 | rust/lance-select/src/mask.rs:449-456 — 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 · Edited copies of one member (8 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 29+ corresponding lines) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:430 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:430-458 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:466-494 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:523-551 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:559-587 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:491-519 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:527-555 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:584-612 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:620-648 — These 8 members are one piece of code written 8 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 8 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/lance-namespace-impls/src/rest_adapter.rs:494 — rust/lance-namespace-impls/src/rest_adapter.rs:494-507 | rust/lance-namespace-impls/src/rest_adapter.rs:572-586 | rust/lance-namespace-impls/src/rest_adapter.rs:974-989 | rust/lance-namespace-impls/src/rest_adapter.rs:1382-1395 | rust/lance-namespace-impls/src/rest_adapter.rs:1496-1509 — 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, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:181 — rust/lance-linalg/src/simd/f32.rs:181-198 | rust/lance-linalg/src/simd/f32.rs:652-677 | rust/lance-linalg/src/simd/f64.rs:74-91 | rust/lance-linalg/src/simd/f64.rs:503-522 — 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 (8 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 19+ corresponding lines) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:403 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:403-422 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:496-515 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:603-621 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:623-641 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:464-483 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:557-576 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:664-682 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:684-702 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) java/lance-jni/src/blocking_scanner.rs:940 — java/lance-jni/src/blocking_scanner.rs:940-954 | java/lance-jni/src/namespace.rs:125-139 | java/lance-jni/src/otel.rs:315-330 | java/lance-jni/src/utils.rs:632-645 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) python/src/dataset/optimize.rs:241 — python/src/dataset/optimize.rs:241-249 | python/src/dataset/optimize.rs:353-361 | python/src/dataset/optimize.rs:477-485 | python/src/fragment.rs:998-1006 | python/src/fragment.rs:1057-1065 | python/src/fragment.rs:1106-1114 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 18+ corresponding lines) rust/lance-linalg/src/simd/f32.rs:200 — rust/lance-linalg/src/simd/f32.rs:200-217 | rust/lance-linalg/src/simd/f32.rs:680-697 | rust/lance-linalg/src/simd/f64.rs:93-110 | rust/lance-linalg/src/simd/f64.rs:525-542 | rust/lance-linalg/src/simd/i32.rs:100-117 — 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 (5 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 9+ corresponding lines) java/src/main/java/org/lance/Dataset.java:1742 — java/src/main/java/org/lance/Dataset.java:1742-1750 | java/src/main/java/org/lance/ipc/AsyncScanner.java:201-209 | java/src/main/java/org/lance/ipc/LanceScanner.java:238-246 | java/src/main/java/org/lance/memwal/ExecutionPlan.java:45-53 | java/src/main/java/org/lance/memwal/ExecutionPlan.java:58-66 — 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 (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) rust/lance/src/io/exec/fts/boolean.rs:81 — rust/lance/src/io/exec/fts/boolean.rs:81-98 | rust/lance/src/io/exec/fts/boolean.rs:355-373 | rust/lance/src/io/exec/knn/warp.rs:772-791 | rust/lance/src/io/exec/minhash.rs:109-127 | rust/lance/src/io/exec/minhash.rs:452-467 — 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 (3 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 29+ corresponding lines) java/lance-jni/src/async_scanner.rs:207 — java/lance-jni/src/async_scanner.rs:207-243 | java/lance-jni/src/blocking_scanner.rs:688-725 | java/lance-jni/src/fragment.rs:119-147 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) rust/lance/src/dataset/mem_wal/write/backpressure.rs:209 — rust/lance/src/dataset/mem_wal/write/backpressure.rs:209-220 | rust/lance/src/dataset/mem_wal/write/backpressure.rs:231-242 | rust/lance/src/dataset/mem_wal/write/backpressure.rs:251-262 | rust/lance/src/dataset/mem_wal/write/backpressure.rs:266-278 | rust/lance/src/dataset/mem_wal/write/backpressure.rs:286-298 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) rust/lance/src/dataset/mem_wal/scanner/exec/first_by_pk.rs:47 — rust/lance/src/dataset/mem_wal/scanner/exec/first_by_pk.rs:47-61 | rust/lance/src/dataset/mem_wal/scanner/exec/ordered_concat.rs:39-47 | rust/lance/src/dataset/mem_wal/scanner/exec/pk_block_filter.rs:73-88 | rust/lance/src/dataset/mem_wal/scanner/exec/schema_relabel.rs:45-57 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (60–63 lines × 2) · ×1
  • Duplicated block (60–63 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1229 — rust/lance-index/src/vector/distributed/index_merger.rs:1229-1291 | rust/lance-index/src/vector/distributed/index_merger.rs:1390-1449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/distributed/index_merger.rs:1229` it does not close everything it opens, so those exact 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 (56–61 lines × 2) · ×1
  • Duplicated block (56–61 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1057 — rust/lance-index/src/vector/distributed/index_merger.rs:1057-1117 | rust/lance-index/src/vector/distributed/index_merger.rs:1486-1541 — both copies are in the same file, so extract the 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 (5–50 lines × 3) · ×1
  • Duplicated block (5–50 lines × 3) rust/lance-io/src/local.rs:298 — rust/lance-io/src/local.rs:298-302 | rust/lance-io/src/uring/current_thread.rs:314-363 | rust/lance-io/src/uring/reader.rs:124-173 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-io/src/local.rs:298` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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 (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:631 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:631-678 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:744-791 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/inverted_index.rs:631` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:585 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:585-629 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:698-742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/inverted_index.rs:585` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) rust/lance-file/src/versions/v2_1/reader.rs:27 — rust/lance-file/src/versions/v2_1/reader.rs:27-77 | rust/lance-file/src/versions/v2_2/reader.rs:27-77 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-file/src/versions/v2_1/reader.rs:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (75–83 lines × 2) · ×1
  • Duplicated block (75–83 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:472 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:472-546 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:202-284 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 166 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.
D4 · Code Duplication · Duplicated block (39–41 lines × 2) · ×1
  • Duplicated block (39–41 lines × 2) rust/lance/src/dataset/fragment.rs:4051 — rust/lance/src/dataset/fragment.rs:4051-4089 | rust/lance/src/dataset/fragment.rs:4244-4284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/fragment.rs:4051` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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–40 lines × 3) · ×1
  • Duplicated block (39–40 lines × 3) java/lance-jni/src/namespace.rs:386 — java/lance-jni/src/namespace.rs:386-424 | java/lance-jni/src/namespace.rs:710-748 | java/lance-jni/src/namespace.rs:899-938 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `java/lance-jni/src/namespace.rs:386` it begins part-way through the construct above it, so those 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/lance/src/index/vector/ivf.rs:1534 — rust/lance/src/index/vector/ivf.rs:1534-1572 | rust/lance/src/index/vector/ivf.rs:2931-2969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector/ivf.rs:1534` it does not close everything it opens, so those 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) java/lance-jni/src/async_scanner.rs:278 — java/lance-jni/src/async_scanner.rs:278-314 | java/lance-jni/src/blocking_scanner.rs:761-797 — 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.
D4 · Code Duplication · Duplicated block (35–37 lines × 2) · ×1
  • Duplicated block (35–37 lines × 2) rust/lance/src/index/create.rs:408 — rust/lance/src/index/create.rs:408-444 | rust/lance/src/index/create.rs:854-888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/create.rs:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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 (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) rust/lance/src/io/exec/fts/match_query.rs:619 — rust/lance/src/io/exec/fts/match_query.rs:619-654 | rust/lance/src/io/exec/fts/phrase.rs:532-567 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) java/lance-jni/src/async_scanner.rs:211 — java/lance-jni/src/async_scanner.rs:211-243 | java/lance-jni/src/blocking_scanner.rs:692-725 — 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 `java/lance-jni/src/async_scanner.rs:211` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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–34 lines × 2) · ×1
  • Duplicated block (29–34 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:600 — rust/lance-file/src/versions/v2_0/writer.rs:600-633 | rust/lance-file/src/writer/structural.rs:309-337 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1293 — rust/lance-index/src/vector/distributed/index_merger.rs:1293-1325 | rust/lance-index/src/vector/distributed/index_merger.rs:1451-1483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/distributed/index_merger.rs:1293` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) rust/lance-file/src/versions/v2_1/writer.rs:159 — rust/lance-file/src/versions/v2_1/writer.rs:159-190 | rust/lance-file/src/versions/v2_2/writer.rs:159-190 | rust/lance-file/src/versions/v2_3/writer.rs:159-190 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (30–32 lines × 3) · ×1
  • Duplicated block (30–32 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:4295 — rust/lance-namespace-impls/src/dir/manifest.rs:4295-4326 | rust/lance-namespace-impls/src/dir/manifest.rs:4360-4389 | rust/lance-namespace-impls/src/dir/manifest.rs:4412-4441 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-namespace-impls/src/dir/manifest.rs:4295` it does not close everything it opens, so those exact 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 `request` to `AlterTableAddColumnsRequest` in one and `AlterTableAlterColumnsRequest` 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 (28–31 lines × 2) · ×1
  • Duplicated block (28–31 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:320 — rust/lance-encoding/src/encodings/physical/alp.rs:320-350 | rust/lance-encoding/src/encodings/physical/alp.rs:362-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-encoding/src/encodings/physical/alp.rs:320` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) rust/lance/src/dataset/mem_wal/scanner/planner.rs:473 — rust/lance/src/dataset/mem_wal/scanner/planner.rs:473-503 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:763-793 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/planner.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 82 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/lance/src/dataset/mem_wal/scanner/planner.rs:473` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) rust/lance/src/dataset/scanner/fts.rs:1710 — rust/lance/src/dataset/scanner/fts.rs:1710-1739 | rust/lance/src/dataset/scanner/fts.rs:2073-2103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/scanner/fts.rs:1710` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) rust/lance-encoding/src/array_encoding/strategy.rs:145 — rust/lance-encoding/src/array_encoding/strategy.rs:145-174 | rust/lance-encoding/src/encoder/structural.rs:43-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:336 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:336-365 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:406-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/inverted_index.rs:336` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–30 lines × 2) · ×1
  • Duplicated block (21–30 lines × 2) rust/lance/src/index/frag_reuse.rs:1463 — rust/lance/src/index/frag_reuse.rs:1463-1483 | rust/lance/src/index/frag_reuse.rs:2033-2062 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/frag_reuse.rs:1463` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (21–29 lines × 2) · ×1
  • Duplicated block (21–29 lines × 2) rust/lance-io/src/uring/current_thread_future.rs:38 — rust/lance-io/src/uring/current_thread_future.rs:38-58 | rust/lance-io/src/uring/current_thread_future.rs:70-98 — both copies are in the same file, so extract the 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 (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) java/lance-jni/src/lib.rs:135 — java/lance-jni/src/lib.rs:135-162 | python/src/lib.rs:235-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:2300 — rust/lance-index/src/scalar/inverted/builder.rs:2300-2325 | rust/lance-index/src/scalar/inverted/builder.rs:2378-2405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/builder.rs:2300` it does not close everything it opens, so those 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–26 lines × 2) · ×1
  • Duplicated block (22–26 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/write.rs:171 — rust/lance/src/dataset/write/merge_insert/exec/write.rs:171-196 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:203-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/write/merge_insert/exec/write.rs:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) rust/lance/src/io/exec/fts/flat_combined_fields.rs:509 — rust/lance/src/io/exec/fts/flat_combined_fields.rs:509-531 | rust/lance/src/io/exec/fts/flat_match.rs:1165-1190 — 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/lance/src/io/exec/fts/flat_combined_fields.rs:509` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–25 lines × 2) · ×1
  • Duplicated block (19–25 lines × 2) rust/lance/src/dataset/mem_wal/write/tasks.rs:71 — rust/lance/src/dataset/mem_wal/write/tasks.rs:71-89 | rust/lance/src/dataset/mem_wal/write/tasks.rs:95-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/write/tasks.rs:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 3) · ×1
  • Duplicated block (23–24 lines × 3) rust/lance-namespace-impls/src/credentials/aws.rs:552 — rust/lance-namespace-impls/src/credentials/aws.rs:552-575 | rust/lance-namespace-impls/src/credentials/azure.rs:835-857 | rust/lance-namespace-impls/src/credentials/gcp.rs:888-910 — before extracting anything, compare `rust/lance-namespace-impls/src/credentials/aws.rs` and `rust/lance-namespace-impls/src/credentials/gcp.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) rust/lance-index/src/scalar/inverted/index/search.rs:870 — rust/lance-index/src/scalar/inverted/index/search.rs:870-890 | rust/lance-index/src/scalar/inverted/index/search.rs:1149-1172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/scalar/inverted/index/search.rs:870` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) java/lance-jni/src/blocking_dataset/construction.rs:519 — java/lance-jni/src/blocking_dataset/construction.rs:519-541 | java/lance-jni/src/fragment.rs:360-381 — 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 `java/lance-jni/src/blocking_dataset/construction.rs:519` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–22 lines × 2) · ×1
  • Duplicated block (17–22 lines × 2) java/lance-jni/src/otel.rs:273 — java/lance-jni/src/otel.rs:273-289 | python/src/otel.rs:384-405 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) rust/lance/src/dataset.rs:1288 — rust/lance/src/dataset.rs:1288-1308 | rust/lance/src/dataset.rs:1357-1374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset.rs:1288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 7) · ×1
  • Duplicated block (20 lines × 7) java/lance-jni/src/namespace.rs:357 — java/lance-jni/src/namespace.rs:357-376 | java/lance-jni/src/namespace.rs:438-457 | java/lance-jni/src/namespace.rs:497-516 | java/lance-jni/src/namespace.rs:580-599 | java/lance-jni/src/namespace.rs:674-693 | java/lance-jni/src/namespace.rs:762-781 | java/lance-jni/src/namespace.rs:848-867 — 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 `java/lance-jni/src/namespace.rs:357` it does not close everything it opens, so those 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, `java/lance-jni/src/namespace.rs:356` calls `to_string` and `java/lance-jni/src/namespace.rs:437` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) java/lance-jni/src/namespace.rs:234 — java/lance-jni/src/namespace.rs:234-250 | java/lance-jni/src/namespace.rs:288-307 — both copies are in the same file, so extract the 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2925 — rust/lance-namespace-impls/src/dir/manifest.rs:2925-2942 | rust/lance-namespace-impls/src/dir/manifest.rs:3073-3092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-namespace-impls/src/dir/manifest.rs:3073` it begins part-way through the construct above it, so those exact 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–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) rust/lance/src/index/vector/ivf/v2.rs:1966 — rust/lance/src/index/vector/ivf/v2.rs:1966-1980 | rust/lance/src/index/vector/ivf/v2.rs:3842-3861 — both copies are in the same file, so extract the 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 (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) rust/lance-file/src/versions/v1/writer/statistics.rs:262 — rust/lance-file/src/versions/v1/writer/statistics.rs:262-279 | rust/lance-file/src/versions/v1/writer/statistics.rs:339-356 | rust/lance-file/src/versions/v1/writer/statistics.rs:413-430 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-file/src/versions/v1/writer/statistics.rs:262` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) rust/lance/src/dataset/optimize/remapping.rs:381 — rust/lance/src/dataset/optimize/remapping.rs:381-393 | rust/lance/src/dataset/optimize/remapping.rs:1097-1114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/optimize/remapping.rs:381` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) rust/lance/src/dataset/write/delete.rs:68 — rust/lance/src/dataset/write/delete.rs:68-84 | rust/lance/src/dataset/write/merge_insert/exec.rs:98-114 | rust/lance/src/dataset/write/merge_insert/job.rs:1836-1852 | rust/lance/src/dataset/write/update.rs:841-857 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance/src/dataset/write/delete.rs:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) rust/lance-io/src/uring/current_thread.rs:104 — rust/lance-io/src/uring/current_thread.rs:104-120 | rust/lance-io/src/uring/current_thread.rs:220-234 | rust/lance-io/src/uring/thread.rs:385-400 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/thread.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) rust/lance/src/dataset/scanner/fts.rs:2239 — rust/lance/src/dataset/scanner/fts.rs:2239-2254 | rust/lance/src/dataset/scanner/fts.rs:2740-2756 | rust/lance/src/dataset/scanner/fts.rs:2801-2817 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 3) · ×1
  • Duplicated block (13–16 lines × 3) rust/lance-encoding/src/decoder.rs:947 — rust/lance-encoding/src/decoder.rs:947-962 | rust/lance-encoding/src/decoder.rs:969-984 | rust/lance-encoding/src/decoder.rs:996-1008 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-encoding/src/decoder.rs:947` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) rust/lance/src/index/vector/ivf.rs:3298 — rust/lance/src/index/vector/ivf.rs:3298-3312 | rust/lance/src/index/vector/ivf.rs:3446-3461 | rust/lance/src/index/vector/ivf.rs:3502-3517 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/index/vector/ivf.rs:3298` it does not close everything it opens, so those 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) python/src/file.rs:342 — python/src/file.rs:342-357 | python/src/file.rs:1006-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 `python/src/file.rs:342` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–15 lines × 5) · ×1
  • Duplicated block (13–15 lines × 5) rust/lance-index/src/vector/distributed/index_merger.rs:1060 — rust/lance-index/src/vector/distributed/index_merger.rs:1060-1074 | rust/lance-index/src/vector/distributed/index_merger.rs:1125-1137 | rust/lance-index/src/vector/distributed/index_merger.rs:1232-1246 | rust/lance-index/src/vector/distributed/index_merger.rs:1393-1405 | rust/lance-index/src/vector/distributed/index_merger.rs:1489-1501 — 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/lance-index/src/vector/distributed/index_merger.rs:1060` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) rust/lance/src/index/vector.rs:1895 — rust/lance/src/index/vector.rs:1895-1909 | rust/lance/src/index/vector.rs:1913-1927 | rust/lance/src/index/vector.rs:1931-1945 | rust/lance/src/index/vector.rs:1949-1963 | rust/lance/src/index/vector.rs:1967-1981 — 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/lance/src/index/vector.rs:1895` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10–15 lines × 4) · ×1
  • Duplicated block (10–15 lines × 4) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1280 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1280-1289 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:408-422 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:852-861 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:660-674 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/planner.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 82 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/lance/src/dataset/mem_wal/scanner/fts_search.rs:1280` it does not close everything it opens, so those exact 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 × 4) · ×1
  • Duplicated block (13–14 lines × 4) java/lance-jni/src/namespace.rs:386 — java/lance-jni/src/namespace.rs:386-399 | java/lance-jni/src/namespace.rs:710-723 | java/lance-jni/src/namespace.rs:872-884 | java/lance-jni/src/namespace.rs:900-913 — 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 `java/lance-jni/src/namespace.rs:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) rust/lance/src/dataset/scanner/vector.rs:849 — rust/lance/src/dataset/scanner/vector.rs:849-862 | rust/lance/src/dataset/scanner/vector.rs:1417-1430 | rust/lance/src/dataset/scanner/vector.rs:1516-1529 | rust/lance/src/dataset/scanner/vector.rs:1539-1552 — 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 (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) rust/lance-index/src/scalar/inverted.rs:200 — rust/lance-index/src/scalar/inverted.rs:200-213 | rust/lance-index/src/scalar/inverted/index/partition.rs:1004-1015 | rust/lance-index/src/scalar/inverted/index/search.rs:459-472 — before extracting anything, compare `rust/lance-index/src/scalar/inverted.rs` and `rust/lance-index/src/scalar/inverted/index/search.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-index/src/scalar/inverted.rs:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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 × 6) · ×1
  • Duplicated block (11–13 lines × 6) java/lance-jni/src/namespace.rs:393 — java/lance-jni/src/namespace.rs:393-405 | java/lance-jni/src/namespace.rs:535-545 | java/lance-jni/src/namespace.rs:618-628 | java/lance-jni/src/namespace.rs:717-729 | java/lance-jni/src/namespace.rs:800-810 | java/lance-jni/src/namespace.rs:907-919 — 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 `java/lance-jni/src/namespace.rs:393` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) rust/lance-namespace-impls/src/credentials/gcp.rs:859 — rust/lance-namespace-impls/src/credentials/gcp.rs:859-869 | rust/lance-namespace-impls/src/credentials/gcp.rs:919-930 | rust/lance-namespace-impls/src/credentials/gcp.rs:981-993 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance-namespace-impls/src/credentials/gcp.rs:859` it does not close everything it opens, so those 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 × 3) · ×1
  • Duplicated block (13 lines × 3) rust/lance/src/index/vector/ivf.rs:3791 — rust/lance/src/index/vector/ivf.rs:3791-3803 | rust/lance/src/index/vector/ivf.rs:5870-5882 | rust/lance/src/index/vector/ivf.rs:6095-6107 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/index/vector/ivf.rs:3791` it does not close everything it opens, so those 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/lance/src/index/vector/ivf.rs:5884` calls `streaming_ivf_progress_interval` and `rust/lance/src/index/vector/ivf.rs:3805` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) rust/lance/src/dataset/optimize/binary_copy.rs:188 — rust/lance/src/dataset/optimize/binary_copy.rs:188-197 | rust/lance/src/dataset/optimize/execution.rs:191-203 — 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/lance/src/dataset/optimize/binary_copy.rs:188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) rust/lance-namespace-impls/src/dir/manifest.rs:3251 — rust/lance-namespace-impls/src/dir/manifest.rs:3251-3262 | rust/lance-namespace-impls/src/dir/manifest.rs:3373-3384 | rust/lance-namespace-impls/src/dir/manifest.rs:3403-3414 | rust/lance-namespace-impls/src/dir/manifest.rs:3625-3636 | rust/lance-namespace-impls/src/dir/manifest.rs:3679-3690 | rust/lance-namespace-impls/src/dir/manifest.rs:4169-4180 | rust/lance-namespace-impls/src/dir/manifest.rs:4247-4258 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `DescribeTableRequest` in one and `TableExistsRequest` 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–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:530 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:530-540 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:531-542 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:267-278 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 166 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/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:530` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:161 — rust/lance/src/dataset/write/merge_insert/exec/delete.rs:161-170 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:438-449 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1031-1042 — before extracting anything, compare `rust/lance/src/dataset/write/merge_insert/exec/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec/write.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/lance/src/dataset/write/merge_insert/exec/delete.rs:161` it begins part-way through the construct above it, so those exact 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–12 lines × 2) · ×1
  • Duplicated block (7–12 lines × 2) rust/lance-index/src/vector/hnsw/builder.rs:353 — rust/lance-index/src/vector/hnsw/builder.rs:353-364 | rust/lance-index/src/vector/hnsw/builder.rs:546-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance-index/src/vector/hnsw/builder.rs:353` it does not close everything it opens, so those 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 × 6) · ×1
  • Duplicated block (11 lines × 6) rust/lance-namespace-impls/src/rest.rs:1019 — rust/lance-namespace-impls/src/rest.rs:1019-1029 | rust/lance-namespace-impls/src/rest.rs:1085-1095 | rust/lance-namespace-impls/src/rest.rs:1485-1495 | rust/lance-namespace-impls/src/rest.rs:1533-1543 | rust/lance-namespace-impls/src/rest.rs:1777-1787 | rust/lance-namespace-impls/src/rest.rs:1865-1875 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `ListNamespacesRequest` in one and `ListTablesRequest` 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 × 5) · ×1
  • Duplicated block (11 lines × 5) java/lance-jni/src/namespace.rs:381 — java/lance-jni/src/namespace.rs:381-391 | java/lance-jni/src/namespace.rs:461-471 | java/lance-jni/src/namespace.rs:521-531 | java/lance-jni/src/namespace.rs:604-614 | java/lance-jni/src/namespace.rs:786-796 — 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 `java/lance-jni/src/namespace.rs:381` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 5) · ×1
  • Duplicated block (10–11 lines × 5) rust/lance/src/dataset/blob/prepared.rs:133 — rust/lance/src/dataset/blob/prepared.rs:133-143 | rust/lance/src/dataset/blob/prepared.rs:164-173 | rust/lance/src/dataset/blob/prepared.rs:182-192 | rust/lance/src/dataset/blob/prepared.rs:201-211 | rust/lance/src/dataset/blob/write.rs:1186-1196 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/blob/prepared.rs:133` it begins part-way through the construct above it, so those exact 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 `field` to `&ArrowField` in one and `&Arc<ArrowField>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) rust/lance-file/src/reader/structural.rs:133 — rust/lance-file/src/reader/structural.rs:133-143 | rust/lance-file/src/versions/v2_0/reader.rs:85-94 | rust/lance-file/src/versions/v2_0/reader.rs:112-122 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-file/src/reader/structural.rs:133` it begins part-way through the construct above it, so those 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 × 3) · ×1
  • Duplicated block (8–11 lines × 3) rust/lance/src/index/scalar/bloomfilter.rs:93 — rust/lance/src/index/scalar/bloomfilter.rs:93-102 | rust/lance/src/index/scalar/minhash_lsh.rs:99-106 | rust/lance/src/index/scalar/rtree.rs:58-68 — before extracting anything, compare `rust/lance/src/index/scalar/bloomfilter.rs` and `rust/lance/src/index/scalar/minhash_lsh.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/scalar/bloomfilter.rs:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) rust/lance/src/dataset/mem_wal/index/fts.rs:2546 — rust/lance/src/dataset/mem_wal/index/fts.rs:2546-2556 | rust/lance/src/dataset/mem_wal/index/fts.rs:2613-2620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/mem_wal/index/fts.rs:2546` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 11) · ×1
  • Duplicated block (9–10 lines × 11) rust/lance/src/index/vector/ivf.rs:1142 — rust/lance/src/index/vector/ivf.rs:1142-1150 | rust/lance/src/index/vector/ivf.rs:1161-1170 | rust/lance/src/index/vector/ivf.rs:1183-1192 | rust/lance/src/index/vector/ivf.rs:1204-1213 | rust/lance/src/index/vector/ivf.rs:1225-1234 | rust/lance/src/index/vector/ivf.rs:1245-1254 | rust/lance/src/index/vector/ivf.rs:1267-1275 | rust/lance/src/index/vector/ivf.rs:1286-1295 | rust/lance/src/index/vector/ivf.rs:1308-1317 | rust/lance/src/index/vector/ivf.rs:1329-1338 | rust/lance/src/index/vector/ivf.rs:1350-1359 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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/lance/src/index/vector/ivf.rs:1142` it begins part-way through the construct above it, so those exact 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 lines × 6) · ×1
  • Duplicated block (10 lines × 6) rust/lance/src/index/scalar/bloomfilter.rs:22 — rust/lance/src/index/scalar/bloomfilter.rs:22-31 | rust/lance/src/index/scalar/fmindex.rs:32-41 | rust/lance/src/index/scalar/inverted.rs:998-1007 | rust/lance/src/index/scalar/minhash_lsh.rs:27-36 | rust/lance/src/index/scalar/rtree.rs:23-32 | rust/lance/src/index/scalar/zonemap.rs:38-47 — before extracting anything, compare `rust/lance/src/index/scalar/bloomfilter.rs` and `rust/lance/src/index/scalar/minhash_lsh.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) rust/lance/src/index/scalar/bitmap.rs:124 — rust/lance/src/index/scalar/bitmap.rs:124-133 | rust/lance/src/index/scalar/fmindex.rs:122-131 | rust/lance/src/index/scalar/inverted.rs:1084-1093 | rust/lance/src/index/scalar/label_list.rs:179-188 | rust/lance/src/index/scalar/zonemap.rs:96-105 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/label_list.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/lance/src/index/scalar/bitmap.rs:124` it begins part-way through the construct above it, so those 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/lance/src/index/scalar/label_list.rs:178` calls `noop_progress` and `rust/lance/src/index/scalar/bitmap.rs:123` 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–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) rust/lance/src/dataset/refs.rs:227 — rust/lance/src/dataset/refs.rs:227-236 | rust/lance/src/dataset/refs.rs:262-271 | rust/lance/src/dataset/refs.rs:277-285 | rust/lance/src/dataset/refs.rs:310-318 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) rust/lance/src/index/vector/ivf/v2.rs:2973 — rust/lance/src/index/vector/ivf/v2.rs:2973-2982 | rust/lance/src/index/vector/ivf/v2.rs:3052-3058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/index/vector/ivf/v2.rs:2973` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–10 lines × 2) · ×1
  • Duplicated block (6–10 lines × 2) rust/lance/src/io/exec/fts/combined_fields.rs:553 — rust/lance/src/io/exec/fts/combined_fields.rs:553-562 | rust/lance/src/io/exec/fts/phrase.rs:571-576 — 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/lance/src/io/exec/fts/combined_fields.rs:553` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–9 lines × 3) · ×1
  • Duplicated block (4–9 lines × 3) rust/lance-encoding/src/array_encoding/logical/struct.rs:448 — rust/lance-encoding/src/array_encoding/logical/struct.rs:448-451 | rust/lance-encoding/src/array_encoding/logical/struct.rs:601-609 | rust/lance-encoding/src/encodings/logical/struct.rs:356-364 — before extracting anything, compare `rust/lance-encoding/src/array_encoding/logical/struct.rs` and `rust/lance-encoding/src/encodings/logical/struct.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/lance-encoding/src/array_encoding/logical/struct.rs:601` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact 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 (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) rust/lance/src/dataset/index/frag_reuse.rs:673 — rust/lance/src/dataset/index/frag_reuse.rs:673-692 | rust/lance/src/index/frag_reuse.rs:2332-2347 — before extracting anything, compare `rust/lance/src/dataset/index/frag_reuse.rs` and `rust/lance/src/index/frag_reuse.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) rust/lance/src/index/scalar/bitmap.rs:133 — rust/lance/src/index/scalar/bitmap.rs:133-140 | rust/lance/src/index/scalar/bloomfilter.rs:101-108 | rust/lance/src/index/scalar/label_list.rs:188-195 | rust/lance/src/index/scalar/minhash_lsh.rs:105-112 | rust/lance/src/index/scalar/rtree.rs:67-74 | rust/lance/src/index/scalar/zonemap.rs:105-112 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/label_list.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/lance/src/index/scalar/bitmap.rs:133` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) rust/lance-datafusion-exec/src/udf/json.rs:555 — rust/lance-datafusion-exec/src/udf/json.rs:555-562 | rust/lance-datafusion-exec/src/udf/json.rs:608-615 | rust/lance-datafusion-exec/src/udf/json.rs:664-671 | rust/lance-datafusion-exec/src/udf/json.rs:720-727 | rust/lance-datafusion-exec/src/udf/json.rs:776-783 — 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/lance-datafusion-exec/src/udf/json.rs:555` it does not close everything it opens, so those 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–8 lines × 2) · ×1
  • Duplicated block (5–8 lines × 2) rust/lance-file/src/versions/v1/writer/mod.rs:507 — rust/lance-file/src/versions/v1/writer/mod.rs:507-511 | rust/lance-file/src/versions/v1/writer/mod.rs:555-562 — both copies are in the same file, so extract the 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) · ×1
  • Duplicated block (7–8 lines × 2) rust/lance-geo/src/rtree.rs:827 — rust/lance-geo/src/rtree.rs:827-834 | rust/lance-index/src/scalar/btree.rs:2939-2945 — 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.
D4 · Code Duplication · Duplicated block (5–7 lines × 2) · ×1
  • Duplicated block (5–7 lines × 2) rust/lance/src/dataset/blob/locate.rs:23 — rust/lance/src/dataset/blob/locate.rs:23-29 | rust/lance/src/dataset/fragment/aligned_update.rs:483-487 — 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/lance/src/dataset/fragment/aligned_update.rs:483` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) rust/lance/src/dataset/delta.rs:754 — rust/lance/src/dataset/delta.rs:754-759 | rust/lance/src/dataset/delta.rs:803-809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/lance/src/dataset/delta.rs:803` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–6 lines × 4) · ×1
  • Duplicated block (3–6 lines × 4) rust/lance-index/src/vector/bq/storage.rs:2358 — rust/lance-index/src/vector/bq/storage.rs:2358-2360 | rust/lance-index/src/vector/bq/storage.rs:2392-2397 | rust/lance-index/src/vector/storage.rs:225-231 | rust/lance-index/src/vector/storage.rs:260-262 — 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/lance-index/src/vector/bq/storage.rs:2392` it does not close everything it opens, so those exact 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-index/src/vector/bq/storage.rs:2391` calls `unwrap_or`, `into` and `rust/lance-index/src/vector/bq/storage.rs:2357` 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 (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) rust/lance-datafusion-exec/src/udf/json.rs:493 — rust/lance-datafusion-exec/src/udf/json.rs:493-497 | rust/lance-datafusion-exec/src/udf/json.rs:664-668 | rust/lance-datafusion-exec/src/udf/json.rs:720-724 | rust/lance-datafusion-exec/src/udf/json.rs:776-780 | rust/lance-datafusion-exec/src/udf/json.rs:934-938 — 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/lance-datafusion-exec/src/udf/json.rs:493` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) rust/lance/src/io/exec/fts/combined_fields.rs:492 — rust/lance/src/io/exec/fts/combined_fields.rs:492-495 | rust/lance/src/io/exec/fts/compound.rs:1062-1066 | rust/lance/src/io/exec/fts/compound.rs:1716-1720 — 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/lance/src/io/exec/fts/combined_fields.rs:492` it does not close everything it opens, so those exact 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 (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) rust/lance-index/src/vector/flat.rs:34 — rust/lance-index/src/vector/flat.rs:34-87 | rust/lance/src/index/vector/utils.rs:62-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) rust/lance-geo/src/query.rs:49 — rust/lance-geo/src/query.rs:49-54 | rust/lance-index/src/scalar.rs:373-378 | rust/lance-index/src/scalar.rs:444-449 | rust/lance-index/src/scalar.rs:500-505 | rust/lance-index/src/scalar.rs:579-584 | rust/lance-index/src/scalar.rs:608-613 | rust/lance-index/src/scalar/json.rs:633-638 — there are 7 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/lance-geo/src/query.rs:45` calls `to_expr` and `rust/lance-index/src/scalar.rs:441` 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 (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) rust/lance/src/io/exec/fts/flat_match.rs:165 — rust/lance/src/io/exec/fts/flat_match.rs:165-177 | rust/lance/src/io/exec/fts/flat_match.rs:707-719 | rust/lance/src/io/exec/fts/match_query.rs:131-143 | rust/lance/src/io/exec/fts/phrase.rs:114-126 — before extracting anything, compare `rust/lance/src/io/exec/fts/match_query.rs` and `rust/lance/src/io/exec/fts/phrase.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 165 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/lance/src/io/exec/fts/flat_match.rs:165` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) rust/lance-namespace-impls/src/rest.rs:1016 — rust/lance-namespace-impls/src/rest.rs:1016-1020 | rust/lance-namespace-impls/src/rest.rs:1082-1086 | rust/lance-namespace-impls/src/rest.rs:1107-1111 | rust/lance-namespace-impls/src/rest.rs:1189-1193 | rust/lance-namespace-impls/src/rest.rs:1530-1534 | rust/lance-namespace-impls/src/rest.rs:1774-1778 | rust/lance-namespace-impls/src/rest.rs:1862-1866 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `ListNamespacesRequest` in one and `ListTablesRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) rust/lance-datafusion-exec/src/expr.rs:177 — rust/lance-datafusion-exec/src/expr.rs:177-182 | rust/lance-datafusion-exec/src/expr.rs:208-213 | rust/lance-datafusion-exec/src/expr.rs:268-273 | rust/lance-datafusion-exec/src/expr.rs:290-295 | rust/lance-datafusion-exec/src/expr.rs:317-322 — 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 (46 lines × 2) · ×1
  • Duplicated block (46 lines × 2) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:875 — java/src/main/java/org/lance/namespace/DirectoryNamespace.java:875-920 | java/src/main/java/org/lance/namespace/RestNamespace.java:782-827 — before extracting anything, compare `java/src/main/java/org/lance/namespace/DirectoryNamespace.java` and `java/src/main/java/org/lance/namespace/RestNamespace.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 101 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.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) java/src/main/java/org/lance/Fragment.java:327 — java/src/main/java/org/lance/Fragment.java:327-342 | java/src/main/java/org/lance/Fragment.java:350-365 | java/src/main/java/org/lance/Fragment.java:401-416 | java/src/main/java/org/lance/Fragment.java:423-438 — 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 (6 lines × 26) · ×1
  • Duplicated block (6 lines × 26) java/src/main/java/org/lance/Dataset.java:1040 — java/src/main/java/org/lance/Dataset.java:1040-1045 | java/src/main/java/org/lance/Dataset.java:1063-1068 | java/src/main/java/org/lance/Dataset.java:1077-1082 | java/src/main/java/org/lance/Dataset.java:1128-1133 | java/src/main/java/org/lance/Dataset.java:1140-1145 | java/src/main/java/org/lance/Dataset.java:1157-1162 | java/src/main/java/org/lance/Dataset.java:1176-1181 | java/src/main/java/org/lance/Dataset.java:1691-1696 | java/src/main/java/org/lance/Dataset.java:1710-1715 | java/src/main/java/org/lance/Dataset.java:1728-1733 | java/src/main/java/org/lance/Dataset.java:1759-1764 | java/src/main/java/org/lance/Dataset.java:1800-1805 | java/src/main/java/org/lance/Dataset.java:1814-1819 | java/src/main/java/org/lance/Dataset.java:2024-2029 | java/src/main/java/org/lance/Dataset.java:2043-2048 | java/src/main/java/org/lance/Dataset.java:2075-2080 | java/src/main/java/org/lance/Dataset.java:2520-2525 | java/src/main/java/org/lance/Dataset.java:2628-2633 | java/src/main/java/org/lance/Dataset.java:2670-2675 | java/src/main/java/org/lance/delta/DatasetDelta.java:57-62 | java/src/main/java/org/lance/ipc/LanceScanner.java:255-260 | java/src/main/java/org/lance/memwal/ExecutionPlan.java:71-76 | java/src/main/java/org/lance/memwal/LsmScanner.java:168-173 | java/src/main/java/org/lance/memwal/ShardWriter.java:78-83 | java/src/main/java/org/lance/memwal/ShardWriter.java:134-139 | java/src/main/java/org/lance/memwal/ShardWriter.java:144-149 — there are 26 copies across 6 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 26 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) java/src/main/java/org/lance/delta/DatasetDelta.java:113 — java/src/main/java/org/lance/delta/DatasetDelta.java:113-120 | java/src/main/java/org/lance/ipc/LanceScanner.java:140-147 | java/src/main/java/org/lance/memwal/ExecutionPlan.java:98-105 | java/src/main/java/org/lance/memwal/LsmPointLookupPlanner.java:109-116 | java/src/main/java/org/lance/memwal/LsmScanner.java:182-189 | java/src/main/java/org/lance/memwal/LsmVectorSearchPlanner.java:221-228 | java/src/main/java/org/lance/memwal/ShardWriter.java:184-191 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times.
D4 · Code Duplication · Duplicated block (6 lines × 74) · ×1
  • Duplicated block (6 lines × 74) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:306 — java/src/main/java/org/lance/namespace/DirectoryNamespace.java:306-311 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:314-319 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:322-327 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:330-335 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:346-351 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:354-359 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:362-367 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:378-383 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:386-391 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:411-416 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:419-424 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:447-452 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:455-460 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:471-476 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:479-484 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:488-494 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:497-502 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:505-510 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:515-520 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:523-528 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:531-536 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:540-546 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:549-554 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:557-562 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:565-570 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:573-578 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:582-588 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:591-596 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:613-618 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:622-627 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:630-635 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:638-643 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:646-651 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:654-659 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:662-667 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:670-675 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:679-684 | java/src/main/java/org/lance/namespace/RestNamespace.java:220-225 | java/src/main/java/org/lance/namespace/RestNamespace.java:228-233 | java/src/main/java/org/lance/namespace/RestNamespace.java:236-241 | java/src/main/java/org/lance/namespace/RestNamespace.java:244-249 | java/src/main/java/org/lance/namespace/RestNamespace.java:260-265 | java/src/main/java/org/lance/namespace/RestNamespace.java:268-273 | java/src/main/java/org/lance/namespace/RestNamespace.java:276-281 | java/src/main/java/org/lance/namespace/RestNamespace.java:292-297 | java/src/main/java/org/lance/namespace/RestNamespace.java:300-305 | java/src/main/java/org/lance/namespace/RestNamespace.java:324-329 | java/src/main/java/org/lance/namespace/RestNamespace.java:332-337 | java/src/main/java/org/lance/namespace/RestNamespace.java:360-365 | java/src/main/java/org/lance/namespace/RestNamespace.java:368-373 | java/src/main/java/org/lance/namespace/RestNamespace.java:384-389 | java/src/main/java/org/lance/namespace/RestNamespace.java:392-397 | java/src/main/java/org/lance/namespace/RestNamespace.java:401-406 | java/src/main/java/org/lance/namespace/RestNamespace.java:409-414 | java/src/main/java/org/lance/namespace/RestNamespace.java:417-422 | java/src/main/java/org/lance/namespace/RestNamespace.java:425-430 | java/src/main/java/org/lance/namespace/RestNamespace.java:433-438 | java/src/main/java/org/lance/namespace/RestNamespace.java:441-446 | java/src/main/java/org/lance/namespace/RestNamespace.java:450-455 | java/src/main/java/org/lance/namespace/RestNamespace.java:458-463 | java/src/main/java/org/lance/namespace/RestNamespace.java:466-471 | java/src/main/java/org/lance/namespace/RestNamespace.java:474-479 | java/src/main/java/org/lance/namespace/RestNamespace.java:482-487 | java/src/main/java/org/lance/namespace/RestNamespace.java:491-496 | java/src/main/java/org/lance/namespace/RestNamespace.java:499-504 | java/src/main/java/org/lance/namespace/RestNamespace.java:521-526 | java/src/main/java/org/lance/namespace/RestNamespace.java:530-535 | java/src/main/java/org/lance/namespace/RestNamespace.java:538-543 | java/src/main/java/org/lance/namespace/RestNamespace.java:546-551 | java/src/main/java/org/lance/namespace/RestNamespace.java:554-559 | java/src/main/java/org/lance/namespace/RestNamespace.java:562-567 | java/src/main/java/org/lance/namespace/RestNamespace.java:570-575 | java/src/main/java/org/lance/namespace/RestNamespace.java:578-583 | java/src/main/java/org/lance/namespace/RestNamespace.java:587-592 — before extracting anything, compare `java/src/main/java/org/lance/namespace/DirectoryNamespace.java` and `java/src/main/java/org/lance/namespace/RestNamespace.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 101 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 `java/src/main/java/org/lance/namespace/DirectoryNamespace.java:488` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `ListNamespacesRequest` in one and `DescribeNamespaceRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:402 — java/src/main/java/org/lance/namespace/DirectoryNamespace.java:402-408 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:428-434 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:438-444 | java/src/main/java/org/lance/namespace/RestNamespace.java:316-321 | java/src/main/java/org/lance/namespace/RestNamespace.java:341-347 | java/src/main/java/org/lance/namespace/RestNamespace.java:351-357 — before extracting anything, compare `java/src/main/java/org/lance/namespace/DirectoryNamespace.java` and `java/src/main/java/org/lance/namespace/RestNamespace.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 101 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 `java/src/main/java/org/lance/namespace/DirectoryNamespace.java:428` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `CreateTableRequest` in one and `InsertIntoTableRequest` 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 (74–121 lines × 2) · ×1
  • Duplicated block (74–121 lines × 2) python/python/lance/dataset.py:4665 — python/python/lance/dataset.py:4665-4785 | python/python/lance/dataset.py:4869-4942 — both copies are in the same file, so extract the 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 (26–39 lines × 2) · ×1
  • Duplicated block (26–39 lines × 2) python/python/lance/vector.py:442 — python/python/lance/vector.py:442-480 | python/python/lance/vector.py:652-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 `python/python/lance/vector.py:442` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) python/python/lance/dataset.py:1041 — python/python/lance/dataset.py:1041-1168 | python/python/lance/dataset.py:1210-1239 | python/python/lance/dataset.py:1648-1672 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/python/lance/dataset.py:1041` it does not close everything it opens, so those exact 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 (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) python/python/lance/vector.py:570 — python/python/lance/vector.py:570-583 | python/python/lance/vector.py:755-771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/python/lance/vector.py:570` it begins part-way through the construct above it, so those 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) python/python/lance/dataset.py:1155 — python/python/lance/dataset.py:1155-1168 | python/python/lance/dataset.py:1226-1239 | python/python/lance/dataset.py:1659-1672 | python/python/lance/fragment.py:746-759 | python/python/lance/fragment.py:786-799 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `python/python/lance/dataset.py:1155` it does not close everything it opens, so those exact 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.
D5 · Coupling · Unstable project lance-geo · ×1
  • Unstable project lance-geo — lance-geo has instability 0.88 with 1 dependents.
Minor — 145 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate java/src/main/java/org/lance/namespace/DirectoryNamespace.java:876 — `className == null || className.isEmpty()` appears character-identically in 2 files — java/src/main/java/org/lance/namespace/DirectoryNamespace.java, java/src/main/java/org/lance/namespace/RestNamespace.java. 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 java/src/main/java/org/lance/namespace/DirectoryNamespace.java:884 — `key.startsWith(PROVIDER_PREFIX) && !key.equals(IMPL_KEY)` appears character-identically in 2 files — java/src/main/java/org/lance/namespace/DirectoryNamespace.java, java/src/main/java/org/lance/namespace/RestNamespace.java. 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 java/src/main/java/org/lance/OpenDatasetBuilder.java:179 — `namespaceClient != null && tableId != null` appears character-identically in 2 files — java/src/main/java/org/lance/OpenDatasetBuilder.java, java/src/main/java/org/lance/WriteDatasetBuilder.java. 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 java/src/main/java/org/lance/fragment/RowIdMeta.java:59 — `obj == null || getClass() != obj.getClass()` appears character-identically in 2 files — java/src/main/java/org/lance/fragment/RowIdMeta.java, java/src/main/java/org/lance/fragment/VersionMeta.java. 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 python/python/lance/torch/data.py:201 — `_check_for_numpy(data) and isinstance(data, np.ndarray)` appears character-identically in 4 files — python/python/lance/torch/data.py, python/python/lance/torch/kmeans.py, python/python/lance/util.py, python/python/lance/vector.py. 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 python/python/lance/_dataset/scanner.py:445 — `_check_for_numpy(query) and isinstance(query, np.ndarray)` appears character-identically in 2 files — python/python/lance/_dataset/scanner.py, python/python/lance/torch/bench_utils.py. 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 python/python/lance/dataset.py:3729 — `isinstance(field.type, pa.FixedShapeTensorType) and len(field.type.shape) == 1` appears character-identically in 2 files — python/python/lance/dataset.py, python/python/lance/torch/bench_utils.py. 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 python/python/lance/__init__.py:268 — `namespace_client is not None or table_id is not None` appears character-identically in 2 files — python/python/lance/__init__.py, python/python/lance/dataset.py. 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/lance-index/src/scalar/inverted/builder.rs:1917 — `!discount_overlaps || last_position != Some(token.position)` appears character-identically in 3 files — rust/lance-index/src/scalar/inverted/builder.rs, rust/lance-index/src/scalar/inverted/index/flat_search.rs, rust/lance/src/dataset/mem_wal/index/fts.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/lance-file/src/versions/v1/mod.rs:34 — `!field.is_blob() && !field.is_packed_struct()` appears character-identically in 2 files — rust/lance-file/src/versions/v1/mod.rs, rust/lance-file/src/versions/v2_0/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust/lance/src/dataset/scanner/fts.rs:1766 — `!self.fast_search && (!unindexed_fragments.is_empty() || !stale_rows.is_empty())` appears character-identically in 2 files — rust/lance/src/dataset/scanner/fts.rs, rust/lance/src/dataset/scanner/minhash.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/lance-linalg/src/simd/f32.rs:1159 — `!std::is_x86_feature_detected!("avx") || !std::is_x86_feature_detected!("fma")` appears character-identically in 2 files — rust/lance-linalg/src/simd/f32.rs, rust/lance-linalg/src/simd/f64.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/lance-io/src/scheduler.rs:209 — `(last_warn == 0 && seconds_elapsed > BACKPRESSURE_MIN && seconds_elapsed < BACKPRESSURE_DEBOUNCE) || since_last_warn > BACKPRESSURE_DEBOUNCE` appears character-identically in 2 files — rust/lance-io/src/scheduler.rs, rust/lance-io/src/scheduler/lite.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/lance/src/io/exec/fts/compound.rs:1150 — `base_scorer.is_some() && scorer_only_fuzzy && !scorer_override_covers_all` appears character-identically in 2 files — rust/lance/src/io/exec/fts/compound.rs, rust/lance/src/io/exec/fts/match_query.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/lance-encoding/src/encodings/physical/alp.rs:402 — `bits_per_value == 32 || bits_per_value == 64` appears character-identically in 2 files — rust/lance-encoding/src/encodings/physical/alp.rs, rust/lance-encoding/src/encodings/physical/byte_stream_split.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/lance-index/src/scalar/inverted/index/posting_list.rs:578 — `block_idx + 1 == num_blocks && remainder != 0` appears character-identically in 2 files — rust/lance-index/src/scalar/inverted/index/posting_list.rs, rust/lance-index/src/scalar/inverted/wand/posting.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/lance/src/dataset/mem_wal/scanner/fts_search.rs:1027 — `blocked.is_some() && !self.pk_columns.is_empty()` appears character-identically in 2 files — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs, rust/lance/src/dataset/mem_wal/scanner/vector_search.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust/lance-file/src/reader/structural.rs:312 — `comparable && children_share_parent_length(field)` appears character-identically in 2 files — rust/lance-file/src/reader/structural.rs, rust/lance-file/src/versions/v2_0/reader.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/lance-index/src/registry.rs:312 — `details_type_name.is_empty() || details_type_name.starts_with('.')` appears character-identically in 2 files — rust/lance-index/src/registry.rs, rust/lance/src/index/scalar.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/lance-index/src/vector/bq/storage.rs:2363 — `dist < lower_bound || dist >= upper_bound` appears character-identically in 4 files — rust/lance-index/src/vector/bq/storage.rs, rust/lance-index/src/vector/flat/index.rs, rust/lance-index/src/vector/pq/storage.rs, rust/lance-index/src/vector/storage.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/lance-file/src/reader/structural.rs:323 — `enforce_children && child_rows != expected` appears character-identically in 2 files — rust/lance-file/src/reader/structural.rs, rust/lance-file/src/versions/v2_0/reader.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/lance-file/src/reader.rs:530 — `field.is_blob() || field.is_packed_struct()` appears character-identically in 7 files — rust/lance-file/src/reader.rs, rust/lance-file/src/reader/structural.rs, rust/lance-file/src/versions/v1/mod.rs, rust/lance-file/src/versions/v2_0/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust/lance-table/src/utils/stream.rs:254 — `field.name() == ROW_ID || field.name() == ROW_ADDR` appears character-identically in 2 files — rust/lance-table/src/utils/stream.rs, rust/lance/src/dataset/update_join.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/lance/src/index/scalar.rs:1235 — `field_names.is_empty() || field_names.len() > 1` appears character-identically in 2 files — rust/lance/src/index/scalar.rs, rust/lance/src/index/vector.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/lance-encoding/src/compression.rs:1378 — `flat.bits_per_value == 0 || flat.data.is_some()` appears character-identically in 2 files — rust/lance-encoding/src/compression.rs, rust/lance-encoding/src/encodings/physical/value.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.
  • + 15 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned file · ×31
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/src/main/java/org/lance/otel/LanceMetrics.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file rust/lance-core/src/cache/backend_uri.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file rust/lance-file/src/versions/v1/encoding/dictionary.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/hd-vila/datagen.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file python/python/lance/_arrow/bf16.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/sift/metrics.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/src/main/java/org/lance/index/IndexOptions.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file rust/lance/src/dataset/schema_evolution/optimize.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/sift/perf.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file python/python/lance/_dataset/sharded_batch_iterator.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file rust/lance-core/src/levenshtein.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/full_report/vbench/runner.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/src/main/java/org/lance/ManifestSummary.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/src/main/java/org/lance/memwal/ExecutionPlan.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file rust/lance-core/src/utils/bloomfilter/as_bytes.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file rust/lance-linalg/src/simd/x86.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/dbpedia-openai/benchmarks.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/flat/benchmark.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/full_report/_lib.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/src/main/java/org/lance/memwal/ShardingField.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/src/main/java/org/lance/operation/Delete.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file benchmarks/sift/datagen.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 6 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×18
  • Interpolated log message defeats structured logging rust/lance-table/src/system_index/frag_reuse.rs:529 — `warn!` at line 529 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/lance-table/src/io/commit.rs:390 — `debug!` at line 390 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/lance-table/src/io/commit.rs:392 — `warn!` at line 392 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/lance-table/src/io/commit/dynamodb.rs:85 — `warn!` at line 85 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/lance-io/src/object_store/metrics.rs:122 — `warn!` at line 122 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/lance-index/src/scalar/bitmap.rs:1769 — `warn!` at line 1769 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/lance-core/src/memory/observer.rs:300 — `warn!` at line 300 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/lance-core/src/memory/telemetry.rs:128 — `warn!` at line 128 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/lance-core/src/memory/telemetry.rs:225 — `warn!` at line 225 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/lance/src/dataset.rs:5310 — `warn!` at line 5310 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/lance/src/index/vector/details.rs:415 — `warn!` at line 415 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/lance/src/dataset/cleanup.rs:3059 — `info!` at line 3059 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/lance/src/dataset/optimize/planning.rs:551 — `warn!` at line 551 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/lance/src/dataset/mem_wal/memtable/flush.rs:224 — `warn!` at line 224 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/lance/src/dataset/mem_wal/memtable/flush.rs:336 — `info!` at line 336 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/lance/src/dataset/mem_wal/memtable/flush.rs:385 — `info!` at line 385 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/lance/src/dataset/mem_wal/memtable/flush.rs:617 — `info!` at line 617 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/lance/src/dataset/mem_wal/memtable/flush.rs:683 — `info!` at line 683 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`.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on Err · ×8
  • Silent fallback default on Err python/src/indices.rs:769 — `new` turns every `Err` into `"<unknown>".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/lance/src/index/statistics.rs:110 — `legacy_type_name` turns every `Err` into `"N/A".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/lance/src/index/vector/builder.rs:1809 — `take_partition_batches` turns every `Err` into `0.0` — 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/lance/src/index/vector/details.rs:433 — `derive_vector_index_type` turns every `Err` into `"Vector".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/lance-geo/src/rtree.rs:247 — `from` turns every `Err` into `0` — 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/lance-index/src/scalar/inverted/combined/cursor.rs:33 — `tf_prime` turns every `Err` into `0.0` — 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/lance-io/src/object_store.rs:2322 — `download_retry_count` turns every `Err` into `3` — 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/lance-namespace-impls/src/credentials/aws.rs:322 — `derive_session_name_from_token` turns every `Err` into `"lance-web-identity".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.
D16 · Bus Factor · Off-boarding risk · ×6
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 28 significant file(s) lose their only recent owner: rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs, rust/lance-arrow/src/json.rs, rust/lance-encoding/src/encodings/physical/sequence.rs, rust/lance/src/dataset/blob/locate.rs, rust/lance-io/src/object_store/read_dir.rs, rust/lance-file/src/versions/mod.rs, ci/format_vote_gate.py, python/python/ci_benchmarks/datagen/merge_insert.py (+20 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 11 significant file(s) lose their only recent owner: rust/lance-index/src/vector/bq/ex_dot.rs, rust/lance-index/src/vector/sq/pairwise.rs, rust/lance/src/index/vector/bounded_partition_stream.rs, rust/lance-index/src/vector/bq/prune.rs, rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs, benchmarks/auto-ivf-dot/measure.py, rust/lance-index/src/scalar/inverted/index/search_candidates.rs, benchmarks/auto-ivf-dot/calibrate.py (+3 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 7 significant file(s) lose their only recent owner: rust/lance-index/src/frag_reuse/row_map.rs, rust/lance-table/src/system_index/frag_reuse/ledger.rs, rust/lance-index-core/src/remapping.rs, rust/lance-index/src/frag_reuse/stable_partition.rs, rust/lance/src/index/frag_reuse_reader/cache.rs, ci/arrow_upgrade.py, rust/lance-core/src/utils/fragment_reuse.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 4 significant file(s) lose their only recent owner: rust/lance/src/dataset/mem_wal/index/tests.rs, rust/lance/src/dataset/mem_wal/index/plugin.rs, rust/lance/src/dataset/mem_wal/index/query.rs, rust/lance/src/dataset/mem_wal/index/test_plugin.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 4 significant file(s) lose their only recent owner: rust/lance/src/index/vector/ivf/streaming_hamming/counter.rs, rust/lance/src/index/vector/ivf/coreset_algo/float_coreset.rs, rust/lance/src/index/vector/ivf/coreset_algo/hamming_coreset.rs, rust/lance/src/index/vector/ivf/coreset_algo/mod.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 3 significant file(s) lose their only recent owner: java/src/main/java/org/lance/Branch.java, java/src/main/java/org/lance/Tag.java, java/src/main/java/org/lance/Ref.java. Pair on, review, or document these before any departure.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×4
  • Silent fallback default on parse failure python/python/lance/pydantic.py:274 — `_safe_issubclass` (in `_pydantic_type_to_arrow_type`) returns `False` when `TypeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure ci/check_dependency_age.py:81 — `parse_cache_file` returns `{}` when `(json.JSONDecodeError, KeyError, UnicodeDecodeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure ci/new_contributors.py:35 — `load_username_cache` returns `{}` when `(json.JSONDecodeError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure ci/review_stats.py:27 — `load_cache` returns `{}` when `(json.JSONDecodeError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D30 · Dependency Vulnerabilities · Medium CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 12 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 (72 single-owned of 1127 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; 1127 of the 1363 production source files in this repository met that bar). They are anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (1 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)) (+6 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: rust/lance-index/src/scalar/inverted/combined/stats.rs, rust/lance-index/src/scalar/inverted/combined.rs, ci/new_contributors.py, ci/review_stats.py, rust/lance/benches/mem_wal/fts/LuceneFtsBench.java, rust/lance-table/src/rowids/runs.rs, rust/lance-arrow/src/list.rs, java/src/main/java/org/lance/namespace/RestAdapter.java (+6 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found test_data/fri_straddle_pre_6610/datagen/src/main.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 `test_data/fri_straddle_pre_6610/datagen/src/main.rs` makes this repository a deployable product (line 1).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 9 of 35 project(s) overshoot their size bounds, lowering Project Cohesion to 5.0/10. The most over is `rust/lance` (367485 LoC, 720 module-visible types across 52 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 31 of 1127 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (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; 1127 of the 1363 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: REDACTED, java/src/main/java/org/lance/otel/LanceMetrics.java, rust/lance-core/src/cache/backend_uri.rs, rust/lance-file/src/versions/v1/encoding/dictionary.rs, benchmarks/hd-vila/datagen.py, python/python/lance/_arrow/bf16.py, benchmarks/sift/metrics.py, java/src/main/java/org/lance/index/IndexOptions.java (and 23 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P10 · Library API & versioning · Implementation type on the public API · ×1
  • Implementation type on the public API rust/lance-core/src/cache/codec.rs:220 — 1 public type in `lance_core.cache.codec` is marked as implementation by its own namespace, folder or name: `CacheCodecImpl` (rust/lance-core/src/cache/codec.rs:220, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 16/21 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `memtest`, `protos/codegen`, `rust/lance-tools`.
P3 · Security & performance tooling · Dependabot does not watch github-actions/gitsubmodule · ×1
  • Dependabot does not watch github-actions/gitsubmodule REDACTED:2 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (rust/lance-namespace-impls/src/rest_adapter.rs:203).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (rust/lance-namespace-impls/src/rest_adapter.rs:203).
X5 · Nullable reference types · Java packages are not null-marked everywhere · ×1
  • Java packages are not null-marked everywhere — 0/22 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand rust/lance-io/src/object_store/throttle.rs:86 — `lowercase.contains("429 too many requests")` can never decide this `||` — every value satisfying `lowercase.contains("429 too many requests")` also satisfies `lowercase.contains("too many requests")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Minor — 77 finding(s)
D12 · Dependency Hygiene · Outdated (test) · ×43
  • Outdated (test): software.amazon.awssdk:sdk-core — software.amazon.awssdk:sdk-core 2.20.26 → 2.59.0 available.
  • Outdated (test): org.junit.jupiter:junit-jupiter-params — org.junit.jupiter:junit-jupiter-params 5.10.1 → 6.1.3 available.
  • Outdated (test): io.netty:netty-resolver — io.netty:netty-resolver 4.1.86.Final → 4.2.20.Final available.
  • Outdated (test): io.opentelemetry:opentelemetry-sdk-metrics — io.opentelemetry:opentelemetry-sdk-metrics 1.64.0 → 1.68.0 available.
  • Outdated (test): software.amazon.awssdk:protocol-core — software.amazon.awssdk:protocol-core 2.20.26 → 2.59.0 available.
  • Outdated (test): software.amazon.awssdk:json-utils — software.amazon.awssdk:json-utils 2.20.26 → 2.59.0 available.
  • Outdated (test): software.amazon.awssdk:netty-nio-client — software.amazon.awssdk:netty-nio-client 2.20.26 → 2.59.0 available.
  • Outdated (test): io.netty:netty-codec — io.netty:netty-codec 4.1.86.Final → 4.2.20.Final available.
  • Outdated (test): org.reactivestreams:reactive-streams — org.reactivestreams:reactive-streams 1.0.3 → 1.0.4 available.
  • Outdated (test): software.amazon.awssdk:endpoints-spi — software.amazon.awssdk:endpoints-spi 2.20.26 → 2.59.0 available.
  • Outdated (test): io.netty:netty-transport-native-unix-common — io.netty:netty-transport-native-unix-common 4.1.86.Final → 4.2.20.Final available.
  • Outdated (test): io.opentelemetry:opentelemetry-sdk-trace — io.opentelemetry:opentelemetry-sdk-trace 1.64.0 → 1.68.0 available.
  • Outdated (test): software.amazon.awssdk:metrics-spi — software.amazon.awssdk:metrics-spi 2.20.26 → 2.59.0 available.
  • Outdated (test): software.amazon.awssdk:annotations — software.amazon.awssdk:annotations 2.20.26 → 2.59.0 available.
  • Outdated (test): io.netty:netty-transport — io.netty:netty-transport 4.1.86.Final → 4.2.20.Final available.
  • Outdated (test): org.junit.platform:junit-platform-commons — org.junit.platform:junit-platform-commons 1.10.1 → 6.1.3 available.
  • Outdated (test): software.amazon.awssdk:profiles — software.amazon.awssdk:profiles 2.20.26 → 2.59.0 available.
  • Outdated (test): io.netty:netty-handler — io.netty:netty-handler 4.1.86.Final → 4.2.20.Final available.
  • Outdated (test): io.opentelemetry:opentelemetry-sdk-logs — io.opentelemetry:opentelemetry-sdk-logs 1.64.0 → 1.68.0 available.
  • Outdated (test): org.junit.jupiter:junit-jupiter-engine — org.junit.jupiter:junit-jupiter-engine 5.10.1 → 6.1.3 available.
  • Outdated (test): software.amazon.awssdk:arns — software.amazon.awssdk:arns 2.20.26 → 2.59.0 available.
  • Outdated (test): io.netty:netty-transport-classes-epoll — io.netty:netty-transport-classes-epoll 4.1.86.Final → 4.2.20.Final available.
  • Outdated (test): software.amazon.awssdk:http-client-spi — software.amazon.awssdk:http-client-spi 2.20.26 → 2.59.0 available.
  • Outdated (test): org.junit.jupiter:junit-jupiter-api — org.junit.jupiter:junit-jupiter-api 5.10.1 → 6.1.3 available.
  • Outdated (test): commons-logging:commons-logging — commons-logging:commons-logging 1.2 → 1.4.0 available.
  • + 18 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (compile) · ×34
  • Outdated (compile): com.fasterxml.jackson.core:jackson-core — com.fasterxml.jackson.core:jackson-core 2.18.3 → 2.23.0 available.
  • Outdated (compile): org.apache.arrow:arrow-vector — org.apache.arrow:arrow-vector 18.3.0 → 19.0.0 available.
  • Outdated (compile): org.openapitools:jackson-databind-nullable — org.openapitools:jackson-databind-nullable 0.2.6 → 0.2.13 available.
  • Outdated (compile): io.netty:netty-buffer — io.netty:netty-buffer 4.1.119.Final → 4.2.20.Final available.
  • Outdated (compile): io.netty:netty-common — io.netty:netty-common 4.1.119.Final → 4.2.20.Final available.
  • Outdated (compile): org.slf4j:slf4j-api — org.slf4j:slf4j-api 2.0.17 → 2.0.20 available.
  • Outdated (compile): org.lance:lance-namespace-core — org.lance:lance-namespace-core 0.12.0 → 0.13.0 available.
  • Outdated (compile): org.apache.arrow:arrow-memory-netty-buffer-patch — org.apache.arrow:arrow-memory-netty-buffer-patch 18.3.0 → 19.0.0 available.
  • Outdated (compile): org.apache.arrow:arrow-format — org.apache.arrow:arrow-format 18.3.0 → 19.0.0 available.
  • Outdated (compile): jakarta.activation:jakarta.activation-api — jakarta.activation:jakarta.activation-api 1.2.2 → 2.1.4 available.
  • Outdated (compile): commons-codec:commons-codec — commons-codec:commons-codec 1.18.0 → 1.23.0 available.
  • Outdated (compile): org.apache.httpcomponents.core5:httpcore5 — org.apache.httpcomponents.core5:httpcore5 5.2 → 5.4.4 available.
  • Outdated (compile): org.lance:lance-namespace-apache-client — org.lance:lance-namespace-apache-client 0.12.0 → 0.13.0 available.
  • Outdated (compile): io.opentelemetry:opentelemetry-context — io.opentelemetry:opentelemetry-context 1.64.0 → 1.68.0 available.
  • Outdated (compile): io.opentelemetry:opentelemetry-api — io.opentelemetry:opentelemetry-api 1.64.0 → 1.68.0 available.
  • Outdated (compile): org.apache.httpcomponents.core5:httpcore5-h2 — org.apache.httpcomponents.core5:httpcore5-h2 5.2 → 5.4.4 available.
  • Outdated (compile): com.fasterxml.jackson.core:jackson-databind — com.fasterxml.jackson.core:jackson-databind 2.18.11 → 2.23.0 available.
  • Outdated (compile): org.apache.arrow:arrow-memory-netty — org.apache.arrow:arrow-memory-netty 18.3.0 → 19.0.0 available.
  • Outdated (compile): com.fasterxml.jackson.jaxrs:jackson-jaxrs-base — com.fasterxml.jackson.jaxrs:jackson-jaxrs-base 2.17.1 → 2.23.0 available.
  • Outdated (compile): jakarta.xml.bind:jakarta.xml.bind-api — jakarta.xml.bind:jakarta.xml.bind-api 2.3.3 → 4.0.5 available.
  • Outdated (compile): org.apache.arrow:arrow-c-data — org.apache.arrow:arrow-c-data 18.3.0 → 19.0.0 available.
  • Outdated (compile): org.apache.arrow:arrow-memory-core — org.apache.arrow:arrow-memory-core 18.3.0 → 19.0.0 available.
  • Outdated (compile): com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider — com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider 2.17.1 → 2.23.0 available.
  • Outdated (compile): com.fasterxml.jackson.module:jackson-module-jaxb-annotations — com.fasterxml.jackson.module:jackson-module-jaxb-annotations 2.17.1 → 2.23.0 available.
  • Outdated (compile): org.apache.httpcomponents.client5:httpclient5 — org.apache.httpcomponents.client5:httpclient5 5.2.1 → 5.6.5 available.
  • + 9 more in this group — see findings.md.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-ade42fbc552545088a82962dd159cc50/history.json --exit-code 0 --source .43artifacts/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-ade42fbc552545088a82962dd159cc50/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 notebooks --exclude rust/lance/src/pb --exclude rust/lance-datafusion/src/pb --exclude rust/lance-encoding/src/pb --exclude rust/lance-file/src/pb --exclude rust/lance-index/src/pb --exclude rust/lance-table/src/pb .56artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .61artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .4artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1db38-2ed4-791d-b760-4d1e2b393f17 · 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