Public report of lance-format/lance, published 27 October 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.10.5). 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, 27 October 2026, 15:28 UTC · Survey ID cd_346852a8e5454bd48ad0bdd140f8600c

lance-format/lance

Measured 27 October 2026, 15:21 UTC, at code version 1947d1f

No regression since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

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

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

A very large codebase: 915,890 lines of product code in 33 projects, tests not counted · Estimated rebuild effort: about 8.5 person-years · Weakest lens: Code Health, 56

Findings by how serious they are

69 critical 2899 serious 108 minor

15 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 15:21 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 Watchdog. It is open to any tool that implements it, and today Watchdog 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. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

73of 73 dimensions measured by tools.
3049of 3076 findings point to an exact file and line, so you can open each one in the code. The other 27 concern the repository as a whole, such as missing documentation.
73dimensions across 7 lenses, read from 915,890 lines of product code in 33 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 62 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 4 points. Writing log messages as searchable templates comes next, worth about 3 points. Raising Code Health to 70 would lift the score to about 66.

Twenty-two pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline. Fifteen known security holes in the packages the code depends on can be used by attackers, and thirteen pipeline steps install packages that can change without warning. Passing outside input through environment variables, updating the vulnerable packages and pinning what the pipeline installs 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 the two passwords or keys in the code's history need replacing, with the old ones switched off. The four pages or frames without a title need a descriptive title.

The product code is 915,890 lines, about €1,200,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 61 · counts for 25%Accessibility 64 · counts for 14%Production Readiness 75 · counts for 8%Maturity 79 · counts for 4%Performance 82 · counts for 2%Architecture 95 · counts for 1%

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

Code composition: what the lines of code are
Product code 82%Tests 18%
New since the last survey: 433 findings

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

  • Cyclomatic Complexity · lance_datafusion_exec::expr::safe_coerce_scalar (cyclomatic 211) rust/lance-datafusion-exec/src/expr.rs
  • Cyclomatic Complexity · DirectoryNamespace::describe_table_impl (cyclomatic 36) rust/lance-namespace-impls/src/dir/load.rs
  • Cyclomatic Complexity · DecodeMiniBlockTask::map_range (cyclomatic 35) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::axis_delta::x86_64::transform_width (cyclomatic 34) rust/lance-encoding/src/encodings/physical/axis_delta/x86_64.rs
  • Cyclomatic Complexity · DirectoryNamespace::query_table (cyclomatic 34) rust/lance-namespace-impls/src/dir/namespace.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::encode_dense_page (cyclomatic 32) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cyclomatic Complexity · lance_encoding::encodings::logical::primitive::sparse::planar::encode (cyclomatic 29) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cyclomatic Complexity · lance::dataset::blob::external::collect_external_blob_uris (cyclomatic 27) rust/lance/src/dataset/blob/external.rs
  • Cyclomatic Complexity · PlanarSparseScheduler::try_new (cyclomatic 26) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cyclomatic Complexity · DirectoryNamespace::build_index_params (cyclomatic 26) rust/lance-namespace-impls/src/dir/index_params.rs
  • Cyclomatic Complexity · BlobPreprocessor::logical_to_prepared_blob_array (cyclomatic 25) rust/lance/src/dataset/blob/write.rs
  • Cyclomatic Complexity · lance::index::vector::ivf::train_weighted_hierarchical_kmeans (cyclomatic 25) rust/lance/src/index/vector/ivf.rs
  • Cyclomatic Complexity · DirectoryNamespace::alter_transaction (cyclomatic 25) rust/lance-namespace-impls/src/dir/namespace.rs
  • Cyclomatic Complexity · lance_index::scalar::zonemap::parse_seed_for_binary_copy (cyclomatic 24) rust/lance-index/src/scalar/zonemap.rs
  • Cyclomatic Complexity · DataBlock::from_arrays_impl (cyclomatic 23) rust/lance-encoding/src/data.rs
  • Cyclomatic Complexity · lance_encoding::encodings::logical::primitive::planar::validate_page (cyclomatic 23) rust/lance-encoding/src/encodings/logical/primitive/planar.rs
  • Cyclomatic Complexity · PlanarSparseScheduler::init_from_buffers (cyclomatic 22) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::sample_unique_ratio (cyclomatic 22) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::axis_delta::try_tensor_per_value (cyclomatic 22) rust/lance-encoding/src/encodings/physical/axis_delta.rs
  • Cyclomatic Complexity · lance::index::optimize::consolidate::plan_index (cyclomatic 21) rust/lance/src/index/optimize/consolidate.rs
  • Cyclomatic Complexity · ChunkInstructions::schedule_instructions (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::should_dictionary_encode (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cyclomatic Complexity · lance::index::append::try_harvest_seeds (cyclomatic 20) rust/lance/src/index/append.rs
  • Cyclomatic Complexity · Scanner::plan_restricted_match_query (cyclomatic 19) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · lance_datafusion::logical_expr::resolve_expr (cyclomatic 19) rust/lance-datafusion/src/logical_expr.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::serialize_miniblocks (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::is_constant_values (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cyclomatic Complexity · lance_linalg::distance::arrow::dispatch (cyclomatic 19) rust/lance-linalg/src/distance/arrow.rs
  • Cyclomatic Complexity · MemTableFlushHandler::flush_memtable (cyclomatic 18) rust/lance/src/dataset/mem_wal/write.rs
  • Cyclomatic Complexity · lance::index::optimize::commit_optimize_indices (cyclomatic 18) rust/lance/src/index/optimize.rs
  • Cyclomatic Complexity · lance::index::optimize::consolidate::validate_commit (cyclomatic 18) rust/lance/src/index/optimize/consolidate.rs
  • Cyclomatic Complexity · PlanarSparseTask::decode_checked (cyclomatic 18) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cyclomatic Complexity · lance_io::object_store::throttle::error_document_code (cyclomatic 18) rust/lance-io/src/object_store/throttle.rs
  • Cyclomatic Complexity · Builder.tokenizerParams (cyclomatic 18) java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java
  • Cyclomatic Complexity · FileFragment::open (cyclomatic 17) rust/lance/src/dataset/fragment.rs
  • Cyclomatic Complexity · TransactionRebase::check_data_overlay_txn (cyclomatic 17) rust/lance/src/io/commit/conflict_resolver.rs
  • Cyclomatic Complexity · lance::dataset::optimize::can_use_binary_copy_current (cyclomatic 17) rust/lance/src/dataset/optimize.rs
  • Cyclomatic Complexity · lance::index::build_index_metadata_from_segments (cyclomatic 17) rust/lance/src/index.rs
  • Cyclomatic Complexity · Field::do_intersection (cyclomatic 17) rust/lance-core/src/datatypes/field.rs
  • Cyclomatic Complexity · PlanarPrimitiveEncoding::try_plan_pages (cyclomatic 17) rust/lance-encoding/src/encodings/logical/primitive/planar.rs
  • Cyclomatic Complexity · DirectoryNamespace::apply_query_params_to_scanner (cyclomatic 17) rust/lance-namespace-impls/src/dir/query.rs
  • Cyclomatic Complexity · CleanupTask::process_manifest_file (cyclomatic 16) rust/lance/src/dataset/cleanup.rs
  • Cyclomatic Complexity · CreateIndexBuilder::execute_multi_segment_fmindex (cyclomatic 16) rust/lance/src/index/create.rs
  • Cyclomatic Complexity · lance::index::vector::prepare_vector_segment_build (cyclomatic 16) rust/lance/src/index/vector.rs
  • Cyclomatic Complexity · lance::index::vector::ivf::train_ivf_model_from_sample (cyclomatic 16) rust/lance/src/index/vector/ivf.rs
  • Cyclomatic Complexity · lance_datafusion_exec::exec::collect_execution_metrics (cyclomatic 16) rust/lance-datafusion-exec/src/exec.rs
  • Cyclomatic Complexity · lance_encoding::encodings::physical::alp::parse_header (cyclomatic 16) rust/lance-encoding/src/encodings/physical/alp.rs
  • Cognitive Complexity · DecodeMiniBlockTask::map_range (cognitive 128) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs
  • Cognitive Complexity · lance_datafusion_exec::expr::safe_coerce_scalar (cognitive 71) rust/lance-datafusion-exec/src/expr.rs
  • Cognitive Complexity · DirectoryNamespace::describe_table_impl (cognitive 64) rust/lance-namespace-impls/src/dir/load.rs
  • Cognitive Complexity · BlobPreprocessor::logical_to_prepared_blob_array (cognitive 53) rust/lance/src/dataset/blob/write.rs
  • Cognitive Complexity · ChunkInstructions::schedule_instructions (cognitive 52) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs
  • Cognitive Complexity · lance_encoding::encodings::physical::axis_delta::x86_64::transform_width (cognitive 50) rust/lance-encoding/src/encodings/physical/axis_delta/x86_64.rs
  • Cognitive Complexity · DirectoryNamespace::alter_transaction (cognitive 49) rust/lance-namespace-impls/src/dir/namespace.rs
  • Cognitive Complexity · DirectoryNamespace::query_table (cognitive 45) rust/lance-namespace-impls/src/dir/namespace.rs
  • Cognitive Complexity · lance::index::vector::ivf::train_weighted_hierarchical_kmeans (cognitive 44) rust/lance/src/index/vector/ivf.rs
  • Cognitive Complexity · lance_encoding::encodings::logical::primitive::sparse::planar::encode (cognitive 44) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cognitive Complexity · lance::index::optimize::consolidate::validate_commit (cognitive 42) rust/lance/src/index/optimize/consolidate.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::encode_dense_page (cognitive 40) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cognitive Complexity · PlanarSparseTask::decode_checked (cognitive 37) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::is_constant_values (cognitive 37) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cognitive Complexity · lance::dataset::blob::external::collect_external_blob_uris (cognitive 36) rust/lance/src/dataset/blob/external.rs
  • Cognitive Complexity · LazyLevels::seek_row_start (cognitive 36) rust/lance-encoding/src/encodings/logical/primitive/all_null.rs
  • Cognitive Complexity · FixedFullZipDecodeTask::decode (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::sample_unique_ratio (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cognitive Complexity · PlanarSparseScheduler::try_new (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::serialize_miniblocks (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::compress_levels (cognitive 31) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cognitive Complexity · lance_index::scalar::zonemap::parse_seed_for_binary_copy (cognitive 30) rust/lance-index/src/scalar/zonemap.rs
  • Cognitive Complexity · DatasetIndexRemapper::remap_indices_with_context (cognitive 29) rust/lance/src/dataset/index.rs
  • Cognitive Complexity · lance::index::build_index_metadata_from_segments (cognitive 28) rust/lance/src/index.rs
  • Cognitive Complexity · lance::index::optimize::commit_optimize_indices (cognitive 28) rust/lance/src/index/optimize.rs
  • Cognitive Complexity · lance::dataset::optimize::load_index_fragmaps (cognitive 27) rust/lance/src/dataset/optimize.rs
  • Cognitive Complexity · lance::index::optimize::consolidate::plan_index (cognitive 27) rust/lance/src/index/optimize/consolidate.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::should_dictionary_encode (cognitive 27) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cognitive Complexity · FixedFullZipDecoder::slice_next_task (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs
  • Cognitive Complexity · VariableFullZipDecoder::unzip (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs
  • Cognitive Complexity · PlanarSparseScheduler::init_from_buffers (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::serialize_full_zip_variable (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs
  • Cognitive Complexity · lance_encoding::encodings::logical::primitive::planar::validate_page (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/planar.rs
  • Cognitive Complexity · Transaction::handle_rewrite_fragments (cognitive 24) rust/lance-table/src/transaction/index_maintenance.rs
  • Cognitive Complexity · Scanner::plan_restricted_match_query (cognitive 23) rust/lance/src/dataset/scanner.rs
  • Cognitive Complexity · lance::dataset::optimize::binary_copy::seed_carry::extract_source_seeds (cognitive 23) rust/lance/src/dataset/optimize/binary_copy/seed_carry.rs
  • Cognitive Complexity · DirectoryNamespace::list_tables (cognitive 23) rust/lance-namespace-impls/src/dir/namespace.rs
  • Cognitive Complexity · DirectoryNamespace::apply_query_params_to_scanner (cognitive 23) rust/lance-namespace-impls/src/dir/query.rs
  • Cognitive Complexity · PageBufferReader::new (cognitive 22) rust/lance-file/src/concat.rs
  • Cognitive Complexity · Transaction::handle_rewrite_indices (cognitive 22) rust/lance-table/src/transaction/index_maintenance.rs
  • Cognitive Complexity · BlobPreprocessor::preprocess_field (cognitive 21) rust/lance/src/dataset/blob/write.rs
  • Cognitive Complexity · ShardWriter::drain_for_close (cognitive 21) rust/lance/src/dataset/mem_wal/write.rs
  • Cognitive Complexity · OutputSeedAccumulator::finish (cognitive 21) rust/lance/src/dataset/optimize/binary_copy/seed_carry.rs
  • Cognitive Complexity · lance::dataset::blob::managed::visit_managed_row (cognitive 21) rust/lance/src/dataset/blob/managed.rs
  • Cognitive Complexity · lance::dataset::blob::prepared::prepared_blob_to_descriptor (cognitive 21) rust/lance/src/dataset/blob/prepared.rs
  • Cognitive Complexity · lance::index::optimize::plan_optimize_indices_or_skip (cognitive 21) rust/lance/src/index/optimize.rs
  • Cognitive Complexity · lance_encoding::encodings::physical::alp::pack_chunk_f32 (cognitive 21) rust/lance-encoding/src/encodings/physical/alp.rs
  • Cognitive Complexity · lance_encoding::encodings::physical::alp::pack_chunk_f64 (cognitive 21) rust/lance-encoding/src/encodings/physical/alp.rs
  • Cognitive Complexity · PostingListReader::build_packed_chunk (cognitive 21) rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs
  • Cognitive Complexity · NGramIndexBuilder::stream_spill_reader (cognitive 21) rust/lance-index/src/scalar/ngram.rs
  • Cognitive Complexity · ZoneMapSeedWriter::deserialize_seed (cognitive 21) rust/lance-index/src/scalar/zonemap.rs
  • Cognitive Complexity · DirectoryNamespace::list_versions_under (cognitive 21) rust/lance-namespace-impls/src/dir/versions.rs
  • Cognitive Complexity · lance_table::transaction::validate::schema_fragments_modern_valid (cognitive 21) rust/lance-table/src/transaction/validate.rs

Watchdog compares 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: 309 findings

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

  • Cyclomatic Complexity · lance_datafusion::expr::safe_coerce_scalar (cyclomatic 211) rust/lance-datafusion/src/expr.rs
  • Cyclomatic Complexity · DirectoryNamespace::describe_table_impl (cyclomatic 36) rust/lance-namespace-impls/src/dir.rs
  • Cyclomatic Complexity · DecodeMiniBlockTask::map_range (cyclomatic 34) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cyclomatic Complexity · DirectoryNamespace::query_table (cyclomatic 34) rust/lance-namespace-impls/src/dir.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::encode_dense_page (cyclomatic 30) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cyclomatic Complexity · lance::dataset::blob::collect_external_blob_uris (cyclomatic 27) rust/lance/src/dataset/blob.rs
  • Cyclomatic Complexity · Builder.build (cyclomatic 27) java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java
  • Cyclomatic Complexity · DirectoryNamespace::build_index_params (cyclomatic 26) rust/lance-namespace-impls/src/dir.rs
  • Cyclomatic Complexity · BlobPreprocessor::logical_to_prepared_blob_array (cyclomatic 25) rust/lance/src/dataset/blob.rs
  • Cyclomatic Complexity · DirectoryNamespace::alter_transaction (cyclomatic 25) rust/lance-namespace-impls/src/dir.rs
  • Cyclomatic Complexity · lance_index::scalar::expression::extract_like_leading_prefix (cyclomatic 24) rust/lance-index/src/scalar/expression.rs
  • Cyclomatic Complexity · ChunkInstructions::schedule_instructions (cyclomatic 22) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cyclomatic Complexity · lance::index::vector::ivf::train_weighted_hierarchical_f32_kmeans (cyclomatic 21) rust/lance/src/index/vector/ivf.rs
  • Cyclomatic Complexity · Scanner::new_filtered_read (cyclomatic 20) rust/lance/src/dataset/scanner.rs
  • Cyclomatic Complexity · DataBlock::from_arrays (cyclomatic 20) rust/lance-encoding/src/data.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::serialize_miniblocks (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::is_constant_values (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::sample_unique_ratio (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cyclomatic Complexity · lance_core::utils::cpu::detect_host_features (cyclomatic 18) rust/lance-core/src/utils/cpu.rs
  • Cyclomatic Complexity · PrimitiveStructuralEncoder::should_dictionary_encode (cyclomatic 18) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cyclomatic Complexity · LsmPointLookupPlanner::lookup_many (cyclomatic 17) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs
  • Cyclomatic Complexity · lance_linalg::distance::multivec_distance (cyclomatic 17) rust/lance-linalg/src/distance.rs
  • Cyclomatic Complexity · DirectoryNamespace::apply_query_params_to_scanner (cyclomatic 17) rust/lance-namespace-impls/src/dir.rs
  • Cyclomatic Complexity · lance::dataset::write::prepare_write_schema (cyclomatic 16) rust/lance/src/dataset/write.rs
  • Cyclomatic Complexity · lance_datafusion::exec::collect_execution_metrics (cyclomatic 16) rust/lance-datafusion/src/exec.rs
  • Cognitive Complexity · DecodeMiniBlockTask::map_range (cognitive 124) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · lance_datafusion::expr::safe_coerce_scalar (cognitive 71) rust/lance-datafusion/src/expr.rs
  • Cognitive Complexity · DirectoryNamespace::describe_table_impl (cognitive 64) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · BlobPreprocessor::logical_to_prepared_blob_array (cognitive 53) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · ChunkInstructions::schedule_instructions (cognitive 52) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · DirectoryNamespace::alter_transaction (cognitive 49) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · DirectoryNamespace::query_table (cognitive 45) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::is_constant_values (cognitive 37) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · lance::dataset::blob::collect_external_blob_uris (cognitive 36) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · lance::index::vector::ivf::train_weighted_hierarchical_f32_kmeans (cognitive 36) rust/lance/src/index/vector/ivf.rs
  • Cognitive Complexity · LazyLevels::seek_row_start (cognitive 36) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · lance_index::scalar::expression::extract_like_leading_prefix (cognitive 36) rust/lance-index/src/scalar/expression.rs
  • Cognitive Complexity · FixedFullZipDecodeTask::decode (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::encode_dense_page (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::serialize_miniblocks (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::compress_levels (cognitive 31) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::sample_unique_ratio (cognitive 31) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · FixedFullZipDecoder::slice_next_task (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::serialize_full_zip_variable (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · Builder.build (cognitive 26) java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java
  • Cognitive Complexity · DatasetIndexRemapper::remap_indices (cognitive 24) rust/lance/src/dataset/index.rs
  • Cognitive Complexity · DirectoryNamespace::apply_query_params_to_scanner (cognitive 23) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · DirectoryNamespace::list_tables (cognitive 23) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · lance_linalg::distance::multivec_distance (cognitive 22) rust/lance-linalg/src/distance.rs
  • Cognitive Complexity · BlobPreprocessor::preprocess_field (cognitive 21) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · LsmPointLookupPlanner::lookup_many (cognitive 21) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs
  • Cognitive Complexity · lance::dataset::blob::prepared_blob_to_descriptor (cognitive 21) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · lance::dataset::blob::visit_managed_row (cognitive 21) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · lance::dataset::cleanup::build_cleanup_policy (cognitive 21) rust/lance/src/dataset/cleanup.rs
  • Cognitive Complexity · StrictBatchSizeStream::poll_next (cognitive 21) rust/lance-datafusion/src/chunker.rs
  • Cognitive Complexity · VariableFullZipDecoder::unzip (cognitive 21) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · DirectoryNamespace::list_versions_under (cognitive 21) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · Dataset::optimize_indices (cognitive 20) rust/lance/src/index.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::serialize_full_zip_fixed (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · PrimitiveStructuralEncoder::should_dictionary_encode (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · lance_encoding::encodings::logical::primitive::for_each_page_range (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · FilteredReadStream::read_fragment (cognitive 19) rust/lance/src/io/exec/filtered_read.rs
  • Cognitive Complexity · BatchReaderChunker::next_sized (cognitive 19) rust/lance-datafusion/src/chunker.rs
  • Cognitive Complexity · lance_index::scalar::rtree::merge_rtree_indices (cognitive 19) rust/lance-index/src/scalar/rtree.rs
  • Cognitive Complexity · lance::dataset::blob::fulfill_pending_blob_reads (cognitive 18) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · ObjectStore::copy_via_stream (cognitive 18) rust/lance-io/src/object_store.rs
  • Cognitive Complexity · DirectoryNamespace::build_index_params (cognitive 18) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · lance::dataset::blob::estimate_blob_v2_materialized_array_bytes (cognitive 17) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · lance::dataset::blob::materialize_blob_v2_descriptors (cognitive 17) rust/lance/src/dataset/blob.rs
  • Cognitive Complexity · lance_core::utils::cpu::detect_host_features (cognitive 17) rust/lance-core/src/utils/cpu.rs
  • Cognitive Complexity · lance_index::scalar::inverted::builder::merge_metadata_files (cognitive 17) rust/lance-index/src/scalar/inverted/builder.rs
  • Cognitive Complexity · ShardManifestStore::find_latest_version (cognitive 16) rust/lance/src/dataset/mem_wal/manifest.rs
  • Cognitive Complexity · ShardWriter::close (cognitive 16) rust/lance/src/dataset/mem_wal/write.rs
  • Cognitive Complexity · lance::index::build_provenance (cognitive 16) rust/lance/src/index.rs
  • Cognitive Complexity · lance_arrow::stream::rechunk_stream_by_size_inner (cognitive 16) rust/lance-arrow/src/stream.rs
  • Cognitive Complexity · lance_datafusion::exec::collect_execution_metrics (cognitive 16) rust/lance-datafusion/src/exec.rs
  • Cognitive Complexity · lance_datafusion::udf::json::check_array_contains (cognitive 16) rust/lance-datafusion/src/udf/json.rs
  • Cognitive Complexity · StructuralPrimitiveFieldDecoder::plan_decoded_bytes (cognitive 16) rust/lance-encoding/src/encodings/logical/primitive.rs
  • Cognitive Complexity · PostingListBatchBuilder::append (cognitive 16) rust/lance-index/src/scalar/inverted/index/posting_batch_builder.rs
  • Cognitive Complexity · lance_namespace_impls::dir::build_engine_fts_query (cognitive 16) rust/lance-namespace-impls/src/dir.rs
  • Cognitive Complexity · Operation::modifies_same_metadata (cognitive 16) rust/lance-table/src/transaction/conflicts.rs
  • God Classes · FileTooLong: logical/primitive.rs rust/lance-encoding/src/encodings/logical/primitive.rs
  • God Classes · ClassTooLong: DirectoryNamespace rust/lance-namespace-impls/src/dir.rs
  • God Classes · FileTooLong: src/dir.rs rust/lance-namespace-impls/src/dir.rs
  • God Classes · FileTooLong: dataset/blob.rs rust/lance/src/dataset/blob.rs
  • God Classes · FunctionTooLong: lance_datafusion::expr::safe_coerce_scalar rust/lance-datafusion/src/expr.rs
  • God Classes · ClassTooLong: PrimitiveStructuralEncoder rust/lance-encoding/src/encodings/logical/primitive.rs
  • God Classes · MethodTooLong: PrimitiveStructuralEncoder.encode_dense_page rust/lance-encoding/src/encodings/logical/primitive.rs
  • God Classes · MethodTooLong: DirectoryNamespace.describe_table_impl rust/lance-namespace-impls/src/dir.rs
  • God Classes · ClassTooLong: SparseStructuralScheduler rust/lance-encoding/src/encodings/logical/primitive/sparse.rs
  • God Classes · ClassTooLong: BlobPreprocessor rust/lance/src/dataset/blob.rs
  • God Classes · MethodTooLong: ObjectStore.copy_via_stream rust/lance-io/src/object_store.rs
  • God Classes · MethodTooLong: DirectoryNamespace.query_table rust/lance-namespace-impls/src/dir.rs
  • God Classes · MethodTooLong: BlobPreprocessor.logical_to_prepared_blob_array rust/lance/src/dataset/blob.rs
  • God Classes · FileTooLong: src/exec.rs rust/lance-datafusion/src/exec.rs
  • God Classes · FunctionTooLong: lance::index::vector::ivf::train_weighted_hierarchical_f32_kmeans rust/lance/src/index/vector/ivf.rs
  • God Classes · MethodTooLong: DirectoryNamespace.alter_transaction rust/lance-namespace-impls/src/dir.rs
  • God Classes · FunctionTooLong: lance::dataset::blob::collect_external_blob_uris rust/lance/src/dataset/blob.rs
  • God Classes · MethodTooLong: DecodeSparseStructuralTask.decode_value_chunk rust/lance-encoding/src/encodings/logical/primitive/sparse.rs
  • God Classes · MethodTooLong: DecodeMiniBlockTask.map_range rust/lance-encoding/src/encodings/logical/primitive.rs
Rebuild cost: about €1,200,000 · Estimate
Cost to rebuild€410,000 to €2,100,000, for 6,860 to 21,761 hours of work, about 8.5 person-years for 5 to 17 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.8 at a score of 62. 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: 915,890 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: Watchdog prices 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 4 points · Medium effort · Nullable reference types
2
Interpolated log message defeats structured logging
Raises the score by about 3 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,200,000 to build again, about 8.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 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.1 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 769,286 lines over the last 90 days, which is about 3,119,882 lines a year. At that pace, the extra work comes to an estimated 167.9 to 1040 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 Watchdog's 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-bitpacking lance-bitpacking lance->lance-bitpacking 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-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-bitpacking lance-encoding->lance-core (Cargo) lance-file->lance-arrow lance-file->lance-core (Cargo) lance-file->lance-encoding lance-file->lance-io lance-index->lance-arrow lance-index->lance-bitpacking lance-index->lance-core (Cargo) lance-index->lance-datafusion-exec lance-index->lance-encoding lance-index->lance-file lance-index-core lance-index-core 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-core (Cargo) lance-tools->lance-file lance-tools->lance-io 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__ +12 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.

884 modules, with 2978 dependencies between them. 8 loops run through 216 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 844 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_index.scalar.inverted.query5 lance_jni.error6 lance_linalg.distance7 lance_core.cache8 lance_core.datatypes.schema9 lance_core.utils.row_addr_remap10 lance_encoding.data11 lance_file.version12 lance_index13 lance_select.mask14 lance.dataset.mem_wal.index.fts15 lance_core.datatypes.field16 lance_index.vector.storage17 lance_encoding.encoder18 lance_index.vector.quantizer19 lance_index_core.scalar20 lance_encoding.decoder21 lance_index_core.remapping22 lance.index.vector23 lance.index.vector.ivf.v224 lance.index.vector.ivf25 lance_index_core26 lance_jsonb.jsonpath.path27 lance_io.object_store28 lance_table.format.fragment29 lance_file.versions.v1.writer30 lance_io.scheduler31 lance_table.format.manifest32 lance.dataset.write33 lance_file.reader34 lance_table.format.transaction35 lance.dataset.scanner36 lance.dataset.write.merge_insert37 lance.dataset38 pylance.dataset39 lance.bin.lq40 lance.dataset.fragment
1 lance_core.cache.key
2 lance_core.deepsize
3 lance_encoding.buffer
4 lance_index.scalar.inverted.query
5 lance_jni.error
6 lance_linalg.distance
7 lance_core.cache73
8 lance_core.datatypes.schema7
9 lance_core.utils.row_addr_remap16
10 lance_encoding.data111
11 lance_file.version41
12 lance_index1
13 lance_select.mask2
14 lance.dataset.mem_wal.index.fts6111
15 lance_core.datatypes.field1
16 lance_index.vector.storage6311112
17 lance_encoding.encoder332231
18 lance_index.vector.quantizer54111
19 lance_index_core.scalar221211211
20 lance_encoding.decoder642111
21 lance_index_core.remapping1221
22 lance.index.vector111111112
23 lance.index.vector.ivf.v24928111331124241
24 lance.index.vector.ivf221311121322111132
25 lance_index_core111
26 lance_jsonb.jsonpath.path1
27 lance_io.object_store224
28 lance_table.format.fragment2221
29 lance_file.versions.v1.writer3111
30 lance_io.scheduler122
31 lance_table.format.manifest211111121
32 lance.dataset.write232581422
33 lance_file.reader241610511322
34 lance_table.format.transaction11111112
35 lance.dataset.scanner1453214213
36 lance.dataset.write.merge_insert1641212417
37 lance.dataset422436223151
38 pylance.dataset1211111
39 lance.bin.lq1
40 lance.dataset.fragment4128111154112
Uses a module listed above itPart of a loopThe module itself
1 lance_core.cache.key2 lance_core.deepsize3 lance_encoding.buffer4 lance_index.scalar.inverted.query5 lance_jni.error6 lance_linalg.distance7 lance_core.cache8 lance_core.datatypes.schema9 lance_core.utils.row_addr_remap10 lance_encoding.data11 lance_file.version12 lance_index13 lance_select.mask14 lance.dataset.mem_wal.index.fts15 lance_core.datatypes.field16 lance_index.vector.storage17 lance_encoding.encoder18 lance_index.vector.quantizer19 lance_index_core.scalar20 lance_encoding.decoder21 lance_index_core.remapping22 lance.index.vector23 lance.index.vector.ivf.v224 lance.index.vector.ivf25 lance_index_core26 lance_jsonb.jsonpath.path27 lance_io.object_store28 lance_table.format.fragment29 lance_file.versions.v1.writer30 lance_io.scheduler31 lance_table.format.manifest32 lance.dataset.write33 lance_file.reader34 lance_table.format.transaction35 lance.dataset.scanner36 lance.dataset.write.merge_insert37 lance.dataset38 pylance.dataset39 lance.bin.lq40 lance.dataset.fragmentlance_core.cache.key1lance_core.deepsize2lance_encoding.buffer3lance_index.scalar.inverted.query4lance_jni.error5lance_linalg.distance6lance_core.cache7lance_core.datatypes.schema8lance_core.utils.row_addr_remap9lance_encoding.data10lance_file.version11lance_index12lance_select.mask13lance.dataset.mem_wal.index.fts14lance_core.datatypes.field15lance_index.vector.storage16lance_encoding.encoder17lance_index.vector.quantizer18lance_index_core.scalar19lance_encoding.decoder20lance_index_core.remapping21lance.index.vector22lance.index.vector.ivf.v223lance.index.vector.ivf24lance_index_core25lance_jsonb.jsonpath.path26lance_io.object_store27lance_table.format.fragment28lance_file.versions.v1.writer29lance_io.scheduler30lance_table.format.manifest31lance.dataset.write32lance_file.reader33lance_table.format.transaction34lance.dataset.scanner35lance.dataset.write.merge_insert36lance.dataset37pylance.dataset38lance.bin.lq39lance.dataset.fragment4073716111411261111631111233223154111221211211642111122111111111249281113311242412213111213221111321111224222131111222111111212325814222416105113221111111214532142131641212417422436223151121111114128111154112+844 more modules (most-connected shown)

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

At a glance — Architecture · 95% · Exemplary ·

At a glance — Maturity · 79% · Strong ·

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

At a glance — Security · 61% · Adequate · gated by D29, D30 ·

At a glance — Accessibility · 64% · Adequate ·

At a glance — Performance · 82% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection54High / Critical
A03:2025 — Software Supply Chain Failures49High / Critical
A02:2025 — Security Misconfiguration4Medium
A07:2025 — Authentication Failures3High / Critical

Roadmap

First, enforce nullable reference types by declaring default nullability and resolving suppressions to prevent null pointer exceptions. Second, fix structured logging issues and secure the server's transport by enabling TLS and HSTS headers. Third, enforce accessibility standards in the UI test suite and gate them in CI to block regressions. Finally, refactor the ten most complex functions to reduce cyclomatic complexity and improve maintainability.

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).+4.2 ptsMediumNullable reference types
Interpolated log message defeats structured logging+2.7 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.+2.7 ptsMediumWeb-Security Posture
Enforce accessibility in the toolchain your project already uses: assert accessibility in your UI test suite with your toolkit's own matcher (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in CI so a regression blocks the merge.+1.8 ptsMediumA11y enforcement
Bring the 10 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Operation::eq (cyclomatic 240), lance_datafusion_exec::expr::safe_coerce_scalar (cyclomatic 211), OrderableScalarValue::cmp (cyclomatic 188).+1.7 ptsHighCyclomatic Complexity
Swallowed exception (empty catch)+1.6 ptsMediumException handling
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.+1.5 ptsMediumVisual & motion safety
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED.+0.7 ptsLowSecrets (history)

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: 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/dataset/mem_wal/write.rs5.5MixedCyclomatic Complexity: lance::dataset::mem_wal::write::replay_memtable_from_wal (cyclomatic 25)
java/lance-jni/src/blocking_dataset.rs5.5MixedGod Classes: FileTooLong: src/blocking_dataset.rs
rust/lance-linalg/src/distance/cosine.rs5.5MixedGod Classes: FileTooLong: distance/cosine.rs
python/python/lance/indices/__init__.py5.5MixedChange Coupling: Boundary-crossing change coupling: __init__.py ↔ index.rs
rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs5.5MixedGod Classes: FileTooLong: scanner/builder.rs
java/lance-jni/src/blocking_scanner.rs5.5MixedCyclomatic Complexity: lance_jni::blocking_scanner::build_scanner_with_options (cyclomatic 32)
rust/lance-linalg/src/distance/dot.rs5.5MixedCode Duplication: Edited copy of a member (18 corresponding lines)
rust/lance-select/src/mask.rs5.7MixedGod Classes: FileTooLong: src/mask.rs

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

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

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

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

Could not be resolved — 15

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

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 73 of 73 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 73 dimensions across the health lenses
D1D2D3D4D5D6D9D13D14D15D16D17D19D20D26D28D29D30D31D34D35D36D43D44AC2AC3AC5AC6AC7AX10AX3AX4AX6AX8AX9M1M2M3M4P1P10P2P3P4P6P7PF1PF2PF3S1X1X12X13X14X15X16X17X18X19X20X21X22X23X24X25X26X27X28X29X3X30X4X5

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, 3049 of 3076 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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
Watchdog 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
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a17df4-2006-7567-9fdd-a54a1f38d541.

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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a coverage step in CI (`codecov/codecov-action`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.py, .rs, .java), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py, .rs, .java) and this repository declares a Cargo test suite (repository root, 629 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 — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 1 Maven/Gradle manifest(s) were read, stating a version for 16 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — ------ REDACTED:1 -------------------- 1 | >>> FROM ubuntu:22.04 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive -------------------- ERROR: failed to solve: ubuntu:22.04: failed to resolve source metadata for docker.io/library/ubuntu:22.04: failed to do request: Head "https://registry-1.docker.io/v2/library/ubuntu/manifests/22.04": Forbidden; runtime evidence skipped.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'aws_sdk_dynamodb' is imported (rust/lance-table/src/io/commit.rs:1177), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'aws_sdk_dynamodb' is imported (rust/lance-table/src/io/commit.rs:1177), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'aws_sdk_dynamodb' is imported (rust/lance-table/src/io/commit.rs:1177), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'aws_sdk_dynamodb' is imported (rust/lance-table/src/io/commit.rs:1177), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). 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.

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

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • 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.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

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

278 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Operation::eq at 240. A further 37 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. 16 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 11 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 47) · ×47rust/lance/src/index/append.rs:1464
Scanner::vector_search (cyclomatic 36) · ×14rust/lance/src/dataset/scanner.rs:6842
lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cyclomatic 124) · ×11rust/lance-index/src/vector/distributed/index_merger.rs:862
Dataset::scanner (cyclomatic 66) · ×10python/src/dataset.rs:1240
lance_encoding::encodings::physical::axis_delta::x86_64::transform_width (cyclomatic 34) · ×10rust/lance-encoding/src/encodings/physical/axis_delta/x86_64.rs:90

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

What to do

  1. Bring the 10 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Operation::eq (cyclomatic 240), lance_datafusion_exec::expr::safe_coerce_scalar (cyclomatic 211), OrderableScalarValue::cmp (cyclomatic 188). — 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 10 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.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity4.1 / 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.1 / 10 · rule-coverage 100% · ceiling Prevented

570 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) · ×103rust/lance/src/dataset/optimize/binary_copy.rs:135
lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cognitive 298) · ×39rust/lance-index/src/vector/distributed/index_merger.rs:862
Scanner::vector_search (cognitive 90) · ×19rust/lance/src/dataset/scanner.rs:6842
lance_encoding::encodings::logical::primitive::dict::dictionary_encode (cognitive 51) · ×19rust/lance-encoding/src/encodings/logical/primitive/dict.rs:289
lance_table::transaction::row_version::resolve_update_version_metadata (cognitive 43) · ×16rust/lance-table/src/transaction/row_version.rs:91

+ 213 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 338), lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cognitive 298). — 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.1 to about 5.0/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

524 god class(es) detected.

FileTooLong: dataset/scanner.rs · ×196rust/lance/src/dataset/scanner.rs
MethodTooLong: Transaction.build_manifest_prepared · ×123rust/lance-table/src/transaction/manifest_build.rs:620
FunctionTooLong: lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner · ×82rust/lance-index/src/vector/distributed/index_merger.rs:862
ClassTooLong: Scanner · ×70rust/lance/src/dataset/scanner.rs:1139
TooManyMethods: Dataset · ×48java/src/main/java/org/lance/Dataset.java:84

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

What to do

  1. Resolve the 196 FileTooLong finding(s) in God Classes — start with REDACTED (8), fragment.rs (4), write.rs (4). — One of this dimension's main actionable groups (196 warning-level).
  2. Resolve the 123 MethodTooLong finding(s) in God Classes — start with scanner.rs (11), fts.rs (9), conflict_resolver.rs (7). — One of this dimension's main actionable groups (123 warning-level).
  3. Resolve the 82 FunctionTooLong finding(s) in God Classes — start with ivf.rs (6), transaction.rs (4), vector.rs (4). — One of this dimension's main actionable groups (82 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

995 duplicated block group(s) detected. A further 36 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 1031 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) · ×117java/lance-jni/src/namespace.rs:3509
Duplicated block (8 lines × 2) · ×75java/lance-jni/src/blocking_dataset.rs:2537
Duplicated block (7 lines × 2) · ×70java/lance-jni/src/namespace.rs:3487
Duplicated block (10 lines × 2) · ×69java/lance-jni/src/mem_wal.rs:767
Duplicated block (5 lines × 2) · ×61java/lance-jni/src/blocking_dataset.rs:2287

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

What to do

  1. Resolve the 117 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with namespace.rs (37), f32.rs (4), ex_dot.rs (3). — One of this dimension's main actionable groups (117 warning-level).
  2. Resolve the 75 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with fts.rs (6), restore.rs (5), otel.rs (3). — One of this dimension's main actionable groups (75 warning-level).
  3. Resolve the 70 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with dataset.rs (6), namespace.rs (4), optimize.rs (2). — One of this dimension's main actionable groups (70 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling8.5 / 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.5 / 10 · rule-coverage 100% · ceiling Prevented

32 production modules (Maven+Cargo), 0 dependency cycle(s), 0 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 32 (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

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. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 10 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

10 of 1065 classes have LCOM4 above 3.

Low cohesion: ShardWriterConfig (LCOM4 19) · ×10rust/lance/src/dataset/mem_wal/write.rs:72

What to do

  1. Resolve the 10 Low cohesion finding(s) in Cohesion (LCOM4) — start with write.rs, dataset.rs, filtered_read.rs. — One of this dimension's main actionable groups (10 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

11459 test methods: 11249 unit, 177 integration, 0 BDD, 33 e2e. The Rust suite contributes 9367 `#[test]` function(s) across 629 file(s) declaring at least one; its unit/integration split is Cargo's own — 28 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 1556 test function(s) across 104 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.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 862 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.3 / 10Stronggated by 122 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.3 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: rust/lance-table/src/transaction/manifest_build.rs (38×180=6840); python/python/lance/dataset.py (69×79=5451); rust/lance/src/dataset/scanner.rs (80×36=2880) Repeated repair below the complexity floor: rust/lance-io/src/object_store.rs (13 of 21 changes were fixes); rust/lance-linalg/src/distance.rs (11 of 13 changes were fixes); rust/lance-io/src/object_store/providers/aws.rs (9 of 16 changes were fixes)

Hotspot: rust/lance-table/src/transaction/manifest_build.rs · ×91rust/lance-table/src/transaction/manifest_build.rs:620
Repeated repair: rust/lance-io/src/object_store.rs · ×31rust/lance-io/src/object_store.rs:1353

What to do

  1. Resolve the 91 Hotspot finding(s) in Churn × Complexity Hotspots — start with index.rs (4), fts.rs (3), REDACTED (3). — One of this dimension's main actionable groups (91 warning-level).
  2. Resolve the 31 Repeated repair finding(s) in Churn × Complexity Hotspots — start with object_store.rs, distance.rs, aws.rs. — One of this dimension's main actionable groups (31 warning-level).

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

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

76 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is rust/lance/src/index/frag_reuse_reader.rs. Counted over 926 of the 1143 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 · ×4
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 290 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

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

What to do

  1. Resolve the 283 TodoComment finding(s) in Explicit Debt — start with scanner.rs (10), storage.rs (8), json.rs (8). — One of this dimension's main actionable groups (283 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).
  4. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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. 109 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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — 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.2 / 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, LLM-independent.

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

8 of 33 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)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

REDACTED
REDACTED

What to do

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

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

D29 · Static Analysis (SAST)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

54 finding(s): 0 critical, 42 high, 8 medium, 4 low. semgrep hit a parse error in 20 file(s) — `docs/theme/404.html` (lines 1–3, line 13), `docs/theme/base.html` (lines 1–8), `docs/theme/home.html` (lines 1–3, line 147), `docs/theme/main.html`, `java/mvnw` (line 86, line 121, line 131, …), … (+15 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 13 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (13 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.

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

41 finding(s): 2 critical, 13 high, 25 medium, 1 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 11 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8), REDACTED (3). — One of this dimension's main actionable groups (11 issue-level).
  2. 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).
  3. Resolve the 2 High vulnerability 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

30 of 926 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs. Counted over 926 of the 1143 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×30rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs: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.6 / 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.6 / 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 · ×13rust/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 13 Change coupling finding(s) in Change Coupling — start with binary.rs (2), fixed_size_list.rs, encoder.rs. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with bitmap.rs, basic.rs, binary.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. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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 26 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:669

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.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain your project already uses: assert accessibility in your UI test suite with your toolkit's own matcher (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in CI so a regression blocks the merge.
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.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

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

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

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

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

M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add a README to the 11 of 36 project(s) that lack one — worth up to 0.6 pts.
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 repo is organised deliberately — src/test separation and consistent project naming.

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 README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

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 model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability8.7 / 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/18 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `memtest`, `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.

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.

PF2 · Allocation hygiene6.6 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 34 use(s) across 26,783 production line(s) (~1.3/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
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 the language 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:200)), 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:200).
  • 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:200).

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.

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

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

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

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

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

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

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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

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

X15 · Unvalidated length from an untrusted reader2.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 1054 (`u32::from_le_bytes`), then used to size a `Vec::with_capacity` at line 1056 — 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:1056
  • `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.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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

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

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

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

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

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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

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

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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

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

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

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

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

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

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

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

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

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. 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.

X3 · Exception handling7.3 / 10Strong✓ Tool-verified

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. — python/python/ci_benchmarks/datagen/count_rows.py:71

What to do

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

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

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

X4 · Structured logging5.5 / 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
  • `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 1768 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:1768
  • `warn!` at line 4647 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:4647
  • `warn!` at line 408 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:408
  • `info!` at line 2172 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:2172
  • `warn!` at line 593 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.rs:593
  • `warn!` at line 1434 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.rs:1434
  • `warn!` at line 209 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:209
  • `info!` at line 313 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:313
  • `info!` at line 362 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:362
  • `info!` at line 591 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:591
  • `info!` at line 657 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:657

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/19 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
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

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 X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture95%ExemplaryStrongest area.
Maturity79%StrongSolid.
Readiness75%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security61%Adequate — gated by D29, D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility64%AdequateAcceptable, with room to improve.
Performance82%StrongSolid.
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 — 25 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 — 4 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: this repository stores data through 'aws_sdk_dynamodb' (rust/lance-table/src/io/commit.rs:1177) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'aws_sdk_dynamodb' (rust/lance-table/src/io/commit.rs:1177) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'aws_sdk_dynamodb' (rust/lance-table/src/io/commit.rs:1177) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 40 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
  • 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 — docker build failed (exit 1) — ------ REDACTED:1 -------------------- 1 | >>> FROM ubuntu:22.04 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive -------------------- ERROR: failed to solve: ubuntu:22.04: failed to resolve source metadata for docker.io/library/ubuntu:22.04: failed to do request: Head "https://registry-1.docker.io/v2/library/ubuntu/manifests/22.04": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: this repository stores data through 'aws_sdk_dynamodb' (rust/lance-table/src/io/commit.rs:1177) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • D10 Test Quality — ~197741 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
  • D12 Dependency Hygiene — Not scored — 1 Maven/Gradle manifest(s) were read, stating a version for 16 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Java, JavaScript, Python, Rust not measured.
  • 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+ projects each declaring an entity of their own. 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# and Visual Basic comments only — this repository's production source is .java, .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • 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.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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 included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (294 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 — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • 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
  • 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 — 69 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
D30 · Dependency Vulnerabilities · High CVE · ×11
  • REDACTED
  • REDACTED
  • 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>.
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×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.
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 — 2899 finding(s)
D17 · Explicit Debt · TodoComment · ×283
  • 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:783 — // 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:932 — // 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:964 — // 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:1449 — // 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:125 — // 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:202 — // 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:538 — // 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:591 — // 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:307 — // 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:690 — // 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:175 — // 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:233 — // 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:881 — // 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:496 — // 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:357 — // 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:686 — // 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.
  • + 258 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×196
  • FileTooLong: dataset/scanner.rs rust/lance/src/dataset/scanner.rs — FileTooLong — 5411 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 82% of them inside a single declaration: Scanner (2 blocks, 1139-8872). The bar is 500 significant lines; this is 4911 over it, 10.82× 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: exec/fts.rs rust/lance/src/io/exec/fts.rs — FileTooLong — 4406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 3906 over it, 8.81× 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/ivf.rs rust/lance/src/index/vector/ivf.rs — FileTooLong — 4331 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 96 free functions. The bar is 500 significant lines; this is 3831 over it, 8.66× 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 — 4235 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: Dataset (4 blocks, 830-4916). The bar is 500 significant lines; this is 3735 over it, 8.47× 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/wand.rs rust/lance-index/src/scalar/inverted/wand.rs — FileTooLong — 3858 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 3358 over it, 7.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: index/fts.rs rust/lance/src/dataset/mem_wal/index/fts.rs — FileTooLong — 3489 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 2989 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: lance/dataset.py python/python/lance/dataset.py — FileTooLong — 3434 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2934 over it, 6.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/index.rs rust/lance/src/index.rs — FileTooLong — 3399 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 68 free functions. The bar is 500 significant lines; this is 2899 over it, 6.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/blocking_dataset.rs java/lance-jni/src/blocking_dataset.rs — FileTooLong — 3370 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 173 free functions. The bar is 500 significant lines; this is 2870 over it, 6.74× 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/compound.rs rust/lance-index/src/scalar/inverted/compound.rs — FileTooLong — 2934 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 2434 over it, 5.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: 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: dataset/fragment.rs rust/lance/src/dataset/fragment.rs — FileTooLong — 2690 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 2190 over it, 5.38× 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: mem_wal/write.rs rust/lance/src/dataset/mem_wal/write.rs — FileTooLong — 2685 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 2185 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: scalar/btree.rs rust/lance-index/src/scalar/btree.rs — FileTooLong — 2632 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 2132 over it, 5.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: dir/manifest.rs rust/lance-namespace-impls/src/dir/manifest.rs — FileTooLong — 2616 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: ManifestNamespace (4 blocks, 787-3983). The bar is 500 significant lines; this is 2116 over it, 5.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: dataset/optimize.rs rust/lance/src/dataset/optimize.rs — FileTooLong — 2553 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 2053 over it, 5.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: exec/filtered_read.rs rust/lance/src/io/exec/filtered_read.rs — FileTooLong — 2551 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 2051 over it, 5.10× 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 — 2497 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: Dataset (7 blocks, 238-4551). The bar is 500 significant lines; this is 1997 over it, 4.99× 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: ivf/v2.rs rust/lance/src/index/vector/ivf/v2.rs — FileTooLong — 2468 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: IVFIndex (5 blocks, 1134-3540). The bar is 500 significant lines; this is 1968 over it, 4.94× 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: write/merge_insert.rs rust/lance/src/dataset/write/merge_insert.rs — FileTooLong — 2382 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 1882 over it, 4.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: vector/builder.rs rust/lance/src/index/vector/builder.rs — FileTooLong — 2291 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: IvfIndexBuilder (2 blocks, 352-2976). The bar is 500 significant lines; this is 1791 over it, 4.58× 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/builder.rs rust/lance-index/src/scalar/inverted/builder.rs — FileTooLong — 2171 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 1671 over it, 4.34× 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: commit/conflict_resolver.rs rust/lance/src/io/commit/conflict_resolver.rs — FileTooLong — 2146 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: TransactionRebase (2 blocks, 42-3225). The bar is 500 significant lines; this is 1646 over it, 4.29× 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: bq/storage.rs rust/lance-index/src/vector/bq/storage.rs — FileTooLong — 2105 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 1605 over it, 4.21× 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 — 2081 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 1581 over it, 4.16× 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.
  • + 171 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×123
  • MethodTooLong: Transaction.build_manifest_prepared rust/lance-table/src/transaction/manifest_build.rs:620 — MethodTooLong — build_manifest_prepared runs 875 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 775 over it, 8.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Operation.eq rust/lance-table/src/transaction/conflicts.rs:19 — MethodTooLong — eq runs 573 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 473 over it, 5.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MergeInsertJob.update_fragments rust/lance/src/dataset/write/merge_insert.rs:1904 — MethodTooLong — update_fragments runs 416 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 316 over it, 4.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CreateIndexBuilder.execute_uncommitted_impl rust/lance/src/index/create.rs:181 — MethodTooLong — execute_uncommitted_impl runs 381 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 281 over it, 3.81× 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:166 — 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:1240 — MethodTooLong — scanner runs 307 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 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TransactionRebase.check_create_index_txn rust/lance/src/io/commit/conflict_resolver.rs:1071 — MethodTooLong — check_create_index_txn runs 282 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 182 over it, 2.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Transaction.try_from rust/lance-table/src/transaction/proto.rs:87 — MethodTooLong — try_from runs 268 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 168 over it, 2.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Dataset.open_vector_index_from_metadata_with_plan rust/lance/src/index.rs:4263 — MethodTooLong — open_vector_index_from_metadata_with_plan runs 265 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CompoundQueryExec.execute rust/lance/src/io/exec/fts.rs:1585 — MethodTooLong — execute runs 253 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Wand.complete_maxscore_single_essential rust/lance-index/src/scalar/inverted/wand_maxscore.rs:424 — 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: Scanner.vector_search rust/lance/src/dataset/scanner.rs:6842 — MethodTooLong — vector_search runs 233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PrimitiveStructuralEncoder.encode_dense_page rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1957 — MethodTooLong — encode_dense_page runs 230 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 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: IVFIndex.search_partitions rust/lance/src/index/vector/ivf/v2.rs:2882 — MethodTooLong — search_partitions runs 220 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 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CleanupTask.delete_unreferenced_files rust/lance/src/dataset/cleanup.rs:1083 — MethodTooLong — delete_unreferenced_files runs 218 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 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CleanupTask.cleanup_file_if_not_referenced rust/lance/src/dataset/cleanup.rs:1410 — MethodTooLong — cleanup_file_if_not_referenced runs 218 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 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PyLance.into_pyobject python/src/transaction.rs:713 — MethodTooLong — into_pyobject 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.
  • MethodTooLong: MergeInsertJob.execute_uncommitted_impl rust/lance/src/dataset/write/merge_insert.rs:3154 — MethodTooLong — execute_uncommitted_impl 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.
  • MethodTooLong: IvfIndexBuilder.merge_partitions rust/lance/src/index/vector/builder.rs:1762 — MethodTooLong — merge_partitions runs 213 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 113 over it, 2.13× 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:2632 — 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.
  • MethodTooLong: Transaction.try_from rust/lance-table/src/transaction/proto.rs:497 — MethodTooLong — try_from 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.
  • MethodTooLong: Planner.parse_sql_expr rust/lance-datafusion/src/planner.rs:700 — MethodTooLong — parse_sql_expr runs 198 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 98 over it, 1.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.
  • MethodTooLong: IvfIndexBuilder.build_partitions rust/lance/src/index/vector/builder.rs:1159 — MethodTooLong — build_partitions runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DefaultCompactionPlanner.plan rust/lance/src/dataset/optimize.rs:907 — MethodTooLong — plan runs 192 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 92 over it, 1.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: LanceStream.try_new_v2 rust/lance/src/io/exec/scan.rs:181 — MethodTooLong — try_new_v2 runs 191 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 91 over it, 1.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 98 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×117
  • 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.
  • Duplicated block (6 lines × 2) java/lance-jni/src/utils.rs:230 — java/lance-jni/src/utils.rs:230-236 | java/lance-jni/src/utils.rs:244-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.
  • Duplicated block (6 lines × 2) java/lance-jni/src/utils.rs:241 — java/lance-jni/src/utils.rs:241-246 | java/lance-jni/src/utils.rs:254-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:356 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:356-361 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:394-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.
  • 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.
  • Duplicated block (6 lines × 2) rust/lance-encoding/src/decoder.rs:1737 — rust/lance-encoding/src/decoder.rs:1737-1742 | rust/lance-encoding/src/decoder.rs:2183-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.
  • Duplicated block (6 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:815 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:815-820 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:825-830 — both copies are in the same file, so extract the block into 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/logical/primitive/structural_encoder.rs:1817 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1817-1822 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1829-1834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:503 — rust/lance-encoding/src/encodings/physical/alp.rs:503-508 | rust/lance-encoding/src/encodings/physical/alp.rs:572-577 — both copies are in the same file, so extract the block into 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/alp/restore.rs:123 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:123-128 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:242-247 — both copies are in the same file, so extract the block into 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/alp/restore.rs:142 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:142-147 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:269-274 — both copies are in the same file, so extract the block into 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/block.rs:695 — rust/lance-encoding/src/encodings/physical/block.rs:695-700 | rust/lance-encoding/src/encodings/physical/block.rs:714-719 — both copies are in the same file, so extract the block into 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/statistics.rs:291 — rust/lance-encoding/src/statistics.rs:291-296 | rust/lance-encoding/src/statistics.rs:301-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/lance-file/src/concat.rs:487 — rust/lance-file/src/concat.rs:487-493 | rust/lance/src/dataset/blob/external.rs:244-249 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) rust/lance-file/src/reader.rs:1497 — rust/lance-file/src/reader.rs:1497-1502 | rust/lance-file/src/reader.rs:1923-1928 — both copies are in the same file, so extract the block into 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/version.rs:208 — rust/lance-file/src/version.rs:208-213 | rust/lance-file/src/version.rs:234-239 — both copies are in the same file, so extract the block into 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/versions/v2_0/writer.rs:656 — rust/lance-file/src/versions/v2_0/writer.rs:656-661 | 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:875 — rust/lance-file/src/versions/v2_0/writer.rs:875-881 | rust/lance-file/src/writer/structural.rs:858-863 — 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust/lance-index/src/scalar/fmindex.rs:385 — rust/lance-index/src/scalar/fmindex.rs:385-390 | rust/lance-index/src/scalar/fmindex.rs:891-896 — both copies are in the same file, so extract the block into 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/cross_column.rs:222 — rust/lance-index/src/scalar/inverted/cross_column.rs:222-227 | rust/lance-index/src/scalar/inverted/wand.rs:2164-2169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:367 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:367-372 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:437-442 — both copies are in the same file, so extract the block into 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/index/partition.rs:332 — rust/lance-index/src/scalar/inverted/index/partition.rs:332-337 | rust/lance-index/src/scalar/inverted/index/partition.rs:443-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:4208 — rust/lance-index/src/scalar/inverted/wand.rs:4208-4213 | rust/lance-index/src/scalar/inverted/wand.rs:4243-4248 — both copies are in the same file, so extract the block into 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/json.rs:640 — rust/lance-index/src/scalar/json.rs:640-645 | rust/lance-index/src/scalar/json.rs:780-785 — both copies are in the same file, so extract the block into 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:494 — rust/lance-index/src/scalar/label_list.rs:494-499 | rust/lance-index/src/scalar/label_list.rs:501-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 92 more in this group — see findings.md.
D2 · Cognitive Complexity · lance · ×103
  • 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 101) rust/lance/src/index/append.rs:1464 — lance::index::append::merge_indices_with_unindexed_frags has cognitive complexity 101 (threshold 15). Drivers by points: if/else 31 (68 pts), boolean chains 13, loops 5 (11 pts), match/switch 3 (9 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::frag_reuse::build_frag_reuse_rewrite_entry (cognitive 79) rust/lance/src/index/frag_reuse.rs:1524 — 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::dataset::mem_wal::write::replay_memtable_from_wal (cognitive 73) rust/lance/src/dataset/mem_wal/write.rs:1475 — lance::dataset::mem_wal::write::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_compaction (cognitive 69) rust/lance/src/dataset/optimize.rs:3672 — lance::dataset::optimize::commit_compaction has cognitive complexity 69 (threshold 15). Drivers by points: if/else 33 (47 pts), boolean chains 11, loops 3 (6 pts), match/switch 2 (5 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.
  • lance::dataset::write::do_write_fragments_impl (cognitive 56) rust/lance/src/dataset/write.rs:930 — lance::dataset::write::do_write_fragments_impl has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (46 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::io::commit::do_commit_new_dataset (cognitive 55) rust/lance/src/io/commit.rs:427 — 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::dataset::index::frag_reuse::compute_tagged_retention (cognitive 51) rust/lance/src/dataset/index/frag_reuse.rs:680 — 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::io::commit::commit_transaction (cognitive 51) rust/lance/src/io/commit.rs:1711 — lance::io::commit::commit_transaction has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 5 (13 pts), loops 2 (4 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::append::merge_scalar_indices (cognitive 50) rust/lance/src/index/append.rs:734 — lance::index::append::merge_scalar_indices has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 9, loops 2 (5 pts), match/switch 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::optimize::rewrite_files (cognitive 45) rust/lance/src/dataset/optimize.rs:2838 — lance::dataset::optimize::rewrite_files has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 8, match/switch 4 (6 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::index::vector::ivf::train_weighted_hierarchical_kmeans (cognitive 44) rust/lance/src/index/vector/ivf.rs:5182 — 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::dataset::take::do_take_rows (cognitive 43) rust/lance/src/dataset/take.rs:134 — lance::dataset::take::do_take_rows has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::io::exec::count_pushdown::try_rewrite (cognitive 43) rust/lance/src/io/exec/count_pushdown.rs:107 — lance::io::exec::count_pushdown::try_rewrite has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (35 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::optimize::consolidate::validate_commit (cognitive 42) rust/lance/src/index/optimize/consolidate.rs:177 — lance::index::optimize::consolidate::validate_commit has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 3 (6 pts), boolean chains 4 (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::scalar::index_matches_criteria (cognitive 42) rust/lance/src/index/scalar.rs:962 — 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::optimize::remapping::remap_index (cognitive 39) rust/lance/src/dataset/optimize/remapping.rs:232 — lance::dataset::optimize::remapping::remap_index has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (11 pts), match/switch 3, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::schema_evolution::alter_columns (cognitive 39) rust/lance/src/dataset/schema_evolution.rs:853 — lance::dataset::schema_evolution::alter_columns has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 7, 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::index::fresh_fragments (cognitive 39) rust/lance/src/index.rs:686 — lance::index::fresh_fragments has cognitive complexity 39 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 5 (14 pts), loops 6 (11 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::dataset::versions::check_manifest_storage_contract (cognitive 38) rust/lance/src/dataset/versions/mod.rs:393 — 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.
  • lance::index::frag_reuse::validate_folded_deletions (cognitive 37) rust/lance/src/index/frag_reuse.rs:1015 — lance::index::frag_reuse::validate_folded_deletions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (11 pts), match/switch 5 (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.
  • lance::blob::validate_prepared_blob_value_array (cognitive 36) rust/lance/src/blob.rs:478 — lance::blob::validate_prepared_blob_value_array has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::blob::external::collect_external_blob_uris (cognitive 36) rust/lance/src/dataset/blob/external.rs:110 — lance::dataset::blob::external::collect_external_blob_uris has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 4 (8 pts), boolean chains 6, match/switch 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.
  • lance::dataset::write::validate_and_resolve_target_bases_with_primary (cognitive 35) rust/lance/src/dataset/write.rs:1416 — lance::dataset::write::validate_and_resolve_target_bases_with_primary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance::dataset::mem_wal::index::fts::score_terms (cognitive 34) rust/lance/src/dataset/mem_wal/index/fts.rs:3337 — lance::dataset::mem_wal::index::fts::score_terms has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 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.
  • + 78 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×91
  • Hotspot: rust/lance-table/src/transaction/manifest_build.rs rust/lance-table/src/transaction/manifest_build.rs:620 — rust/lance-table/src/transaction/manifest_build.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 180 in Transaction::build_manifest_prepared at line 620. 18 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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:4044 — python/python/lance/dataset.py changed 69 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in LanceDataset._create_index_impl at line 4044. 25 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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: rust/lance/src/dataset/scanner.rs rust/lance/src/dataset/scanner.rs:6842 — rust/lance/src/dataset/scanner.rs changed 80 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in Scanner::vector_search at line 6842. 35 of those changes were fix/bug commits, and the other 45 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/optimize.rs rust/lance/src/dataset/optimize.rs:3672 — rust/lance/src/dataset/optimize.rs changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in lance::dataset::optimize::commit_compaction at line 3672. 29 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/dataset/optimize.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:4122 — 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 139 in Wand::and_bulk_search at line 4122. 3 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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.
  • Hotspot: python/src/dataset.rs python/src/dataset.rs:1240 — python/src/dataset.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in Dataset::scanner at line 1240. 5 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/io/commit/conflict_resolver.rs rust/lance/src/io/commit/conflict_resolver.rs:1071 — rust/lance/src/io/commit/conflict_resolver.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in TransactionRebase::check_create_index_txn at line 1071. 15 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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.
  • Hotspot: rust/lance/src/dataset/write/merge_insert.rs rust/lance/src/dataset/write/merge_insert.rs:1904 — rust/lance/src/dataset/write/merge_insert.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in MergeInsertJob::update_fragments at line 1904. 22 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/dataset/write/merge_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.
  • Hotspot: rust/lance/src/dataset/cleanup.rs rust/lance/src/dataset/cleanup.rs:1410 — rust/lance/src/dataset/cleanup.rs changed 33 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 1410. 16 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/index/vector/ivf/v2.rs rust/lance/src/index/vector/ivf/v2.rs:2882 — rust/lance/src/index/vector/ivf/v2.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in IVFIndex::search_partitions at line 2882. 9 of those changes were fix/bug commits, and the other 33 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/index/vector/ivf/v2.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.rs rust/lance/src/index.rs:2816 — rust/lance/src/index.rs changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Dataset::merge_existing_index_segments at line 2816. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/index.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:2382 — rust/lance/src/dataset.rs changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Dataset::create_data_file at line 2382. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/append.rs rust/lance/src/index/append.rs:1464 — rust/lance/src/index/append.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in lance::index::append::merge_indices_with_unindexed_frags at line 1464. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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:427 — rust/lance/src/io/commit.rs changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in lance::io::commit::do_commit_new_dataset at line 427. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/fragment.rs rust/lance/src/dataset/fragment.rs:1955 — 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 1955. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/create.rs rust/lance/src/index/create.rs:181 — rust/lance/src/index/create.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in CreateIndexBuilder::execute_uncommitted_impl at line 181. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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:295 — rust/lance-index/src/scalar/zonemap.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in ZoneMapIndex::evaluate_zone_against_query at line 295. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-index/src/vector/distributed/index_merger.rs rust/lance-index/src/vector/distributed/index_merger.rs:862 — rust/lance-index/src/vector/distributed/index_merger.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner at line 862. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/vector/ivf.rs rust/lance/src/index/vector/ivf.rs:5182 — rust/lance/src/index/vector/ivf.rs changed 34 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 5182. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/fts.rs rust/lance/src/io/exec/fts.rs:1585 — rust/lance/src/io/exec/fts.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in CompoundQueryExec::execute at line 1585. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/io/exec/fts.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 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 240 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/dataset/write.rs rust/lance/src/dataset/write.rs:930 — rust/lance/src/dataset/write.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in lance::dataset::write::do_write_fragments_impl at line 930. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/src/dataset/versions/mod.rs rust/lance/src/dataset/versions/mod.rs:393 — rust/lance/src/dataset/versions/mod.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in lance::dataset::versions::check_manifest_storage_contract at line 393. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/dataset/versions/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust/lance/src/dataset/mem_wal/write.rs rust/lance/src/dataset/mem_wal/write.rs:1475 — rust/lance/src/dataset/mem_wal/write.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in lance::dataset::mem_wal::write::replay_memtable_from_wal at line 1475. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/dataset/mem_wal/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.
  • + 66 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×82
  • FunctionTooLong: lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner rust/lance-index/src/vector/distributed/index_merger.rs:862 — FunctionTooLong — lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner runs 620 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 520 over it, 6.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::index::append::merge_indices_with_unindexed_frags rust/lance/src/index/append.rs:1464 — FunctionTooLong — lance::index::append::merge_indices_with_unindexed_frags runs 465 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 365 over it, 4.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance_jni::transaction::convert_to_rust_operation java/lance-jni/src/transaction.rs:1740 — FunctionTooLong — lance_jni::transaction::convert_to_rust_operation runs 373 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 273 over it, 3.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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_jni::transaction::convert_to_java_operation_inner java/lance-jni/src/transaction.rs:880 — FunctionTooLong — lance_jni::transaction::convert_to_java_operation_inner runs 289 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 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::dataset::optimize::commit_compaction rust/lance/src/dataset/optimize.rs:3672 — FunctionTooLong — lance::dataset::optimize::commit_compaction runs 279 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 179 over it, 2.79× 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:821 — FunctionTooLong — lance::index::vector::build_distributed_vector_index runs 275 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::dataset::optimize::rewrite_files rust/lance/src/dataset/optimize.rs:2838 — FunctionTooLong — lance::dataset::optimize::rewrite_files runs 265 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::index::vector::build_vector_index_impl rust/lance/src/index/vector.rs:1259 — FunctionTooLong — lance::index::vector::build_vector_index_impl 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.
  • FunctionTooLong: lance::io::commit::commit_transaction rust/lance/src/io/commit.rs:1711 — FunctionTooLong — lance::io::commit::commit_transaction runs 249 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 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance_index::scalar::inverted::cross_column::cross_column_compound_search rust/lance-index/src/scalar/inverted/cross_column.rs:1353 — 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:427 — FunctionTooLong — lance::io::commit::do_commit_new_dataset 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.
  • FunctionTooLong: lance::index::append::merge_scalar_indices rust/lance/src/index/append.rs:734 — FunctionTooLong — lance::index::append::merge_scalar_indices runs 240 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 140 over it, 2.40× 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:853 — FunctionTooLong — lance::dataset::schema_evolution::alter_columns runs 219 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 119 over it, 2.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::index::vector::ivf::optimize_vector_indices_v2 rust/lance/src/index/vector/ivf.rs:841 — FunctionTooLong — lance::index::vector::ivf::optimize_vector_indices_v2 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::frag_reuse::build_frag_reuse_rewrite_entry rust/lance/src/index/frag_reuse.rs:1524 — 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::index::vector::build_vector_index_incremental rust/lance/src/index/vector.rs:1571 — FunctionTooLong — lance::index::vector::build_vector_index_incremental 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_jni::blocking_scanner::build_scanner_with_options java/lance-jni/src/blocking_scanner.rs:352 — FunctionTooLong — lance_jni::blocking_scanner::build_scanner_with_options runs 196 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 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance_index::scalar::inverted::index::flat_search::tokenize_and_count rust/lance-index/src/scalar/inverted/index/flat_search.rs:240 — FunctionTooLong — lance_index::scalar::inverted::index::flat_search::tokenize_and_count runs 194 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 94 over it, 1.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::dataset::take::do_take_rows rust/lance/src/dataset/take.rs:134 — FunctionTooLong — lance::dataset::take::do_take_rows runs 177 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 77 over it, 1.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.
  • FunctionTooLong: lance::index::vector::ivf::io::write_hnsw_quantization_index_partitions rust/lance/src/index/vector/ivf/io.rs:308 — FunctionTooLong — lance::index::vector::ivf::io::write_hnsw_quantization_index_partitions runs 168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: lance::index::vector::ivf::train_streaming_coreset_ivf_model_with_algorithm rust/lance/src/index/vector/ivf.rs:5483 — FunctionTooLong — lance::index::vector::ivf::train_streaming_coreset_ivf_model_with_algorithm runs 167 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 67 over it, 1.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_table::system_index::frag_reuse::gate::classify rust/lance-table/src/system_index/frag_reuse/gate.rs:54 — FunctionTooLong — lance_table::system_index::frag_reuse::gate::classify runs 162 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 62 over it, 1.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.
  • FunctionTooLong: lance_encoding::compression::create_fixed_width_block_decompressor_inner rust/lance-encoding/src/compression.rs:1645 — FunctionTooLong — lance_encoding::compression::create_fixed_width_block_decompressor_inner runs 161 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 61 over it, 1.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.
  • + 57 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×75
  • Duplicated block (8 lines × 2) java/lance-jni/src/blocking_dataset.rs:2537 — java/lance-jni/src/blocking_dataset.rs:2537-2544 | java/lance-jni/src/blocking_dataset.rs:2589-2596 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/file_reader.rs:114 — java/lance-jni/src/file_reader.rs:114-121 | java/lance-jni/src/file_writer.rs:97-104 — 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/mem_wal.rs:172 — java/lance-jni/src/mem_wal.rs:172-179 | java/lance-jni/src/mem_wal.rs:195-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) java/lance-jni/src/otel.rs:386 — java/lance-jni/src/otel.rs:386-393 | python/src/otel.rs:339-346 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (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.
  • Duplicated block (8 lines × 2) python/src/fragment.rs:219 — python/src/fragment.rs:219-226 | python/src/fragment.rs:247-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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.
  • Duplicated block (8 lines × 2) rust/compression/fsst/src/fsst.rs:1230 — rust/compression/fsst/src/fsst.rs:1230-1237 | rust/compression/fsst/src/fsst.rs:1369-1376 — both copies are in the same file, so extract the block into 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-core/src/datatypes/schema.rs:247 — rust/lance-core/src/datatypes/schema.rs:247-254 | rust/lance-core/src/datatypes/schema.rs:650-657 — both copies are in the same file, so extract the block into 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/logical/fixed_size_list.rs:416 — rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:416-423 | rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:471-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.
  • Duplicated block (8 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:407 — rust/lance-encoding/src/encodings/logical/primitive/blob.rs:407-414 | rust/lance-encoding/src/encodings/logical/primitive/blob.rs:421-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:885 — rust/lance-encoding/src/encodings/physical/alp.rs:885-892 | rust/lance-encoding/src/encodings/physical/alp.rs:979-986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:906 — rust/lance-encoding/src/encodings/physical/alp.rs:906-913 | rust/lance-encoding/src/encodings/physical/alp.rs:1000-1007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:683 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:683-690 | rust/lance-encoding/src/encodings/physical/alp/restore.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.
  • Duplicated block (8 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:731 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:731-738 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:746-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.
  • Duplicated block (8 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:779 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:779-786 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:794-801 — both copies are in the same file, so extract the block into 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:827 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:827-834 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:842-849 — both copies are in the same file, so extract the block into 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:876 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:876-883 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:891-898 — both copies are in the same file, so extract the block into 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/packed.rs:677 — rust/lance-encoding/src/encodings/physical/packed.rs:677-684 | rust/lance-encoding/src/encodings/physical/packed.rs:687-694 — both copies are in the same file, so extract the block into 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/statistics.rs:195 — rust/lance-encoding/src/statistics.rs:195-202 | rust/lance-encoding/src/statistics.rs:332-341 — both copies are in the same file, so extract the block into 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-file/src/versions/v1/encoding/plain.rs:336 — rust/lance-file/src/versions/v1/encoding/plain.rs:336-343 | rust/lance-file/src/versions/v1/encoding/plain.rs:401-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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:577-584 — 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:156 — rust/lance-index/src/scalar/bloomfilter.rs:156-163 | rust/lance-index/src/scalar/zonemap.rs:624-631 — 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 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:649 — rust/lance-index/src/scalar/bloomfilter.rs:649-656 | rust/lance-index/src/scalar/bloomfilter.rs:663-670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 50 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×70
  • ClassTooLong: Scanner rust/lance/src/dataset/scanner.rs:1139 — ClassTooLong — 4447 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 170 methods, 2 blocks, lines 1139-8872. The bar is 400 significant lines; this is 4047 over it, 11.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Dataset python/src/dataset.rs:830 — ClassTooLong — 2583 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 127 methods, 4 blocks, lines 830-4916. The bar is 400 significant lines; this is 2183 over it, 6.46× 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:787 — ClassTooLong — 2095 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 67 methods, 4 blocks, lines 787-3983. The bar is 400 significant lines; this is 1695 over it, 5.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: Dataset rust/lance/src/dataset.rs:238 — ClassTooLong — 1970 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 164 methods, 7 blocks, lines 238-4551. The bar is 400 significant lines; this is 1570 over it, 4.93× 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: TransactionRebase rust/lance/src/io/commit/conflict_resolver.rs:42 — ClassTooLong — 1900 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 42-3225. The bar is 400 significant lines; this is 1500 over it, 4.75× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: IvfIndexBuilder rust/lance/src/index/vector/builder.rs:352 — ClassTooLong — 1806 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 45 methods, 2 blocks, lines 352-2976. The bar is 400 significant lines; this is 1406 over it, 4.52× 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:1134 — ClassTooLong — 1656 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 1134-3540. The bar is 400 significant lines; this is 1256 over it, 4.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PrimitiveStructuralEncoder rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:207 — ClassTooLong — 1529 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods, 3 blocks, lines 207-2679. The bar is 400 significant lines; this is 1129 over it, 3.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: FileFragment rust/lance/src/dataset/fragment.rs:143 — ClassTooLong — 1373 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 58 methods, 2 blocks, lines 143-3310. The bar is 400 significant lines; this is 973 over it, 3.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MergeInsertJob rust/lance/src/dataset/write/merge_insert.rs:774 — ClassTooLong — 1345 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 774-3664. The bar is 400 significant lines; this is 945 over it, 3.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FtsMemIndex rust/lance/src/dataset/mem_wal/index/fts.rs:1330 — ClassTooLong — 1135 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 1330-5301. The bar is 400 significant lines; this is 735 over it, 2.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: IvfQuantizationStorage rust/lance-index/src/vector/storage.rs:1221 — ClassTooLong — 1122 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 3 blocks, lines 1221-2931. The bar is 400 significant lines; this is 722 over it, 2.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: CleanupTask rust/lance/src/dataset/cleanup.rs:342 — ClassTooLong — 1114 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 2 blocks, lines 342-2130. The bar is 400 significant lines; this is 714 over it, 2.79× 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:614 — ClassTooLong — 963 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 614-1872. The bar is 400 significant lines; this is 563 over it, 2.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FileReader rust/lance-file/src/reader.rs:460 — ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 3 blocks, lines 460-2218. The bar is 400 significant lines; this is 453 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FullSchemaMergeInsertExec rust/lance/src/dataset/write/merge_insert/exec/write.rs:274 — 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), 18 methods, 4 blocks, lines 274-1464. 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: BTreeIndex rust/lance-index/src/scalar/btree.rs:1760 — ClassTooLong — 792 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 6 blocks, lines 1760-3123. The bar is 400 significant lines; this is 392 over it, 1.98× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FilteredReadStream rust/lance/src/io/exec/filtered_read.rs:446 — ClassTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 3 blocks, lines 446-1752. The bar is 400 significant lines; this is 389 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ObjectStore rust/lance-io/src/object_store.rs:203 — ClassTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 53 methods, 6 blocks, lines 203-2066. The bar is 400 significant lines; this is 384 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: InvertedIndex rust/lance-index/src/scalar/inverted/index/inverted_index.rs:23 — ClassTooLong — 762 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 9 blocks, lines 23-1144. The bar is 400 significant lines; this is 362 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: FilteredReadExec rust/lance/src/io/exec/filtered_read.rs:2289 — ClassTooLong — 758 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 4 blocks, lines 2289-3973. The bar is 400 significant lines; this is 358 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: 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: RabitDistCalculator rust/lance-index/src/vector/bq/storage.rs:933 — ClassTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 3 blocks, lines 933-2112. The bar is 400 significant lines; this is 319 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.
  • ClassTooLong: MinHashLshIndex rust/lance-index/src/scalar/minhash_lsh/index.rs:105 — ClassTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 7 blocks, lines 105-1314. The bar is 400 significant lines; this is 282 over it, 1.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 45 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×70
  • Duplicated block (7 lines × 2) java/lance-jni/src/namespace.rs:3487 — java/lance-jni/src/namespace.rs:3487-3493 | java/lance-jni/src/namespace.rs:3616-3622 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/namespace.rs:3524 — java/lance-jni/src/namespace.rs:3524-3530 | java/lance-jni/src/namespace.rs:3653-3659 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/namespace.rs:3570 — java/lance-jni/src/namespace.rs:3570-3576 | java/lance-jni/src/namespace.rs:3699-3705 — both copies are in the same file, so extract the block into 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:1678 — python/src/dataset.rs:1678-1684 | python/src/dataset.rs:1706-1712 — both copies are in the same file, so extract the block into 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:3495 — python/src/dataset.rs:3495-3501 | python/src/dataset.rs:3531-3537 — both copies are in the same file, so extract the block into 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:3714 — python/src/dataset.rs:3714-3720 | python/src/dataset.rs:3742-3748 — both copies are in the same file, so extract the block into 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/optimize.rs:519 — python/src/dataset/optimize.rs:519-525 | python/src/dataset/optimize.rs:553-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.
  • Duplicated block (7 lines × 2) python/src/mem_wal.rs:520 — python/src/mem_wal.rs:520-526 | python/src/mem_wal.rs:541-547 — both copies are in the same file, so extract the block into 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:672 — python/src/mem_wal.rs:672-678 | python/src/mem_wal.rs:703-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.
  • Duplicated block (7 lines × 2) rust/lance-encoding/src/array_encoding/logical/list.rs:1329 — rust/lance-encoding/src/array_encoding/logical/list.rs:1329-1335 | rust/lance-encoding/src/array_encoding/logical/list.rs:1338-1344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/lance-encoding/src/decoder.rs:1344 — rust/lance-encoding/src/decoder.rs:1344-1350 | rust/lance-encoding/src/decoder.rs:1410-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.
  • 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.
  • Duplicated block (7 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:893 — rust/lance-file/src/versions/v2_0/writer.rs:893-899 | rust/lance-file/src/writer/structural.rs:873-880 — 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) rust/lance-file/src/versions/v2_1/reader.rs:27 — rust/lance-file/src/versions/v2_1/reader.rs:27-33 | rust/lance-file/src/versions/v2_2/reader.rs:27-33 — `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 8 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.
  • Duplicated block (7 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:640 — rust/lance-index/src/scalar/bloomfilter.rs:640-646 | rust/lance-index/src/scalar/zonemap.rs:1103-1109 — 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 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) rust/lance-index/src/scalar/btree.rs:1172 — rust/lance-index/src/scalar/btree.rs:1172-1178 | rust/lance-index/src/scalar/btree.rs:1192-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.
  • Duplicated block (7 lines × 2) rust/lance-index/src/scalar/fmindex.rs:816 — rust/lance-index/src/scalar/fmindex.rs:816-822 | rust/lance-index/src/scalar/fmindex.rs:836-842 — both copies are in the same file, so extract the block into 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/inverted.rs:287 — rust/lance-index/src/scalar/inverted.rs:287-293 | rust/lance-index/src/scalar/inverted.rs:373-379 — both copies are in the same file, so extract the block into 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/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.
  • Duplicated block (7 lines × 2) rust/lance-index/src/scalar/ngram.rs:1720 — rust/lance-index/src/scalar/ngram.rs:1720-1728 | rust/lance-index/src/scalar/ngram.rs:1837-1843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/lance-index/src/scalar/ngram/ngram_regex.rs:396 — rust/lance-index/src/scalar/ngram/ngram_regex.rs:396-404 | rust/lance-index/src/scalar/ngram/ngram_regex.rs:406-412 — both copies are in the same file, so extract the block into 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/rtree.rs:338 — rust/lance-index/src/scalar/rtree.rs:338-344 | rust/lance-index/src/scalar/rtree.rs:362-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.
  • Duplicated block (7 lines × 2) rust/lance-index/src/scalar/rtree/sort/hilbert_sort.rs:218 — rust/lance-index/src/scalar/rtree/sort/hilbert_sort.rs:218-224 | rust/lance-index/src/scalar/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/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.
  • Duplicated block (7 lines × 2) rust/lance-index/src/vector/bq/pairwise.rs:923 — rust/lance-index/src/vector/bq/pairwise.rs:923-929 | rust/lance-index/src/vector/bq/pairwise.rs:933-939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 45 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×69
  • Duplicated block (10 lines × 2) java/lance-jni/src/mem_wal.rs:767 — java/lance-jni/src/mem_wal.rs:767-776 | java/lance-jni/src/mem_wal.rs:890-899 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) java/lance-jni/src/otel.rs:307 — java/lance-jni/src/otel.rs:307-316 | java/lance-jni/src/utils.rs:617-626 — 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 (10 lines × 2) python/src/dataset.rs:5633 — python/src/dataset.rs:5633-5642 | python/src/dataset.rs:5655-5664 — both copies are in the same file, so extract the block into 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/fts.rs:112 — python/src/fts.rs:112-121 | python/src/fts.rs:139-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) python/src/mem_wal.rs:261 — python/src/mem_wal.rs:261-270 | python/src/mem_wal.rs:286-295 — both copies are in the same file, so extract the block into 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/mem_wal.rs:748 — python/src/mem_wal.rs:748-757 | python/src/mem_wal.rs:821-830 — both copies are in the same file, so extract the block into 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/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:410 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:410-419 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:471-480 — 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.
  • Duplicated block (10 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:494 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:494-503 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:555-564 — 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.
  • Duplicated block (10 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:590 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:590-599 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:651-660 — 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.
  • Duplicated block (10 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:608 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:608-617 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:669-678 — 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.
  • 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.
  • Duplicated block (10 lines × 2) rust/lance-core/src/levenshtein.rs:37 — rust/lance-core/src/levenshtein.rs:37-46 | rust/lance/src/dataset/mem_wal/index/fts.rs:687-696 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) rust/lance-datafusion/src/planner.rs:845 — rust/lance-datafusion/src/planner.rs:845-854 | rust/lance-datafusion/src/planner.rs:858-867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) rust/lance-encoding/src/array_encoding/strategy.rs:340 — rust/lance-encoding/src/array_encoding/strategy.rs:340-349 | rust/lance-encoding/src/array_encoding/strategy.rs:352-361 — both copies are in the same file, so extract the block into 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/decoder.rs:1652 — rust/lance-encoding/src/decoder.rs:1652-1661 | rust/lance-encoding/src/decoder.rs:2103-2112 — both copies are in the same file, so extract the block into 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:1200 — rust/lance-encoding/src/encodings/physical/alp.rs:1200-1209 | rust/lance-encoding/src/encodings/physical/alp.rs:1215-1224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:312 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:312-321 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:337-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust/lance-file/src/versions/v1/writer/statistics.rs:67 — rust/lance-file/src/versions/v1/writer/statistics.rs:67-76 | rust/lance-file/src/versions/v1/writer/statistics.rs:119-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.
  • Duplicated block (10 lines × 2) rust/lance-file/src/writer/structural.rs:631 — rust/lance-file/src/writer/structural.rs:631-640 | rust/lance-file/src/writer/structural.rs:690-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust/lance-index/src/scalar/expression.rs:1580 — rust/lance-index/src/scalar/expression.rs:1580-1589 | rust/lance-index/src/scalar/expression.rs:1602-1611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust/lance-index/src/scalar/fmindex.rs:572 — rust/lance-index/src/scalar/fmindex.rs:572-581 | rust/lance-index/src/scalar/fmindex.rs:601-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust/lance-index/src/scalar/inverted.rs:628 — rust/lance-index/src/scalar/inverted.rs:628-637 | rust/lance-index/src/scalar/inverted.rs:653-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 (10 lines × 2) rust/lance-index/src/scalar/inverted/cross_column.rs:1626 — rust/lance-index/src/scalar/inverted/cross_column.rs:1626-1635 | rust/lance-index/src/scalar/inverted/cross_column.rs:1642-1651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 44 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×61
  • Duplicated block (5 lines × 2) java/lance-jni/src/blocking_dataset.rs:2287 — java/lance-jni/src/blocking_dataset.rs:2287-2291 | java/lance-jni/src/blocking_dataset.rs:3274-3279 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/blocking_dataset.rs:3024 — java/lance-jni/src/blocking_dataset.rs:3024-3028 | java/lance-jni/src/blocking_dataset.rs:3198-3202 — both copies are in the same file, so extract the block into 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) python/src/dataset.rs:487 — python/src/dataset.rs:487-492 | python/src/dataset.rs:538-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) python/src/debug.rs:18 — python/src/debug.rs:18-22 | python/src/debug.rs:28-32 — both copies are in the same file, so extract the block into 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) python/src/namespace.rs:315 — python/src/namespace.rs:315-319 | python/src/namespace.rs:1062-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.
  • Duplicated block (5 lines × 2) python/src/namespace.rs:451 — python/src/namespace.rs:451-455 | python/src/namespace.rs:1198-1202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:351 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:351-355 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:389-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/lance-datafusion-exec/src/expr.rs:416 — rust/lance-datafusion-exec/src/expr.rs:416-420 | rust/lance-datafusion-exec/src/expr.rs:429-433 — both copies are in the same file, so extract the block into 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-datafusion-exec/src/expr.rs:500 — rust/lance-datafusion-exec/src/expr.rs:500-504 | rust/lance-datafusion-exec/src/expr.rs:513-517 — both copies are in the same file, so extract the block into 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-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.
  • Duplicated block (5 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1777 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1777-1781 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1787-1791 — both copies are in the same file, so extract the block into 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-encoding/src/encodings/physical/alp/restore.rs:322 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:322-327 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:347-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/lance-index/src/scalar/fmindex.rs:1097 — rust/lance-index/src/scalar/fmindex.rs:1097-1101 | rust/lance-index/src/scalar/fmindex.rs:2137-2141 — both copies are in the same file, so extract the block into 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/inverted/wand.rs:4333 — rust/lance-index/src/scalar/inverted/wand.rs:4333-4337 | rust/lance-index/src/scalar/inverted/wand.rs:4361-4365 — both copies are in the same file, so extract the block into 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:1564 — rust/lance-index/src/scalar/ngram.rs:1564-1568 | rust/lance-index/src/scalar/ngram.rs:1571-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.
  • Duplicated block (5 lines × 2) rust/lance-index/src/scalar/zonemap.rs:2184 — rust/lance-index/src/scalar/zonemap.rs:2184-2188 | rust/lance-index/src/scalar/zonemap.rs:2554-2558 — both copies are in the same file, so extract the block into 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/bq/builder.rs:874 — rust/lance-index/src/vector/bq/builder.rs:874-878 | rust/lance-index/src/vector/bq/builder.rs:960-964 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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/sq/pairwise.rs:463 — rust/lance-index/src/vector/sq/pairwise.rs:463-467 | rust/lance-index/src/vector/sq/pairwise.rs:508-512 — both copies are in the same file, so extract the block into 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/sq/pairwise.rs:475 — rust/lance-index/src/vector/sq/pairwise.rs:475-479 | rust/lance-index/src/vector/sq/pairwise.rs:523-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/lance-index/src/vector/storage.rs:221 — rust/lance-index/src/vector/storage.rs:221-225 | rust/lance-index/src/vector/storage.rs:254-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/lance-jsonb/src/core/de.rs:370 — rust/lance-jsonb/src/core/de.rs:370-375 | rust/lance-jsonb/src/core/de.rs:586-590 — both copies are in the same file, so extract the block into 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-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.
  • Duplicated block (5 lines × 2) rust/lance-jsonb/src/core/util.rs:412 — rust/lance-jsonb/src/core/util.rs:412-416 | rust/lance-jsonb/src/core/util.rs:419-423 — both copies are in the same file, so extract the block into 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/distance/cosine.rs:547 — rust/lance-linalg/src/distance/cosine.rs:547-551 | rust/lance-linalg/src/distance/cosine.rs:1132-1136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 36 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×48
  • TooManyMethods: Dataset java/src/main/java/org/lance/Dataset.java:84 — TooManyMethods — 208 methods. The bar is 30 methods; this is 178 over it, 6.93× 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: Scanner rust/lance/src/dataset/scanner.rs:1139 — TooManyMethods — 170 methods. The bar is 30 methods; this is 140 over it, 5.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Dataset rust/lance/src/dataset.rs:238 — TooManyMethods — 164 methods, declared across 6 files: src/dataset.rs (149), src/index.rs (7), dataset/files.rs (3), dataset/write.rs (3), +2 more file(s). The bar is 30 methods; this is 134 over it, 5.47× 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:830 — TooManyMethods — 127 methods. The bar is 30 methods; this is 97 over it, 4.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: 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:859 — TooManyMethods — 98 methods. The bar is 30 methods; this is 68 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IvfQuantizationStorage rust/lance-index/src/vector/storage.rs:1221 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ManifestNamespace rust/lance-namespace-impls/src/dir/manifest.rs:787 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DirectoryNamespace rust/lance-namespace-impls/src/dir.rs:169 — TooManyMethods — 65 methods, declared across 7 files: dir/resolve.rs (36), dir/versions.rs (9), dir/transactions.rs (6), dir/index_params.rs (5), +3 more file(s). The bar is 30 methods; this is 35 over it, 2.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: InvertedIndex rust/lance-index/src/scalar/inverted/index/inverted_index.rs:23 — TooManyMethods — 62 methods, declared across 2 files: index/inverted_index.rs (33), index/search.rs (29). The bar is 30 methods; this is 32 over it, 2.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FileFragment rust/lance/src/dataset/fragment.rs:143 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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 python/python/lance/namespace.py:269 — 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: RestNamespace python/python/lance/namespace.py:921 — 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: 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: Wand rust/lance-index/src/scalar/inverted/wand.rs:2422 — TooManyMethods — 55 methods, declared across 2 files: inverted/wand.rs (53), inverted/wand_maxscore.rs (2). 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: ObjectStore rust/lance-io/src/object_store.rs:203 — TooManyMethods — 53 methods, declared across 2 files: src/object_store.rs (51), object_store/read_dir.rs (2). The bar is 30 methods; this is 23 over it, 1.77× 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:62 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FtsMemIndex rust/lance/src/dataset/mem_wal/index/fts.rs:1330 — 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: FileReader rust/lance-file/src/reader.rs:460 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.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: PostingListReader rust/lance-index/src/scalar/inverted/index/posting_reader.rs:83 — TooManyMethods — 50 methods, declared across 2 files: index/posting_reader.rs (31), index/posting_prewarm.rs (19). The bar is 30 methods; this is 20 over it, 1.67× 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: 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:532 — 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: IVFIndex rust/lance/src/index/vector/ivf/v2.rs:1134 — 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.
  • + 23 more in this group — see findings.md.
D1 · Cyclomatic Complexity · lance · ×47
  • lance::index::append::merge_indices_with_unindexed_frags (cyclomatic 47) rust/lance/src/index/append.rs:1464 — lance::index::append::merge_indices_with_unindexed_frags has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • lance::index::frag_reuse::build_frag_reuse_rewrite_entry (cyclomatic 42) rust/lance/src/index/frag_reuse.rs:1524 — 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::dataset::optimize::commit_compaction (cyclomatic 41) rust/lance/src/dataset/optimize.rs:3672 — lance::dataset::optimize::commit_compaction 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.
  • lance::io::exec::count_pushdown::try_rewrite (cyclomatic 33) rust/lance/src/io/exec/count_pushdown.rs:107 — lance::io::exec::count_pushdown::try_rewrite 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::index::append::merge_scalar_indices (cyclomatic 31) rust/lance/src/index/append.rs:734 — lance::index::append::merge_scalar_indices 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::optimize::rewrite_files (cyclomatic 30) rust/lance/src/dataset/optimize.rs:2838 — lance::dataset::optimize::rewrite_files 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.
  • lance::dataset::versions::check_manifest_storage_contract (cyclomatic 28) rust/lance/src/dataset/versions/mod.rs:393 — 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::dataset::blob::external::collect_external_blob_uris (cyclomatic 27) rust/lance/src/dataset/blob/external.rs:110 — 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::io::commit::do_commit_new_dataset (cyclomatic 27) rust/lance/src/io/commit.rs:427 — 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_memtable_from_wal (cyclomatic 25) rust/lance/src/dataset/mem_wal/write.rs:1475 — lance::dataset::mem_wal::write::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::dataset::schema_evolution::alter_columns (cyclomatic 25) rust/lance/src/dataset/schema_evolution.rs:853 — lance::dataset::schema_evolution::alter_columns 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:5182 — 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::io::commit::commit_transaction (cyclomatic 25) rust/lance/src/io/commit.rs:1711 — lance::io::commit::commit_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.
  • lance::dataset::index::frag_reuse::compute_tagged_retention (cyclomatic 24) rust/lance/src/dataset/index/frag_reuse.rs:680 — 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_vector_index_impl (cyclomatic 24) rust/lance/src/index/vector.rs:1259 — lance::index::vector::build_vector_index_impl 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::dataset::write::do_write_fragments_impl (cyclomatic 22) rust/lance/src/dataset/write.rs:930 — lance::dataset::write::do_write_fragments_impl 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::index::scalar::index_matches_criteria (cyclomatic 22) rust/lance/src/index/scalar.rs:962 — 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::index::vector::build_distributed_vector_index (cyclomatic 22) rust/lance/src/index/vector.rs:821 — lance::index::vector::build_distributed_vector_index 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::blob::validate_prepared_blob_value_array (cyclomatic 21) rust/lance/src/blob.rs:478 — 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::optimize::consolidate::plan_index (cyclomatic 21) rust/lance/src/index/optimize/consolidate.rs:27 — lance::index::optimize::consolidate::plan_index 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::dataset::optimize::remapping::remap_index (cyclomatic 20) rust/lance/src/dataset/optimize/remapping.rs:232 — lance::dataset::optimize::remapping::remap_index 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::dataset::take::do_take_rows (cyclomatic 20) rust/lance/src/dataset/take.rs:134 — lance::dataset::take::do_take_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.
  • lance::index::append::try_harvest_seeds (cyclomatic 20) rust/lance/src/index/append.rs:504 — lance::index::append::try_harvest_seeds 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::index::frag_reuse::validate_folded_deletions (cyclomatic 20) rust/lance/src/index/frag_reuse.rs:1015 — lance::index::frag_reuse::validate_folded_deletions has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×47
  • Duplicated block (9 lines × 2) java/lance-jni/src/namespace.rs:3464 — java/lance-jni/src/namespace.rs:3464-3472 | java/lance-jni/src/namespace.rs:3593-3601 — both copies are in the same file, so extract the block into 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) 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 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) python/src/dataset.rs:524 — python/src/dataset.rs:524-532 | python/src/dataset.rs:550-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.
  • Duplicated block (9 lines × 2) python/src/dataset.rs:2240 — python/src/dataset.rs:2240-2248 | python/src/dataset.rs:2272-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.
  • 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.
  • 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 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:697 — rust/lance-encoding/src/encodings/physical/alp.rs:697-705 | rust/lance-encoding/src/encodings/physical/alp.rs:794-802 — both copies are in the same file, so extract the block into 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-encoding/src/encodings/physical/packed.rs:856 — rust/lance-encoding/src/encodings/physical/packed.rs:856-864 | rust/lance-encoding/src/encodings/physical/packed.rs:874-882 — both copies are in the same file, so extract the block into 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-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.
  • 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/lance-index/src/scalar.rs:405 — rust/lance-index/src/scalar.rs:405-413 | rust/lance-index/src/scalar.rs:425-433 — both copies are in the same file, so extract the block into 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/scalar/fmindex.rs:855 — rust/lance-index/src/scalar/fmindex.rs:855-863 | rust/lance-index/src/scalar/fmindex.rs:878-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.
  • 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.
  • Duplicated block (9 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:311 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:311-319 | rust/lance-index/src/scalar/inverted/index/inverted_index.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.
  • Duplicated block (9 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:1734 — rust/lance-index/src/scalar/inverted/wand.rs:1734-1742 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:253-261 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:4036 — rust/lance-index/src/scalar/inverted/wand.rs:4036-4044 | rust/lance-index/src/scalar/inverted/wand.rs:4074-4082 — both copies are in the same file, so extract the block into 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/scalar/inverted/wand.rs:4251 — rust/lance-index/src/scalar/inverted/wand.rs:4251-4259 | rust/lance-index/src/scalar/inverted/wand.rs:4299-4307 — both copies are in the same file, so extract the block into 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/bq/storage.rs:2166 — rust/lance-index/src/vector/bq/storage.rs:2166-2174 | rust/lance-index/src/vector/storage.rs:216-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) rust/lance-index/src/vector/bq/storage.rs:2619 — rust/lance-index/src/vector/bq/storage.rs:2619-2627 | rust/lance-index/src/vector/bq/storage.rs:2773-2781 — both copies are in the same file, so extract the block into 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.
  • Duplicated block (9 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1597 — rust/lance-index/src/vector/distributed/index_merger.rs:1597-1605 | rust/lance-index/src/vector/distributed/index_merger.rs:1646-1654 — both copies are in the same file, so extract the block into 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/hnsw/index.rs:286 — rust/lance-index/src/vector/hnsw/index.rs:286-294 | rust/lance/src/index/vector/ivf/v2.rs:3447-3455 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) rust/lance-index/src/vector/hnsw/remap.rs:136 — rust/lance-index/src/vector/hnsw/remap.rs:136-144 | rust/lance-index/src/vector/hnsw/remap.rs:285-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) rust/lance-io/src/lib.rs:231 — rust/lance-io/src/lib.rs:231-239 | rust/lance-io/src/lib.rs:286-294 — both copies are in the same file, so extract the block into 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-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.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×43
  • Duplicated block (11 lines × 2) python/src/dataset.rs:2570 — python/src/dataset.rs:2570-2580 | python/src/dataset.rs:4823-4833 — both copies are in the same file, so extract the block into 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:528 — python/src/mem_wal.rs:528-538 | python/src/mem_wal.rs:685-695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (11 lines × 2) rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:439 — rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:439-449 | rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:494-504 — both copies are in the same file, so extract the block into 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/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:1455 — rust/lance-encoding/src/encodings/physical/alp.rs:1455-1465 | rust/lance-encoding/src/encodings/physical/alp.rs:1507-1517 — both copies are in the same file, so extract the block into 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/repdef.rs:2201 — rust/lance-encoding/src/repdef.rs:2201-2211 | rust/lance-encoding/src/repdef.rs:2222-2232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/lance-file/src/reader.rs:1264 — rust/lance-file/src/reader.rs:1264-1274 | rust/lance-file/src/reader.rs:1349-1359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (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:637-647 — 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:589 — rust/lance-index/src/scalar/bloomfilter.rs:589-599 | rust/lance-index/src/scalar/zonemap.rs:893-903 — 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 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) 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.
  • Duplicated block (11 lines × 2) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:657 — rust/lance-index/src/scalar/inverted/wand_maxscore.rs:657-667 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:705-715 — both copies are in the same file, so extract the block into 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-index/src/vector/bq/builder.rs:862 — rust/lance-index/src/vector/bq/builder.rs:862-872 | rust/lance-index/src/vector/bq/builder.rs:937-947 — both copies are in the same file, so extract the block into 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-index/src/vector/kmeans.rs:377 — rust/lance-index/src/vector/kmeans.rs:377-387 | rust/lance-index/src/vector/kmeans.rs:1059-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.
  • Duplicated block (11 lines × 2) rust/lance-io/src/object_store/providers/oss.rs:52 — rust/lance-io/src/object_store/providers/oss.rs:52-62 | rust/lance-io/src/object_store/providers/tos.rs:59-69 — 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.
  • 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.
  • 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.
  • 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.
  • Duplicated block (11 lines × 2) rust/lance-linalg/src/distance/l2.rs:684 — rust/lance-linalg/src/distance/l2.rs:684-694 | rust/lance-linalg/src/distance/l2.rs:869-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.
  • Duplicated block (11 lines × 2) rust/lance/src/dataset/fragment/write.rs:154 — rust/lance/src/dataset/fragment/write.rs:154-164 | rust/lance/src/dataset/fragment/write.rs:258-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:480 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:480-490 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:517-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/lance/src/dataset/mem_wal/scanner/builder.rs:345 — rust/lance/src/dataset/mem_wal/scanner/builder.rs:345-355 | rust/lance/src/dataset/mem_wal/scanner/collector.rs:147-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:361 — rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:361-371 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:534-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:740 — rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:740-750 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:837-847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×40
  • Duplicated block (14 lines × 2) java/lance-jni/src/blocking_scanner.rs:154 — java/lance-jni/src/blocking_scanner.rs:154-167 | java/lance-jni/src/blocking_scanner.rs:179-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 (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 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) python/src/dataset.rs:1295 — python/src/dataset.rs:1295-1308 | python/src/fragment.rs:295-308 — 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 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) python/src/dataset.rs:5684 — python/src/dataset.rs:5684-5697 | python/src/dataset.rs:5709-5722 — both copies are in the same file, so extract the block into 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/compression/fsst/src/fsst.rs:84 — rust/compression/fsst/src/fsst.rs:84-97 | rust/compression/fsst/src/fsst.rs:102-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.
  • Duplicated block (14 lines × 2) rust/lance-core/src/utils/row_addr_remap.rs:581 — rust/lance-core/src/utils/row_addr_remap.rs:581-594 | rust/lance-core/src/utils/row_addr_remap.rs:602-615 — both copies are in the same file, so extract the block into 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-encoding/src/encodings/logical/primitive/chunk_index.rs:262 — rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:262-275 | rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:307-320 — both copies are in the same file, so extract the block into 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-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.
  • Duplicated block (14 lines × 2) rust/lance-encoding/src/encodings/physical/packed.rs:760 — rust/lance-encoding/src/encodings/physical/packed.rs:760-773 | rust/lance-encoding/src/encodings/physical/packed.rs:799-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.
  • Duplicated block (14 lines × 2) rust/lance-file/src/concat.rs:477 — rust/lance-file/src/concat.rs:477-490 | rust/lance-file/src/concat.rs:495-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/lance-file/src/reader.rs:1161 — rust/lance-file/src/reader.rs:1161-1174 | rust/lance-file/src/reader.rs:1601-1614 — both copies are in the same file, so extract the block into 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/builder.rs:694 — rust/lance-index/src/scalar/inverted/builder.rs:694-707 | rust/lance-index/src/scalar/inverted/builder.rs:779-792 — both copies are in the same file, so extract the block into 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:897 — rust/lance-index/src/scalar/inverted/index/partition.rs:897-910 | rust/lance-index/src/scalar/inverted/index/partition.rs:935-948 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/lance-index/src/scalar/inverted/index/partition.rs:1212 — rust/lance-index/src/scalar/inverted/index/partition.rs:1212-1225 | rust/lance-index/src/scalar/inverted/index/partition.rs:1276-1289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:585 — rust/lance-index/src/scalar/inverted/wand_maxscore.rs:585-598 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:632-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1577 — rust/lance-index/src/vector/distributed/index_merger.rs:1577-1590 | rust/lance-index/src/vector/distributed/index_merger.rs:1607-1620 — both copies are in the same file, so extract the block into 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/hnsw/builder.rs:427 — rust/lance-index/src/vector/hnsw/builder.rs:427-440 | rust/lance-index/src/vector/hnsw/builder.rs:607-620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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:97-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • Duplicated block (14 lines × 2) rust/lance/src/dataset/blob/external.rs:144 — rust/lance/src/dataset/blob/external.rs:144-157 | rust/lance/src/dataset/blob/write.rs:1013-1026 — 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:127 — rust/lance/src/dataset/blob/managed.rs:127-140 | rust/lance/src/dataset/blob/managed.rs:143-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:880 — rust/lance/src/dataset/mem_wal/hnsw/graph.rs:880-893 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:969-982 — both copies are in the same file, so extract the block into 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/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.
  • Duplicated block (14 lines × 2) rust/lance/src/dataset/mem_wal/scanner/collector.rs:304 — rust/lance/src/dataset/mem_wal/scanner/collector.rs:304-317 | rust/lance/src/dataset/mem_wal/scanner/collector.rs:345-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 15 more in this group — see findings.md.
D2 · Cognitive Complexity · lance_index · ×39
  • lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cognitive 298) rust/lance-index/src/vector/distributed/index_merger.rs:862 — lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner has cognitive complexity 298 (threshold 15). Drivers by points: if/else 97 (247 pts), match/switch 8 (21 pts), loops 8 (16 pts), boolean chains 14 (nesting depth added 171). To reduce it, split the body into named stages: move each independent 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 92) rust/lance-index/src/vector/graph.rs:578 — lance_index::vector::graph::beam_search_acorn has cognitive complexity 92 (threshold 15). Drivers by points: if/else 22 (71 pts), loops 6 (15 pts), boolean chains 6 (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::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::index::flat_search::tokenize_and_count (cognitive 34) rust/lance-index/src/scalar/inverted/index/flat_search.rs:240 — lance_index::scalar::inverted::index::flat_search::tokenize_and_count has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 7 (10 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.
  • lance_index::scalar::inverted::cross_column::collect_local_generator_candidates (cognitive 31) rust/lance-index/src/scalar/inverted/cross_column.rs:948 — 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:2321 — 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:723 — 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::vector::hnsw::remap::remap_graph_batch (cognitive 30) rust/lance-index/src/vector/hnsw/remap.rs:50 — lance_index::vector::hnsw::remap::remap_graph_batch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (7 pts), match/switch 2, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config (cognitive 29) rust/lance-index/src/scalar/fmindex.rs:1743 — 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::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::combined::search::combined_fields_search (cognitive 28) rust/lance-index/src/scalar/inverted/combined/search.rs:65 — lance_index::scalar::inverted::combined::search::combined_fields_search has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 6 (13 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_index::scalar::inverted::cross_column::score_generator_candidates (cognitive 28) rust/lance-index/src/scalar/inverted/cross_column.rs:1060 — 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::exclusive_partial_score_limit (cognitive 28) rust/lance-index/src/scalar/inverted/wand.rs:1859 — lance_index::scalar::inverted::wand::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::scalar::inverted::cross_column::score_cross_column_sources (cognitive 26) rust/lance-index/src/scalar/inverted/cross_column.rs:1176 — 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:354 — 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:491 — 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::exact_phrase_scan (cognitive 22) rust/lance-index/src/scalar/inverted/wand.rs:5756 — lance_index::scalar::inverted::wand::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::inverted::final_query_tokens (cognitive 21) rust/lance-index/src/scalar/inverted.rs:119 — lance_index::scalar::inverted::final_query_tokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (9 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.
  • lance_index::scalar::inverted::encoding::seek_packed_doc_positions (cognitive 21) rust/lance-index/src/scalar/inverted/encoding.rs:791 — lance_index::scalar::inverted::encoding::seek_packed_doc_positions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_index::scalar::inverted::index::flat_search::flat_bm25_score (cognitive 21) rust/lance-index/src/scalar/inverted/index/flat_search.rs:830 — lance_index::scalar::inverted::index::flat_search::flat_bm25_score has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lance_index::vector::bq::ex_dot::pack_block (cognitive 21) rust/lance-index/src/vector/bq/ex_dot.rs:129 — lance_index::vector::bq::ex_dot::pack_block has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 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.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×35
  • Duplicated block (12 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:194 — rust/lance-encoding/src/encodings/logical/primitive/blob.rs:194-205 | rust/lance-encoding/src/encodings/logical/primitive/blob.rs:534-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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.
  • Duplicated block (12 lines × 2) rust/lance-file/src/concat.rs:457 — rust/lance-file/src/concat.rs:457-468 | rust/lance/src/dataset/blob/external.rs:205-216 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) rust/lance-file/src/reader/structural.rs:231 — rust/lance-file/src/reader/structural.rs:231-242 | 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 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:901 — rust/lance-file/src/versions/v2_0/writer.rs:901-912 | rust/lance-file/src/writer/structural.rs:882-893 — 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (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 8 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.
  • Duplicated block (12 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:1378 — rust/lance-index/src/scalar/inverted/wand.rs:1378-1389 | rust/lance-index/src/scalar/inverted/wand.rs:1424-1435 — both copies are in the same file, so extract the block into 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-index/src/scalar/json.rs:106 — rust/lance-index/src/scalar/json.rs:106-117 | rust/lance-index/src/scalar/json.rs:206-217 — both copies are in the same file, so extract the block into 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-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:472-483 — both copies are in the same file, so extract the block into 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-index/src/vector/bq/storage.rs:766 — rust/lance-index/src/vector/bq/storage.rs:766-777 | rust/lance-index/src/vector/bq/storage.rs:805-816 — both copies are in the same file, so extract the block into 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-index/src/vector/flat/index.rs:153 — rust/lance-index/src/vector/flat/index.rs:153-164 | rust/lance-index/src/vector/flat/index.rs:298-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.
  • 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.
  • Duplicated block (12 lines × 2) rust/lance-io/src/object_store.rs:1406 — rust/lance-io/src/object_store.rs:1406-1417 | rust/lance-io/src/object_store.rs:1536-1547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/lance-io/src/object_store/providers/azure.rs:190 — rust/lance-io/src/object_store/providers/azure.rs:190-201 | rust/lance-io/src/object_store/providers/gcp.rs:278-289 — 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 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • 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.
  • 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.
  • Duplicated block (12 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2591 — rust/lance-namespace-impls/src/dir/manifest.rs:2591-2602 | rust/lance-namespace-impls/src/dir/manifest.rs:2627-2638 — both copies are in the same file, so extract the block into 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:2843 — rust/lance-namespace-impls/src/dir/manifest.rs:2843-2854 | rust/lance-namespace-impls/src/dir/manifest.rs:3364-3375 — both copies are in the same file, so extract the block into 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:2856 — rust/lance-namespace-impls/src/dir/manifest.rs:2856-2867 | rust/lance-namespace-impls/src/dir/manifest.rs:3377-3388 — both copies are in the same file, so extract the block into 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-table/src/format/key_existence.rs:347 — rust/lance-table/src/format/key_existence.rs:347-358 | rust/lance-table/src/format/key_existence.rs:361-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (12 lines × 2) rust/lance/src/dataset/blob/materialize.rs:736 — rust/lance/src/dataset/blob/materialize.rs:736-747 | rust/lance/src/dataset/optimize.rs:2126-2137 — 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 (12 lines × 2) rust/lance/src/dataset/mem_wal/index/fts.rs:3577 — rust/lance/src/dataset/mem_wal/index/fts.rs:3577-3588 | rust/lance/src/dataset/mem_wal/index/fts.rs:4911-4922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×32
  • 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.
  • Duplicated block (13 lines × 2) java/lance-jni/src/namespace.rs:3547 — java/lance-jni/src/namespace.rs:3547-3559 | java/lance-jni/src/namespace.rs:3676-3688 — both copies are in the same file, so extract the block into 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/array_encoding/logical/list.rs:1144 — rust/lance-encoding/src/array_encoding/logical/list.rs:1144-1156 | rust/lance-encoding/src/array_encoding/logical/list.rs:1174-1186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:888 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:888-900 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:977-989 — both copies are in the same file, so extract the block into 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-file/src/reader.rs:1308 — rust/lance-file/src/reader.rs:1308-1320 | rust/lance-file/src/reader.rs:1387-1399 — both copies are in the same file, so extract the block into 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-file/src/reader.rs:1468 — rust/lance-file/src/reader.rs:1468-1480 | rust/lance-file/src/reader.rs:1889-1901 — both copies are in the same file, so extract the block into 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-index/src/scalar/inverted/compound.rs:181 — rust/lance-index/src/scalar/inverted/compound.rs:181-193 | rust/lance-index/src/scalar/inverted/wand.rs:6391-6403 — 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-index/src/vector.rs:397 — rust/lance-index/src/vector.rs:397-409 | rust/lance/src/index/vector/ivf/v2.rs:2893-2905 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) 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.
  • Duplicated block (13 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1329 — rust/lance-index/src/vector/distributed/index_merger.rs:1329-1341 | rust/lance-index/src/vector/distributed/index_merger.rs:1362-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.
  • Duplicated block (13 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:806 — rust/lance-linalg/src/simd/dist_table.rs:806-818 | rust/lance-linalg/src/simd/dist_table.rs:994-1006 — both copies are in the same file, so extract the block into 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-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.
  • Duplicated block (13 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2915 — rust/lance-namespace-impls/src/dir/manifest.rs:2915-2927 | rust/lance-namespace-impls/src/dir/manifest.rs:3037-3049 — both copies are in the same file, so extract the block into 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:1309 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1309-1321 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:692-704 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.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 (13 lines × 2) rust/lance/src/dataset/optimize/remapping.rs:350 — rust/lance/src/dataset/optimize/remapping.rs:350-362 | rust/lance/src/dataset/optimize/remapping.rs:1014-1026 — both copies are in the same file, so extract the block into 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/scanner.rs:5966 — rust/lance/src/dataset/scanner.rs:5966-5978 | rust/lance/src/dataset/scanner.rs:6040-6052 — both copies are in the same file, so extract the block into 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/scanner.rs:6011 — rust/lance/src/dataset/scanner.rs:6011-6023 | rust/lance/src/dataset/scanner.rs:6322-6334 — both copies are in the same file, so extract the block into 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/write/merge_insert.rs:3282 — rust/lance/src/dataset/write/merge_insert.rs:3282-3294 | rust/lance/src/dataset/write/merge_insert.rs:3442-3454 — both copies are in the same file, so extract the block into 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/write/merge_insert/exec/delete.rs:138 — rust/lance/src/dataset/write/merge_insert/exec/delete.rs:138-150 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:609-621 — 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 7 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/write.rs:1109 — rust/lance/src/dataset/write/merge_insert/exec/write.rs:1109-1121 | rust/lance/src/dataset/write/merge_insert/logical_plan.rs:171-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) rust/lance/src/index/scalar/bitmap.rs:39 — rust/lance/src/index/scalar/bitmap.rs:39-51 | rust/lance/src/index/scalar/btree.rs:69-81 — 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 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/lance/src/index/scalar/bitmap.rs:93 — rust/lance/src/index/scalar/bitmap.rs:93-105 | rust/lance/src/index/scalar/label_list.rs:102-114 — 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 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/lance/src/index/vector/ivf.rs:4908 — rust/lance/src/index/vector/ivf.rs:4908-4920 | rust/lance/src/index/vector/ivf.rs:4934-4946 — both copies are in the same file, so extract the block into 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/io/exec/filtered_read.rs:3185 — rust/lance/src/io/exec/filtered_read.rs:3185-3197 | rust/lance/src/io/exec/filtered_read.rs:3248-3260 — both copies are in the same file, so extract the block into 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/io/exec/fts.rs:1888 — rust/lance/src/io/exec/fts.rs:1888-1900 | rust/lance/src/io/exec/fts.rs:2276-2288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 7 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×31
  • Repeated repair: rust/lance-io/src/object_store.rs rust/lance-io/src/object_store.rs:1353 — rust/lance-io/src/object_store.rs changed 21 times in last 90 days and 13 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 ObjectStore::copy_via_stream_inner at line 1353), 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): remove dependency on unreleased object_store (#10363)”; “fix(io): delete hierarchical storage directories after their contents (#9827)”; “fix: prevent incomplete unordered listings after retry errors (#9691)”; “fix(io): resolve locations that the rest of the stack accepts (#10009)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-io/src/object_store.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 13 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 9 (its worst body is lance_linalg::distance::half_backend at line 117), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-io/src/object_store/providers/aws.rs rust/lance-io/src/object_store/providers/aws.rs:401 — rust/lance-io/src/object_store/providers/aws.rs changed 16 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 10 (its worst body is lance_io::object_store::providers::aws::build_aws_credential at line 401), 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): remove dependency on unreleased object_store (#10363)”; “fix(io): stop ignoring storage configuration that lance accepts (#10008)”; “fix(io): resolve cloud option aliases deterministically (#9719)”; “fix: tolerate temporary AWS STS errors in AwsCredentialAdapter (#9561)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-io/src/object_store/providers/aws.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/l2.rs rust/lance-linalg/src/distance/l2.rs:517 — rust/lance-linalg/src/distance/l2.rs changed 13 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 10 (its worst body is lance_linalg::distance::l2::x86::l2_batch_f32_avx_fma at line 517), 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): gate L2 SimdSupport import on x86_64 (#9279)”; “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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-linalg/src/distance/l2.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 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 12 (its worst body is ObjectWriter::poll_tasks at line 400), 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): 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)”; “fix(index): stream bulk index file copies (#8770)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-index/src/scalar/inverted/query.rs rust/lance-index/src/scalar/inverted/query.rs:1208 — rust/lance-index/src/scalar/inverted/query.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 lance_index::scalar::inverted::query::fill_fts_query_column at line 1208), 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: make MultiMatchQuery serde lossless (#9753)”; “fix(fts): prevent overflow for unordered token positions (#9017)”; “fix(fts): validate JSON index queries and targets (#8813)”; “fix(fts): canonicalize fuzzy expansion across segments (#8758)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-linalg/src/distance/dot.rs rust/lance-linalg/src/distance/dot.rs:381 — rust/lance-linalg/src/distance/dot.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 7 (its worst body is lance_linalg::distance::dot::x86::dot_batch_f32_avx_fma at line 381), 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): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): reject a null Int8 query instead of panicking (#8884)”; “fix(linalg): widen u8 distance accumulators (#8888)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-linalg/src/distance/dot.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:808 — rust/lance-linalg/src/distance/cosine.rs changed 9 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 9 (its worst body is CosineBatchIter::next at line 808), 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): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): reject a null Int8 query instead of panicking (#8884)”; “fix(linalg): distinguish arrow batch type errors (#8911)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-io/src/object_store/providers/azure.rs rust/lance-io/src/object_store/providers/azure.rs:39 — rust/lance-io/src/object_store/providers/azure.rs changed 11 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 6 (its worst body is AzureBlobStoreProvider::normalize_opendal_azure_options at line 39), 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): remove dependency on unreleased object_store (#10363)”; “fix(io): resolve locations that the rest of the stack accepts (#10009)”; “fix(io): resolve cloud option aliases deterministically (#9719)”; “fix(io): normalize OpenDAL listed paths (#8654)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-io/src/object_store/providers/azure.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/gcp.rs rust/lance-io/src/object_store/providers/gcp.rs:172 — rust/lance-io/src/object_store/providers/gcp.rs changed 11 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 7 (its worst body is lance_io::object_store::providers::gcp::workload_identity_credential_provider at line 172), 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): remove dependency on unreleased object_store (#10363)”; “fix(io): resolve cloud option aliases deterministically (#9719)”; “fix(io): normalize OpenDAL listed paths (#8654)”; “fix(io): support GCS workload identity credentials (#8389)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-io/src/object_store/providers/gcp.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/index/inverted_index.rs rust/lance-index/src/scalar/inverted/index/inverted_index.rs:174 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs changed 11 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 7 (its worst body is InvertedIndex::merge_segments at line 174), 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): release cached FTS readers when requests end (#9937)”; “fix(fts): segmented full-text index returns stale rows under stable row ids (#9872)”; “fix(index): don't recompute fragment coverage for bitmap/label_list/inverted (#9544)”; “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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-index/src/scalar/inverted/index/inverted_index.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 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 11 (its worst body is StructuralStructDecoder::field_to_decoder at line 265), 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(dataset): validate nested schema names and stored system columns (#9499)”; “fix: write nullable structs that contain a Null-typed field (#9579)”; “fix(encoding): derive full-zip max_visible_def like the writer (#9254)”; “fix: reject lossy null structs in v2.0 (#8507)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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_store/providers/tos.rs rust/lance-io/src/object_store/providers/tos.rs:73 — rust/lance-io/src/object_store/providers/tos.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 5 (its worst body is TosStoreProvider::normalize_tos_config at line 73), 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): remove dependency on unreleased object_store (#10363)”; “fix(io): delete hierarchical storage directories after their contents (#9827)”; “fix(io): normalize OpenDAL listed paths (#8654)”; “fix(io): preserve Windows UNC share roots (#8378)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-io/src/object_store/providers/tos.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/norm_l2.rs rust/lance-linalg/src/distance/norm_l2.rs:164 — rust/lance-linalg/src/distance/norm_l2.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 4 (its worst body is lance_linalg::distance::norm_l2::norm_l2_f32_dispatched at line 164), 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): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): pick the sum-of-squares accumulator per element type (#8533)”; “fix: fall back to AVX2 f16 kernels on AVX-512 CPUs (#7428)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-linalg/src/distance/norm_l2.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-core/src/error.rs rust/lance-core/src/error.rs:1020 — rust/lance-core/src/error.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 12 (its worst body is Error::from at line 1020), 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(core): keep typed error signals across CloneableError::clone (#9542)”; “fix: preserve typed DataFusion errors through Shared and ReplayExec (#8677)”; “fix(sql): classify malformed SQL queries as invalid input (#8974)”; “fix: recognize own commit on conflict and avoid deleting committed artifacts (#7722)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-core/src/error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: rust/lance-linalg/src/simd/dist_table.rs rust/lance-linalg/src/simd/dist_table.rs:124 — rust/lance-linalg/src/simd/dist_table.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is lance_linalg::simd::dist_table::sum_4bit_dist_table_uninit at line 124), 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): preserve 4-bit PQ scores in bulk search (#9537)”; “fix(index): reject RabitQ indices whose dimension is not a multiple of 8 (#8869)”; “fix(index): widen the RaBitQ FastScan accumulator above 1024 dims (#8842)”; “fix(index): initialize BQ distance buffers (#8598)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-linalg/src/simd/dist_table.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:514 — rust/lance-encoding/src/encodings/logical/primitive/field.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 11 (its worst body is lance_encoding::encodings::logical::primitive::field::for_each_page_range at line 514), 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(encoding): sort a lone unsorted batched read (#10036)”; “fix(encoding): merge page dictionaries exactly when a batch spans pages (#10286)”; “fix(blob): resolve descriptor subfields in projections and filters (#10149)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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/src/dataset/refs.rs rust/lance/src/dataset/refs.rs:1000 — rust/lance/src/dataset/refs.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 13 (its worst body is lance::dataset::refs::check_valid_branch at line 1000), 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: list hierarchical branches on object stores (#9198)”; “fix: reserve main branch name (#7180)”; “fix(tag): make tag creation atomic (#8459)”; “fix(dataset): prevent deleting branches referenced by tags (#8365)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/dataset/refs.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), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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: python/python/lance/mem_wal.py python/python/lance/mem_wal.py:573 — python/python/lance/mem_wal.py 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 LsmVectorSearchPlanner.plan_search at line 573), 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(mem_wal): read frozen memtables in ShardWriter.lsm_scanner (#9687)”; “fix(mem_wal): sync MemWAL type stubs with the binding signatures (#9701)”; “fix(mem_wal): rank every vector search arm on one distance scale (#9849)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- python/python/lance/mem_wal.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/sql.rs rust/lance/src/dataset/sql.rs:126 — rust/lance/src/dataset/sql.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 SqlQueryBuilder::build at line 126), 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: count rows selected by row id or row address (#9907)”; “fix(sql): classify malformed SQL queries as invalid input (#8974)”; “fix(sql): include system columns when requested for SQL-based query (#8626)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/dataset/sql.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 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is lance_encoding::array_encoding::logical::list::decode_offsets at line 214), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-encoding/src/array_encoding/logical/primitive.rs rust/lance-encoding/src/array_encoding/logical/primitive.rs:379 — rust/lance-encoding/src/array_encoding/logical/primitive.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 PrimitiveFieldDecoder::max_rows_to_drain at line 379), 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(encoding): split legacy decode batches before i32 offset overflow (#9225)”; “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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08: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-table/src/io/commit/dynamodb.rs rust/lance-table/src/io/commit/dynamodb.rs:233 — rust/lance-table/src/io/commit/dynamodb.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 DynamoDBExternalManifestStore::new_external_store at line 233), 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(table): validate DynamoDB key types and page the manifest delete (#9977)”; “fix(table): surface a malformed manifest size from DynamoDB (#9023)”; “fix(commit): make object storage authoritative for external manifests (#8499)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance-table/src/io/commit/dynamodb.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/storage.rs rust/lance/src/dataset/mem_wal/hnsw/storage.rs:241 — rust/lance/src/dataset/mem_wal/hnsw/storage.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 ArrowFixedSizeListVectorStore::append_batch at line 241), 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(mem_wal): keep repeated vectors reachable in the memtable HNSW graph (#10186)”; “fix(mem_wal): rank a dot-product memtable index by distance, not by product (#9689)”; “fix: make MemWAL HNSW snapshots publication-consistent (#8591)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 23:00:29 +08:00' --until='2026-10-27 23:00:29 +08:00' --full-history --no-merges -- rust/lance/src/dataset/mem_wal/hnsw/storage.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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×22
  • 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.
  • Duplicated block (16 lines × 2) rust/lance-encoding/src/compression.rs:2036 — rust/lance-encoding/src/compression.rs:2036-2051 | rust/lance-encoding/src/compression.rs:2064-2079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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:324-339 — 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 (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.
  • Duplicated block (16 lines × 2) rust/lance-encoding/src/encodings/logical/struct.rs:512 — rust/lance-encoding/src/encodings/logical/struct.rs:512-527 | rust/lance-encoding/src/encodings/logical/struct.rs:591-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (16 lines × 2) rust/lance-index/src/scalar/expression.rs:1279 — rust/lance-index/src/scalar/expression.rs:1279-1294 | rust/lance-index/src/scalar/expression.rs:1296-1311 — both copies are in the same file, so extract the block into 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-index/src/scalar/inverted/index/partition.rs:1123 — rust/lance-index/src/scalar/inverted/index/partition.rs:1123-1138 | rust/lance-index/src/scalar/inverted/index/partition.rs:1251-1266 — both copies are in the same file, so extract the block into 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-index/src/vector/bq/storage.rs:1140 — rust/lance-index/src/vector/bq/storage.rs:1140-1155 | rust/lance-index/src/vector/bq/storage.rs:1208-1223 — both copies are in the same file, so extract the block into 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-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.
  • Duplicated block (16 lines × 2) rust/lance-io/src/scheduler.rs:149 — rust/lance-io/src/scheduler.rs:149-164 | 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.
  • Duplicated block (16 lines × 2) rust/lance-io/src/uring/current_thread.rs:414 — rust/lance-io/src/uring/current_thread.rs:414-429 | rust/lance-io/src/uring/reader.rs:304-319 — 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 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.
  • Duplicated block (16 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:891 — rust/lance-linalg/src/simd/dist_table.rs:891-906 | rust/lance-linalg/src/simd/dist_table.rs:1098-1113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (16 lines × 2) rust/lance-table/src/rowids/index.rs:752 — rust/lance-table/src/rowids/index.rs:752-767 | rust/lance-table/src/rowids/index.rs:812-827 — both copies are in the same file, so extract the block into 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:326 — rust/lance/src/dataset/builder.rs:326-341 | rust/lance/src/dataset/builder.rs:356-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.
  • Duplicated block (16 lines × 2) rust/lance/src/dataset/mem_wal/index/fts.rs:2385 — rust/lance/src/dataset/mem_wal/index/fts.rs:2385-2400 | rust/lance/src/dataset/mem_wal/index/fts.rs:2478-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.
  • Duplicated block (16 lines × 2) rust/lance/src/index/scalar/inverted.rs:479 — rust/lance/src/index/scalar/inverted.rs:479-494 | rust/lance/src/index/scalar/inverted.rs:500-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 (16 lines × 2) rust/lance/src/index/vector.rs:904 — rust/lance/src/index/vector.rs:904-919 | rust/lance/src/index/vector.rs:925-940 — both copies are in the same file, so extract the block into 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/index/vector.rs:1029 — rust/lance/src/index/vector.rs:1029-1044 | rust/lance/src/index/vector.rs:1047-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 (16 lines × 2) rust/lance/src/io/exec/fts.rs:3402 — rust/lance/src/io/exec/fts.rs:3402-3417 | rust/lance/src/io/exec/fts.rs:5642-5657 — both copies are in the same file, so extract the block into 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-datafusion-exec/src/chunker.rs:331 — rust/lance-datafusion-exec/src/chunker.rs:331-346 | rust/lance-datafusion-exec/src/chunker.rs:427-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · Scanner · ×19
  • Scanner::vector_search (cognitive 90) rust/lance/src/dataset/scanner.rs:6842 — Scanner::vector_search has cognitive complexity 90 (threshold 15). Drivers by points: if/else 33 (67 pts), match/switch 5 (16 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Scanner::create_plan_impl (cognitive 37) rust/lance/src/dataset/scanner.rs:3765 — 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_compound_scorer (cognitive 37) rust/lance/src/dataset/scanner.rs:5417 — 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::nearest (cognitive 31) rust/lance/src/dataset/scanner.rs:2347 — Scanner::nearest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 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_phrase_query (cognitive 31) rust/lance/src/dataset/scanner.rs:5896 — Scanner::plan_phrase_query has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 3 (5 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::create_filter_plan (cognitive 30) rust/lance/src/dataset/scanner.rs:3508 — 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::plan_match_query (cognitive 29) rust/lance/src/dataset/scanner.rs:6212 — Scanner::plan_match_query has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::calculate_final_projection (cognitive 26) rust/lance/src/dataset/scanner.rs:2949 — 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.rs:4044 — 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::fts_rerank (cognitive 26) rust/lance/src/dataset/scanner.rs:8188 — 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::validate_options (cognitive 23) rust/lance/src/dataset/scanner.rs:3423 — Scanner::validate_options has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5 (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.
  • Scanner::plan_restricted_match_query (cognitive 23) rust/lance/src/dataset/scanner.rs:6063 — Scanner::plan_restricted_match_query has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, match/switch 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scanner::plan_combined_fields_query (cognitive 23) rust/lance/src/dataset/scanner.rs:6524 — Scanner::plan_combined_fields_query has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 2 (4 pts), match/switch 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::scalar_indexed_scan (cognitive 20) rust/lance/src/dataset/scanner.rs:7824 — 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::new_filtered_read (cognitive 19) rust/lance/src/dataset/scanner.rs:4209 — Scanner::new_filtered_read has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 2, 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.
  • Scanner::fts_document_granularity (cognitive 19) rust/lance/src/dataset/scanner.rs:5068 — 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.rs:5659 — 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::prefilter_source (cognitive 18) rust/lance/src/dataset/scanner.rs:8625 — Scanner::prefilter_source has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 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::fragments_covered_by_fts_query_helper (cognitive 16) rust/lance/src/dataset/scanner.rs:4960 — 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.
D2 · Cognitive Complexity · lance_encoding · ×19
  • lance_encoding::encodings::logical::primitive::dict::dictionary_encode (cognitive 51) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:289 — lance_encoding::encodings::logical::primitive::dict::dictionary_encode has cognitive complexity 51 (threshold 15). Drivers by points: if/else 6 (28 pts), match/switch 6 (15 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 35). 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::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::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::logical::primitive::planar::validate_page (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/planar.rs:268 — 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::compression::create_fixed_width_block_decompressor_inner (cognitive 24) rust/lance-encoding/src/compression.rs:1645 — 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::binary::decode_generic_binary_miniblock (cognitive 23) rust/lance-encoding/src/encodings/physical/binary.rs:655 — lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 2 (4 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.
  • lance_encoding::repdef::build_control_word_iterator (cognitive 22) rust/lance-encoding/src/repdef.rs:2429 — 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::physical::alp::pack_chunk_f32 (cognitive 21) rust/lance-encoding/src/encodings/physical/alp.rs:831 — lance_encoding::encodings::physical::alp::pack_chunk_f32 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 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. This shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::pack_chunk_f64) 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 (cognitive 21) rust/lance-encoding/src/encodings/physical/alp.rs:926 — lance_encoding::encodings::physical::alp::pack_chunk_f64 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 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. This shape REPEATS in the file: one other method here (lance_encoding::encodings::physical::alp::pack_chunk_f32) 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::field::for_each_page_range (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive/field.rs:514 — 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:328 — 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::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::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.
  • lance_encoding::encoder::encode_batch (cognitive 17) rust/lance-encoding/src/encoder.rs:402 — lance_encoding::encoder::encode_batch has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (15 pts), boolean chains 1, if/else 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.
  • lance_encoding::encodings::physical::alp::parse_header (cognitive 17) rust/lance-encoding/src/encodings/physical/alp.rs:1266 — lance_encoding::encodings::physical::alp::parse_header has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, 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.
  • lance_encoding::encodings::physical::rle::select_miniblock_run_length_width (cognitive 16) rust/lance-encoding/src/encodings/physical/rle.rs:207 — lance_encoding::encodings::physical::rle::select_miniblock_run_length_width has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (collect). 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_encoding::encodings::physical::sequence::statistics::analyze_member (cognitive 16) rust/lance-encoding/src/encodings/physical/sequence/statistics.rs:318 — lance_encoding::encodings::physical::sequence::statistics::analyze_member has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×18
  • Duplicated block (15 lines × 2) java/lance-jni/src/mem_wal.rs:907 — java/lance-jni/src/mem_wal.rs:907-921 | python/src/mem_wal.rs:843-857 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/lance-encoding/src/encodings/physical/rle.rs:854 — rust/lance-encoding/src/encodings/physical/rle.rs:854-868 | rust/lance-encoding/src/encodings/physical/rle.rs:935-949 — both copies are in the same file, so extract the block into 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-file/src/reader.rs:2422 — rust/lance-file/src/reader.rs:2422-2436 | rust/lance-file/src/reader.rs:2470-2484 — both copies are in the same file, so extract the block into 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-io/src/object_store.rs:883 — rust/lance-io/src/object_store.rs:883-897 | rust/lance-io/src/object_store.rs:948-962 — both copies are in the same file, so extract the block into 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-io/src/uring/current_thread.rs:395 — rust/lance-io/src/uring/current_thread.rs:395-409 | rust/lance-io/src/uring/reader.rs:285-299 — 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 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.
  • 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.
  • Duplicated block (15 lines × 2) rust/lance/src/dataset/blob/external.rs:232 — rust/lance/src/dataset/blob/external.rs:232-246 | rust/lance/src/dataset/blob/external.rs:251-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) rust/lance/src/dataset/fragment.rs:2742 — rust/lance/src/dataset/fragment.rs:2742-2756 | rust/lance/src/dataset/write/merge_insert.rs:2460-2474 — 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/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:113 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:113-127 | rust/lance/src/io/exec/pushdown_scan.rs:137-151 — 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/src/index/append.rs:815 — rust/lance/src/index/append.rs:815-829 | rust/lance/src/index/scalar.rs:408-422 — 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 (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 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/index/vector/ivf/v2.rs:1337 — rust/lance/src/index/vector/ivf/v2.rs:1337-1351 | rust/lance/src/index/vector/ivf/v2.rs:1363-1377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) rust/lance/src/io/exec/filtered_read.rs:3586 — rust/lance/src/io/exec/filtered_read.rs:3586-3600 | rust/lance/src/io/exec/filtered_read.rs:3613-3627 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/mem_wal.rs:1149 — java/lance-jni/src/mem_wal.rs:1149-1163 | python/src/mem_wal.rs:1086-1100 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2234 — rust/lance-namespace-impls/src/dir/manifest.rs:2234-2248 | rust/lance-namespace-impls/src/dir/manifest.rs:2536-2550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) java/src/main/java/org/lance/Dataset.java:162 — java/src/main/java/org/lance/Dataset.java:162-176 | java/src/main/java/org/lance/Dataset.java:304-318 — both copies are in the same file, so extract the block into 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/python/lance/dataset.py:5802 — python/python/lance/dataset.py:5802-5816 | python/python/lance/fragment.py:1466-1480 — 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 `python/python/lance/dataset.py:5802` it begins part-way through the construct above it, so those 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_table · ×16
  • 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:959 — 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:668 — 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:736 — 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::format::key_existence::extract_key_value (cognitive 16) rust/lance-table/src/format/key_existence.rs:311 — 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::rowids::select_row_ids (cognitive 16) rust/lance-table/src/rowids.rs:1055 — 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.
D2 · Cognitive Complexity · Dataset · ×15
  • Dataset::scanner (cognitive 114) python/src/dataset.rs:1240 — Dataset::scanner has cognitive complexity 114 (threshold 15). Drivers by points: if/else 62 (98 pts), match/switch 6 (15 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dataset::filter_addr_or_ids (cognitive 69) rust/lance/src/dataset.rs:3051 — 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:2632 — 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::collect_paths (cognitive 39) rust/lance/src/dataset.rs:3691 — 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:1483 — 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::merge_existing_index_segments (cognitive 32) rust/lance/src/index.rs:2816 — 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 31) python/src/dataset.rs:938 — Dataset::new has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (28 pts), loops 1 (2 pts), match/switch 1 (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.
  • Dataset::create_data_file (cognitive 29) rust/lance/src/dataset.rs:2382 — Dataset::create_data_file has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 8). Of this number, 20 points are the body's own statements and 9 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::commit_existing_index_segments (cognitive 26) rust/lance/src/index.rs:3014 — Dataset::commit_existing_index_segments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • Dataset::tracked_files_with_options (cognitive 23) rust/lance/src/dataset/files.rs:295 — 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.rs:3273 — 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::scalar_index_info_for_segments (cognitive 21) rust/lance/src/index.rs:4897 — Dataset::scalar_index_info_for_segments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dataset::commit_transaction (cognitive 20) python/src/dataset.rs:3163 — 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::open_vector_index_from_metadata_with_plan (cognitive 20) rust/lance/src/index.rs:4263 — 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:1034 — 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 · Scanner · ×14
  • Scanner::vector_search (cyclomatic 36) rust/lance/src/dataset/scanner.rs:6842 — Scanner::vector_search 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.
  • Scanner::create_plan_impl (cyclomatic 34) rust/lance/src/dataset/scanner.rs:3765 — 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.rs:5417 — 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::validate_options (cyclomatic 20) rust/lance/src/dataset/scanner.rs:3423 — Scanner::validate_options 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_phrase_query (cyclomatic 19) rust/lance/src/dataset/scanner.rs:5896 — Scanner::plan_phrase_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::plan_restricted_match_query (cyclomatic 19) rust/lance/src/dataset/scanner.rs:6063 — Scanner::plan_restricted_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::plan_match_query (cyclomatic 18) rust/lance/src/dataset/scanner.rs:6212 — Scanner::plan_match_query 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::plan_combined_fields_query (cyclomatic 18) rust/lance/src/dataset/scanner.rs:6524 — Scanner::plan_combined_fields_query 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.
  • Scanner::nearest (cyclomatic 17) rust/lance/src/dataset/scanner.rs:2347 — Scanner::nearest 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::calculate_final_projection (cyclomatic 17) rust/lance/src/dataset/scanner.rs:2949 — 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::fts_document_granularity (cyclomatic 17) rust/lance/src/dataset/scanner.rs:5068 — 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::scalar_indexed_scan (cyclomatic 17) rust/lance/src/dataset/scanner.rs:7824 — 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::create_filter_plan (cyclomatic 16) rust/lance/src/dataset/scanner.rs:3508 — 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.
  • Scanner::plan_fts (cyclomatic 16) rust/lance/src/dataset/scanner.rs:5659 — 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×14
  • Duplicated block (10–11 lines × 2) java/lance-jni/src/blocking_dataset.rs:772 — java/lance-jni/src/blocking_dataset.rs:772-781 | rust/lance/src/dataset.rs:1070-1080 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10–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:633-643 — both copies are in the same file, so extract the block into 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-encoding/src/encodings/physical/alp/restore.rs:332 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:332-341 | rust/lance-encoding/src/encodings/physical/alp/restore.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.
  • Duplicated block (10–11 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:414 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:414-423 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:740-750 — both copies are in the same file, so extract the block into 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-encoding/src/encodings/physical/alp/restore.rs:488 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:488-497 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:788-798 — both copies are in the same file, so extract the block into 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-encoding/src/encodings/physical/alp/restore.rs:563 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:563-572 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:836-846 — both copies are in the same file, so extract the block into 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-encoding/src/encodings/physical/alp/restore.rs:634 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:634-643 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:885-895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) rust/lance-file/src/reader.rs:2088 — rust/lance-file/src/reader.rs:2088-2097 | rust/lance-file/src/reader.rs:2295-2305 — both copies are in the same file, so extract the block into 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-linalg/src/simd/dist_table.rs:663 — rust/lance-linalg/src/simd/dist_table.rs:663-673 | rust/lance-linalg/src/simd/dist_table.rs:683-692 — both copies are in the same file, so extract the block into 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.
  • Duplicated block (10–11 lines × 2) rust/lance/src/index.rs:4723 — rust/lance/src/index.rs:4723-4733 | rust/lance/src/index.rs:4774-4783 — both copies are in the same file, so extract the block into 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/io/exec/fts.rs:5938 — rust/lance/src/io/exec/fts.rs:5938-5948 | rust/lance/src/io/exec/fts.rs:6281-6290 — both copies are in the same file, so extract the block into 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) java/src/main/java/org/lance/OpenDatasetBuilder.java:176 — java/src/main/java/org/lance/OpenDatasetBuilder.java:176-186 | java/src/main/java/org/lance/WriteDatasetBuilder.java:395-404 — 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: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.
D35 · Change Coupling · Change coupling · ×13
  • 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: 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 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 8 shared commits counted here, the most recent 3 are `690c4007` feat(java): expose vector distance bounds (#9374); `a245a182` feat(search): add search effort and auto probing through k=100000 (#9…; `7d116d6d` feat(java): add batch vector search binding (#9475) — 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 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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: 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: __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 59% of the time (19 of the 32 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 19 shared commits counted here, the most recent 3 are `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); `fe875b70` fix: compile AVX-512 dist table for target CPU (#7121) — run `git show` on any of them.
  • Change coupling: blocking_dataset.rs ↔ WriteDatasetBuilder.java java/lance-jni/src/blocking_dataset.rs:1 — `java/lance-jni/src/blocking_dataset.rs` and `java/src/main/java/org/lance/WriteDatasetBuilder.java` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 7 shared commits counted here, the most recent 3 are `d143ca29` feat!: expose file writer page options in dataset APIs (#9192); `fd076b19` feat: expose base scoped store bindings to java (#6548); `96725732` feat: add configurable blob v2 pack file size (#6508) — 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 57% of the time (16 of the 28 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 `ab268baa` fix: fall back to AVX2 f16 kernels on AVX-512 CPUs (#7428); `fe875b70` fix: compile AVX-512 dist table for target CPU (#7121); `d0124edf` perf: add SIMD kernels for bf16 distance functions (#6510) — run `git show` on any of them.
  • Change coupling: quantizer.rs ↔ subindex.rs rust/lance-index/src/vector/quantizer.rs:1 — `rust/lance-index/src/vector/quantizer.rs` and `rust/lance-index/src/vector/v3/subindex.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `774d1bd9` feat: introduce `CacheCodec` for serializing index cache entries (#6223); `72ae3554` feat: support remapping for IVF_FLAT, IVF_PQ and IVF_SQ (#2708); `d830c380` refactor: impl the sub index trait for HNSW and clean code (#2462) — 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 · Duplicated block (18 lines × 2) · ×13
  • Duplicated block (18 lines × 2) rust/compression/fsst/src/fsst.rs:976 — rust/compression/fsst/src/fsst.rs:976-993 | rust/compression/fsst/src/fsst.rs:1006-1023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) rust/lance-encoding/src/decoder.rs:1679 — rust/lance-encoding/src/decoder.rs:1679-1696 | rust/lance-encoding/src/decoder.rs:1926-1943 — both copies are in the same file, so extract the block into 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-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.
  • 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.
  • 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 8 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.
  • 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.
  • Duplicated block (18 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:4224 — rust/lance-index/src/scalar/inverted/wand.rs:4224-4241 | rust/lance-index/src/scalar/inverted/wand.rs:4342-4359 — both copies are in the same file, so extract the block into 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/scalar/inverted/wand_maxscore.rs:505 — rust/lance-index/src/scalar/inverted/wand_maxscore.rs:505-522 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:607-624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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.
  • Duplicated block (18 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:703 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:703-720 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:466-483 — 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.
  • Duplicated block (18 lines × 2) rust/lance/src/index/frag_reuse.rs:2076 — rust/lance/src/index/frag_reuse.rs:2076-2093 | rust/lance/src/index/frag_reuse.rs:2124-2141 — both copies are in the same file, so extract the block into 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/index/vector.rs:1674 — rust/lance/src/index/vector.rs:1674-1691 | rust/lance/src/index/vector.rs:1714-1731 — both copies are in the same file, so extract the block into 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/index/vector/ivf/v2.rs:470 — rust/lance/src/index/vector/ivf/v2.rs:470-487 | rust/lance/src/index/vector/ivf/v2.rs:2270-2287 — both copies are in the same file, so extract the 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 (5 lines × 3) · ×13
  • 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.
  • 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-file/src/versions/v2_1/writer.rs:82 — rust/lance-file/src/versions/v2_1/writer.rs:82-86 | rust/lance-file/src/versions/v2_2/writer.rs:82-86 | rust/lance-file/src/versions/v2_3/writer.rs:82-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 62 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (5 lines × 3) rust/lance-index/src/scalar/btree.rs:247 — rust/lance-index/src/scalar/btree.rs:247-251 | rust/lance-index/src/scalar/btree.rs:261-265 | rust/lance-index/src/scalar/btree.rs:275-279 — all 3 copies are in the same file, so extract the block into one function there and call 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-index/src/scalar/json.rs:798 — rust/lance-index/src/scalar/json.rs:798-802 | rust/lance-index/src/scalar/json.rs:819-823 | rust/lance-index/src/scalar/json.rs:840-844 — all 3 copies are in the same file, so extract the block into one function there and call 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-linalg/src/distance/cosine.rs:958 — rust/lance-linalg/src/distance/cosine.rs:958-962 | rust/lance-linalg/src/distance/cosine.rs:988-992 | rust/lance-linalg/src/distance/cosine.rs:1030-1034 — all 3 copies are in the same file, so extract the block into one function there and call 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-linalg/src/simd/dist_table.rs:210 — rust/lance-linalg/src/simd/dist_table.rs:210-214 | rust/lance-linalg/src/simd/dist_table.rs:438-442 | rust/lance-linalg/src/simd/dist_table.rs:476-480 — all 3 copies are in the same file, so extract the block into one function there and call 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/src/io/exec/fts.rs:3426 — rust/lance/src/io/exec/fts.rs:3426-3430 | rust/lance/src/io/exec/fts.rs:4773-4777 | rust/lance/src/io/exec/fts.rs:5666-5670 — all 3 copies are in the same file, so extract the block into one function there and call 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/src/io/exec/fts.rs:3425 — rust/lance/src/io/exec/fts.rs:3425-3429 | rust/lance/src/io/exec/fts.rs:3922-3926 | rust/lance/src/io/exec/fts.rs:5665-5669 — all 3 copies are in the same file, so extract the block into one function there and call 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) 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.
  • 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.
  • Duplicated block (5 lines × 3) rust/lance-linalg/src/simd/dist_table.rs:199 — rust/lance-linalg/src/simd/dist_table.rs:199-203 | rust/lance-linalg/src/simd/dist_table.rs:425-429 | rust/lance-linalg/src/simd/dist_table.rs:465-469 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D1 · Cyclomatic Complexity · lance_index · ×11
  • lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cyclomatic 124) rust/lance-index/src/vector/distributed/index_merger.rs:862 — lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner has cyclomatic complexity 124 (threshold 15). To reduce it, separate the cases: extract each independent 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 35) rust/lance-index/src/vector/graph.rs:578 — lance_index::vector::graph::beam_search_acorn 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::scalar::inverted::index::flat_search::tokenize_and_count (cyclomatic 24) rust/lance-index/src/scalar/inverted/index/flat_search.rs:240 — 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:2321 — 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:1743 — 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::cross_column::score_cross_column_sources (cyclomatic 18) rust/lance-index/src/scalar/inverted/cross_column.rs:1176 — 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::inverted::wand::exclusive_partial_score_limit (cyclomatic 17) rust/lance-index/src/scalar/inverted/wand.rs:1859 — lance_index::scalar::inverted::wand::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:723 — 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.
D2 · Cognitive Complexity · Wand · ×11
  • Wand::maxscore_search (cognitive 513) rust/lance-index/src/scalar/inverted/wand.rs:2975 — 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.rs:4122 — 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:424 — 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.rs:3961 — 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:2706 — 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.rs:3872 — 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.rs:3755 — 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:301 — 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:2870 — 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.rs:4462 — 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.rs:5641 — 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 338) rust/lance-table/src/transaction/manifest_build.rs:620 — Transaction::build_manifest_prepared has cognitive complexity 338 (threshold 15). Drivers by points: if/else 99 (218 pts), loops 29 (74 pts), boolean chains 30, match/switch 9 (16 pts) (nesting depth added 171). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Transaction::try_from (cognitive 39) rust/lance-table/src/transaction/proto.rs:87 — 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::withdraw_rewritten_coverage (cognitive 32) rust/lance-table/src/transaction/index_maintenance.rs:280 — Transaction::withdraw_rewritten_coverage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (6 pts), match/switch 1 (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.
  • Transaction::retain_relevant_indices (cognitive 31) rust/lance-table/src/transaction/index_maintenance.rs:565 — Transaction::retain_relevant_indices has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (11 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.
  • Transaction::prune_overlay_stale_fields_from_indices (cognitive 28) rust/lance-table/src/transaction/index_maintenance.rs:518 — 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 24) rust/lance-table/src/transaction/index_maintenance.rs:881 — Transaction::handle_rewrite_fragments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Transaction::handle_rewrite_indices (cognitive 22) rust/lance-table/src/transaction/index_maintenance.rs:751 — 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:266 — 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::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:29 — 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.
  • Transaction::prepare_indices (cognitive 16) rust/lance-table/src/transaction/manifest_build.rs:488 — Transaction::prepare_indices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×11
  • Duplicated block (25 lines × 2) java/lance-jni/src/blocking_dataset.rs:2416 — java/lance-jni/src/blocking_dataset.rs:2416-2440 | java/lance-jni/src/blocking_dataset.rs:3436-3460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) rust/lance-encoding/src/encodings/physical/fsst.rs:61 — rust/lance-encoding/src/encodings/physical/fsst.rs:61-85 | rust/lance-encoding/src/encodings/physical/fsst.rs:94-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) rust/lance-file/src/reader/structural.rs:30 — rust/lance-file/src/reader/structural.rs:30-54 | 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 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:520 — rust/lance-index/src/scalar/bloomfilter.rs:520-544 | rust/lance-index/src/scalar/zonemap.rs:823-847 — 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 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:3165 — rust/lance-index/src/scalar/inverted/wand.rs:3165-3189 | rust/lance-index/src/scalar/inverted/wand.rs:3459-3483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • Duplicated block (25 lines × 2) rust/lance/src/dataset/blob/prepared.rs:23 — rust/lance/src/dataset/blob/prepared.rs:23-47 | rust/lance/src/dataset/blob/write.rs:513-537 — 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:126 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:126-150 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:102-126 — 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 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) 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.
  • Duplicated block (25 lines × 2) java/src/main/java/org/lance/ipc/AsyncScanner.java:70 — java/src/main/java/org/lance/ipc/AsyncScanner.java:70-94 | java/src/main/java/org/lance/ipc/LanceScanner.java:66-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ 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:91` calls `isCollectStats` and `java/src/main/java/org/lance/ipc/AsyncScanner.java:95` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×11
  • 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:172-181 — 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/compression/fsst/src/fsst.rs:1043 — rust/compression/fsst/src/fsst.rs:1043-1052 | rust/compression/fsst/src/fsst.rs:1055-1063 — both copies are in the same file, so extract the block into 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–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.
  • Duplicated block (9–10 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:620 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:620-629 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:639-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) rust/lance-encoding/src/statistics.rs:258 — rust/lance-encoding/src/statistics.rs:258-266 | rust/lance-encoding/src/statistics.rs:271-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • 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.
  • Duplicated block (9–10 lines × 2) rust/lance/src/dataset.rs:1113 — rust/lance/src/dataset.rs:1113-1121 | 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.
  • Duplicated block (9–10 lines × 2) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1538 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1538-1546 | 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.
  • Duplicated block (9–10 lines × 2) rust/lance/src/dataset/refs.rs:438 — rust/lance/src/dataset/refs.rs:438-447 | rust/lance/src/dataset/refs.rs:540-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · Dataset · ×10
  • Dataset::scanner (cyclomatic 66) python/src/dataset.rs:1240 — Dataset::scanner has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dataset::create_index (cyclomatic 51) python/src/dataset.rs:2632 — 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::merge_existing_index_segments (cyclomatic 26) rust/lance/src/index.rs:2816 — 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::new (cyclomatic 23) python/src/dataset.rs:938 — Dataset::new 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.
  • Dataset::commit_existing_index_segments (cyclomatic 22) rust/lance/src/index.rs:3014 — Dataset::commit_existing_index_segments has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Dataset::open_vector_index_from_metadata_with_plan (cyclomatic 22) rust/lance/src/index.rs:4263 — Dataset::open_vector_index_from_metadata_with_plan 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.
  • Dataset::create_data_file (cyclomatic 21) rust/lance/src/dataset.rs:2382 — Dataset::create_data_file has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 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::filter_addr_or_ids (cyclomatic 20) rust/lance/src/dataset.rs:3051 — 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:1483 — 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:3163 — 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.
D1 · Cyclomatic Complexity · lance_encoding · ×10
  • 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::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::compression::create_fixed_width_block_decompressor_inner (cyclomatic 25) rust/lance-encoding/src/compression.rs:1645 — 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:268 — 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:328 — 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::logical::primitive::dict::dictionary_encode (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:289 — lance_encoding::encodings::logical::primitive::dict::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.
  • 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::binary::decode_generic_binary_miniblock (cyclomatic 17) rust/lance-encoding/src/encodings/physical/binary.rs:655 — lance_encoding::encodings::physical::binary::decode_generic_binary_miniblock 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_encoding::encodings::physical::alp::parse_header (cyclomatic 16) rust/lance-encoding/src/encodings/physical/alp.rs:1266 — 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.
D2 · Cognitive Complexity · TransactionRebase · ×10
  • TransactionRebase::check_create_index_txn (cognitive 129) rust/lance/src/io/commit/conflict_resolver.rs:1071 — TransactionRebase::check_create_index_txn has cognitive complexity 129 (threshold 15). Drivers by points: if/else 30 (89 pts), loops 5 (20 pts), boolean chains 18, match/switch 1 (2 pts) (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TransactionRebase::check_rewrite_txn (cognitive 119) rust/lance/src/io/commit/conflict_resolver.rs:1546 — 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.rs:812 — 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.rs:1936 — 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 50) rust/lance/src/io/commit/conflict_resolver.rs:2889 — TransactionRebase::finish_create_index has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 3 (9 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TransactionRebase::finish_rewrite (cognitive 47) rust/lance/src/io/commit/conflict_resolver.rs:3031 — 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.rs:2643 — 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.rs:706 — 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.rs:2119 — 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.rs:2524 — 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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×10
  • Members sharing a duplicated core (4 members, 50+ identical tokens) java/lance-jni/src/mem_wal.rs:764 — java/lance-jni/src/mem_wal.rs:764-792 | java/lance-jni/src/mem_wal.rs:884-930 | python/src/mem_wal.rs:747-770 | python/src/mem_wal.rs:820-864 — 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:337-348 — 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:372-398 — 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/distance/cosine.rs:1002 — rust/lance-linalg/src/distance/cosine.rs:1002-1039 | rust/lance-linalg/src/distance/dot.rs:622-655 | rust/lance-linalg/src/distance/l2.rs:841-879 | rust/lance-linalg/src/distance/norm_l2.rs:356-382 — 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/src/dataset/mem_wal/scanner/fts_search.rs:1242 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1242-1458 | 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:218 — rust/lance/src/dataset/refs.rs:218-232 | rust/lance/src/dataset/refs.rs:253-266 | rust/lance/src/dataset/refs.rs:268-295 | rust/lance/src/dataset/refs.rs:301-322 — 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) python/python/lance/dataset.py:4489 — python/python/lance/dataset.py:4489-4732 | python/python/lance/dataset.py:4769-4879 | python/python/lance/dataset.py:5748-5816 | python/python/lance/fragment.py:1280-1480 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×10
  • 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.
  • 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:1696 — rust/lance-index/src/scalar/inverted/builder.rs:1696-1703 | rust/lance-index/src/scalar/inverted/builder.rs:1760-1768 — both copies are in the same file, so extract the block into 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:1864 — rust/lance-index/src/scalar/inverted/builder.rs:1864-1872 | rust/lance-index/src/scalar/inverted/builder.rs:1877-1884 — both copies are in the same file, so extract the block into 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/wand.rs:4340 — rust/lance-index/src/scalar/inverted/wand.rs:4340-4348 | rust/lance-index/src/scalar/inverted/wand.rs:4370-4377 — both copies are in the same file, so extract the block into 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/rtree.rs:658 — rust/lance-index/src/scalar/rtree.rs:658-665 | rust/lance-index/src/scalar/rtree.rs:833-841 — both copies are in the same file, so extract the block into 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/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.
  • 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.
  • 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.
  • Duplicated block (8–9 lines × 2) rust/lance/src/index/vector/hamming.rs:499 — rust/lance/src/index/vector/hamming.rs:499-506 | rust/lance/src/index/vector/hamming.rs:615-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D6 · Cohesion (LCOM4) · Low cohesion · ×10
  • Low cohesion: ShardWriterConfig (LCOM4 19) rust/lance/src/dataset/mem_wal/write.rs:72 — 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: Dataset (LCOM4 18) rust/lance/src/dataset.rs:238 — Dataset's methods fall into 18 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 18 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FilteredReadOptions (LCOM4 10) rust/lance/src/io/exec/filtered_read.rs:1883 — 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:350 — 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 4) rust/lance/src/dataset/cleanup.rs:457 — CleanupOperation'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: FtsQuery (LCOM4 4) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:99 — 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.
D1 · Cyclomatic Complexity · TransactionRebase · ×9
  • TransactionRebase::check_create_index_txn (cyclomatic 59) rust/lance/src/io/commit/conflict_resolver.rs:1071 — TransactionRebase::check_create_index_txn has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TransactionRebase::check_update_txn (cyclomatic 42) rust/lance/src/io/commit/conflict_resolver.rs:812 — 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.rs:1546 — 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.rs:1936 — 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::check_txn (cyclomatic 29) rust/lance/src/io/commit/conflict_resolver.rs:637 — TransactionRebase::check_txn 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.
  • TransactionRebase::finish_create_index (cyclomatic 21) rust/lance/src/io/commit/conflict_resolver.rs:2889 — TransactionRebase::finish_create_index 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.
  • TransactionRebase::finish_rewrite (cyclomatic 20) rust/lance/src/io/commit/conflict_resolver.rs:3031 — 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.rs:706 — 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.rs:2119 — 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 · PrimitiveStructuralEncoder · ×9
  • PrimitiveStructuralEncoder::encode_dense_page (cognitive 40) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1957 — 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::is_constant_values (cognitive 37) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:874 — 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::sample_unique_ratio (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1739 — PrimitiveStructuralEncoder::sample_unique_ratio has cognitive complexity 35 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 5 (11 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • PrimitiveStructuralEncoder::serialize_miniblocks (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:429 — 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:594 — 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:1604 — 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:1299 — 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:1222 — 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:1532 — 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 · Duplicated block (17 lines × 2) · ×9
  • 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.
  • 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.
  • 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.
  • Duplicated block (17 lines × 2) rust/lance-io/src/object_store/providers/azure.rs:282 — rust/lance-io/src/object_store/providers/azure.rs:282-298 | rust/lance-io/src/object_store/providers/gcp.rs:326-342 — 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 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:219 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:219-235 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:136-152 — 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 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:113 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:113-129 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:148-164 — 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 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/lance/src/dataset/scanner.rs:8152 — rust/lance/src/dataset/scanner.rs:8152-8168 | rust/lance/src/dataset/scanner.rs:8218-8234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) rust/lance/src/io/exec/fts.rs:3119 — rust/lance/src/io/exec/fts.rs:3119-3135 | rust/lance/src/io/exec/fts.rs:3183-3199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) rust/lance/src/io/exec/fts.rs:5401 — rust/lance/src/io/exec/fts.rs:5401-5417 | rust/lance/src/io/exec/fts.rs:5457-5473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · lance_jni · ×8
  • lance_jni::transaction::convert_to_rust_operation (cognitive 46) java/lance-jni/src/transaction.rs:1740 — 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 34) java/lance-jni/src/blocking_scanner.rs:352 — lance_jni::blocking_scanner::build_scanner_with_options has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25 (29 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:188 — 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 26) java/lance-jni/src/transaction.rs:880 — lance_jni::transaction::convert_to_java_operation_inner has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 8 (15 pts), loops 2 (6 pts), if/else 3 (5 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • 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:2312 — 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:1332 — 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::get_vector_index_params (cognitive 16) java/lance-jni/src/utils.rs:354 — 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×8
  • Duplicated block (21 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:432 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:432-452 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:493-513 — 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.
  • Duplicated block (21 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:465 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:465-485 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:526-546 — 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.
  • Duplicated block (21 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:516 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:516-536 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:610-630 — 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.
  • Duplicated block (21 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:549 — rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:549-569 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:577-597 — 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.
  • Duplicated block (21 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:320 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:320-340 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:390-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) rust/lance-io/src/object_store/providers/oss.rs:68 — rust/lance-io/src/object_store/providers/oss.rs:68-88 | rust/lance-io/src/object_store/providers/tos.rs:74-94 — 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.
  • Duplicated block (21 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:88 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:88-108 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:123-143 — 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 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) rust/lance/src/io/commit.rs:672 — rust/lance/src/io/commit.rs:672-692 | rust/lance/src/io/commit.rs:711-731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×8
  • Duplicated block (20 lines × 2) rust/lance-encoding/src/decoder.rs:1691 — rust/lance-encoding/src/decoder.rs:1691-1710 | rust/lance-encoding/src/decoder.rs:2156-2175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1327 — rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1327-1346 | rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1349-1368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) rust/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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:1400 — rust/lance-index/src/scalar/inverted/wand.rs:1400-1419 | rust/lance-index/src/scalar/inverted/wand.rs:1458-1477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) rust/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.
  • Duplicated block (20 lines × 2) rust/lance-io/src/object_store/providers/azure.rs:255 — rust/lance-io/src/object_store/providers/azure.rs:255-274 | rust/lance-io/src/object_store/providers/gcp.rs:299-318 — 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 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 2) rust/lance/src/index/vector.rs:1374 — rust/lance/src/index/vector.rs:1374-1393 | rust/lance/src/index/vector.rs:1431-1450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) rust/lance/src/index/vector/ivf.rs:3166 — rust/lance/src/index/vector/ivf.rs:3166-3185 | rust/lance/src/index/vector/ivf.rs:3222-3241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · Wand · ×7
  • Wand::and_bulk_search (cyclomatic 139) rust/lance-index/src/scalar/inverted/wand.rs:4122 — 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.rs:2975 — 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:424 — 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:2706 — 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.rs:3961 — 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.rs:3755 — 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.rs:3872 — 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 · 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:1263 — 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 45) rust/lance-namespace-impls/src/dir/namespace.rs:2114 — DirectoryNamespace::query_table has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 8, match/switch 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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:55 — 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::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.
  • DirectoryNamespace::build_index_params (cognitive 18) rust/lance-namespace-impls/src/dir/index_params.rs:90 — DirectoryNamespace::build_index_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 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 · lance_file · ×7
  • lance_file::concat::validate_blob_field (cognitive 39) rust/lance-file/src/concat.rs:380 — 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:2349 — 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:910 — 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:699 — 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
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.
  • 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.
  • Duplicated block (12 lines × 3) rust/lance-index/src/scalar/inverted/tokenizer.rs:347 — rust/lance-index/src/scalar/inverted/tokenizer.rs:347-358 | rust/lance-index/src/scalar/inverted/tokenizer.rs:368-379 | rust/lance-index/src/scalar/inverted/tokenizer.rs:383-394 — all 3 copies are in the same file, so extract the block into one function there and call 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.
  • 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:34-45 — 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 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) rust/lance-file/src/reader/structural.rs:248 — rust/lance-file/src/reader/structural.rs:248-259 | 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 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) java/src/main/java/org/lance/Dataset.java:873 — java/src/main/java/org/lance/Dataset.java:873-884 | java/src/main/java/org/lance/Dataset.java:902-913 | java/src/main/java/org/lance/Dataset.java:952-963 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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:873` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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.
  • Duplicated block (8 lines × 3) rust/lance-index/src/scalar/inverted/index/partition.rs:1132 — rust/lance-index/src/scalar/inverted/index/partition.rs:1132-1139 | rust/lance-index/src/scalar/inverted/index/partition.rs:1198-1205 | rust/lance-index/src/scalar/inverted/index/partition.rs:1260-1267 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) rust/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.
  • Duplicated block (8 lines × 3) rust/lance/src/dataset/optimize.rs:2959 — rust/lance/src/dataset/optimize.rs:2959-2966 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1230-1237 | rust/lance/src/dataset/write/update.rs:422-429 — 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 (8 lines × 3) rust/lance/src/io/exec/fts.rs:3119 — rust/lance/src/io/exec/fts.rs:3119-3126 | rust/lance/src/io/exec/fts.rs:3183-3190 | rust/lance/src/io/exec/fts.rs:3227-3234 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) python/src/dataset/optimize.rs:201 — python/src/dataset/optimize.rs:201-208 | python/src/fragment.rs:761-768 | python/src/fragment.rs:813-820 — 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:1057 — rust/lance/src/dataset.rs:1057-1064 | rust/lance/src/dataset.rs:1117-1124 | 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×7
  • 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 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/src/io/commit/conflict_resolver.rs:725 — rust/lance/src/io/commit/conflict_resolver.rs:725-731 | rust/lance/src/io/commit/conflict_resolver.rs:975-981 | rust/lance/src/io/commit/conflict_resolver.rs:1654-1660 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) rust/lance-index/src/scalar/btree.rs:2583 — rust/lance-index/src/scalar/btree.rs:2583-2589 | rust/lance-index/src/scalar/rtree.rs:530-536 | rust/lance/src/index/scalar/rtree.rs:16-22 — 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/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:2757 — rust/lance-index/src/scalar/bitmap.rs:2757-2763 | rust/lance-index/src/scalar/btree.rs:4101-4107 | rust/lance-index/src/scalar/label_list.rs:1198-1204 — 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.
  • 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.
  • Duplicated block (7 lines × 3) rust/lance/src/dataset/index/frag_reuse.rs:603 — rust/lance/src/dataset/index/frag_reuse.rs:603-609 | rust/lance/src/index/frag_reuse.rs:2012-2018 | rust/lance/src/index/frag_reuse.rs:2056-2062 — 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 4 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×7
  • Duplicated block (6 lines × 3) rust/lance-index/src/scalar/rtree.rs:659 — rust/lance-index/src/scalar/rtree.rs:659-664 | rust/lance-index/src/scalar/rtree.rs:834-839 | rust/lance-index/src/scalar/rtree.rs:1218-1223 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) rust/lance-io/src/lib.rs:232 — rust/lance-io/src/lib.rs:232-237 | rust/lance-io/src/lib.rs:287-292 | rust/lance-table/src/rowids.rs:1098-1103 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (6 lines × 3) rust/lance/src/io/exec/fts.rs:4925 — rust/lance/src/io/exec/fts.rs:4925-4931 | rust/lance/src/io/exec/fts.rs:5301-5307 | rust/lance/src/io/exec/rowids.rs:222-227 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (6 lines × 3) rust/lance-file/src/reader/structural.rs:207 — rust/lance-file/src/reader/structural.rs:207-212 | 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 62 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-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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×6
  • Duplicated block (22 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:515 — rust/lance-encoding/src/encodings/physical/alp.rs:515-536 | rust/lance-encoding/src/encodings/physical/alp.rs:584-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.
  • Duplicated block (22 lines × 2) rust/lance-encoding/src/encodings/physical/fsst.rs:335 — rust/lance-encoding/src/encodings/physical/fsst.rs:335-356 | rust/lance-encoding/src/encodings/physical/fsst.rs:359-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.
  • 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.
  • 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 8 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.
  • Duplicated block (22 lines × 2) rust/lance-io/src/uring/current_thread.rs:308 — rust/lance-io/src/uring/current_thread.rs:308-329 | rust/lance-io/src/uring/reader.rs:159-180 — 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 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.
  • Duplicated block (22 lines × 2) rust/lance/src/io/exec/fts.rs:382 — rust/lance/src/io/exec/fts.rs:382-403 | rust/lance/src/io/exec/fts.rs:453-474 — both copies are in the same file, so extract the 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 (14 lines × 3) · ×6
  • Duplicated block (14 lines × 3) rust/lance-file/src/versions/v1/writer/statistics.rs:266 — rust/lance-file/src/versions/v1/writer/statistics.rs:266-279 | rust/lance-file/src/versions/v1/writer/statistics.rs:343-356 | rust/lance-file/src/versions/v1/writer/statistics.rs:417-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.
  • 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:376-389 — `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 8 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.
  • Duplicated block (14 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:3067 — rust/lance-namespace-impls/src/dir/manifest.rs:3067-3080 | rust/lance-namespace-impls/src/dir/manifest.rs:3283-3296 | rust/lance-namespace-impls/src/dir/manifest.rs:3777-3790 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) rust/lance/src/dataset/write/delete.rs:58 — rust/lance/src/dataset/write/delete.rs:58-71 | rust/lance/src/dataset/write/merge_insert.rs:3479-3492 | rust/lance/src/dataset/write/merge_insert/exec.rs:88-101 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 3) rust/lance/src/dataset/write/delete.rs:77 — rust/lance/src/dataset/write/delete.rs:77-90 | rust/lance/src/dataset/write/merge_insert.rs:3498-3511 | rust/lance/src/dataset/write/merge_insert/exec.rs:107-120 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • 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.
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.19, instability 0.11, distance 0.71 — 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.18, distance 0.70 — zone of pain — concrete and depended on by 9 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 · pylance · ×5
  • pylance::dataset::prepare_vector_index_params (cyclomatic 38) python/src/dataset.rs:5221 — pylance::dataset::prepare_vector_index_params has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • pylance::dataset::get_write_params (cyclomatic 32) python/src/dataset.rs:5011 — pylance::dataset::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::vector_query_params_from_dict (cyclomatic 21) python/src/dataset.rs:5791 — pylance::dataset::vector_query_params_from_dict 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.
  • pylance::dataset::optimize::parse_compaction_options (cyclomatic 20) python/src/dataset/optimize.rs:26 — pylance::dataset::optimize::parse_compaction_options has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • pylance::dataset::writer_config_from_kwargs (cyclomatic 17) python/src/dataset.rs:213 — 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 34) rust/lance-namespace-impls/src/dir/namespace.rs:2114 — DirectoryNamespace::query_table 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.
  • DirectoryNamespace::build_index_params (cyclomatic 26) rust/lance-namespace-impls/src/dir/index_params.rs:90 — DirectoryNamespace::build_index_params 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.
  • DirectoryNamespace::alter_transaction (cyclomatic 25) rust/lance-namespace-impls/src/dir/namespace.rs:1263 — 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:55 — 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 · lance_jni · ×5
  • lance_jni::transaction::convert_to_rust_operation (cyclomatic 33) java/lance-jni/src/transaction.rs:1740 — 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::blocking_scanner::build_scanner_with_options (cyclomatic 32) java/lance-jni/src/blocking_scanner.rs:352 — lance_jni::blocking_scanner::build_scanner_with_options 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.
  • lance_jni::transaction::convert_to_java_operation_inner (cyclomatic 28) java/lance-jni/src/transaction.rs:880 — lance_jni::transaction::convert_to_java_operation_inner has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • lance_jni::index::determine_index_type (cyclomatic 20) java/lance-jni/src/index.rs:188 — 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::transaction::inner_commit_to_uri (cyclomatic 16) java/lance-jni/src/transaction.rs:2312 — 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 · PrimitiveStructuralEncoder · ×5
  • PrimitiveStructuralEncoder::encode_dense_page (cyclomatic 32) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1957 — 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 22) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1739 — PrimitiveStructuralEncoder::sample_unique_ratio 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.
  • PrimitiveStructuralEncoder::should_dictionary_encode (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/structural_encoder.rs:1604 — 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:429 — 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:874 — 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.
D1 · Cyclomatic Complexity · lance_table · ×5
  • 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 18) rust/lance-table/src/format/key_existence.rs:311 — lance_table::format::key_existence::extract_key_value 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.
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:1710 — // 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:2391 — // 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:1482 — # 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::get_write_params (cognitive 61) python/src/dataset.rs:5011 — pylance::dataset::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:5221 — 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::dataset::vector_query_params_from_dict (cognitive 33) python/src/dataset.rs:5791 — pylance::dataset::vector_query_params_from_dict has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 5 (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.
  • pylance::dataset::writer_config_from_kwargs (cognitive 20) python/src/dataset.rs:213 — 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:106 — 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 · IvfIndexBuilder · ×5
  • IvfIndexBuilder::merge_partitions (cognitive 49) rust/lance/src/index/vector/builder.rs:1762 — IvfIndexBuilder::merge_partitions has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 3 (7 pts), boolean chains 2, match/switch 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.
  • IvfIndexBuilder::build_partitions (cognitive 37) rust/lance/src/index/vector/builder.rs:1159 — IvfIndexBuilder::build_partitions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 4, loops 1 (3 pts), match/switch 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.
  • IvfIndexBuilder::take_partition_batches (cognitive 32) rust/lance/src/index/vector/builder.rs:1654 — IvfIndexBuilder::take_partition_batches has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 5 (12 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.
  • IvfIndexBuilder::join_partitions_impl (cognitive 32) rust/lance/src/index/vector/builder.rs:2704 — IvfIndexBuilder::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.
  • IvfIndexBuilder::build_fresh_partitions_windowed (cognitive 19) rust/lance/src/index/vector/builder.rs:1428 — IvfIndexBuilder::build_fresh_partitions_windowed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lance_datafusion · ×5
  • lance_datafusion::substrait::normalize_expr (cognitive 49) rust/lance-datafusion/src/substrait.rs:384 — lance_datafusion::substrait::normalize_expr has cognitive complexity 49 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 8 (17 pts), match/switch 5 (12 pts) (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • lance_datafusion::signed_zero::rewrite_node (cognitive 32) rust/lance-datafusion/src/signed_zero.rs:630 — 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::lower (cognitive 18) rust/lance-datafusion/src/numeric_coercion.rs:71 — lance_datafusion::numeric_coercion::lower has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • lance_datafusion::substrait::parse_groupings (cognitive 16) rust/lance-datafusion/src/substrait.rs:709 — 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.
D2 · Cognitive Complexity · PostingIterator · ×5
  • PostingIterator::merge_optional_freqs (cognitive 45) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:112 — 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.rs:1223 — 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.rs:1676 — 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:218 — 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.rs:1423 — 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.
D2 · Cognitive Complexity · MergeInsertJob · ×5
  • MergeInsertJob::update_fragments (cognitive 42) rust/lance/src/dataset/write/merge_insert.rs:1904 — MergeInsertJob::update_fragments has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (47 pts), loops 13 (33 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 51). To reduce it, split the body into named stages: move each independent 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::execute_uncommitted_impl (cognitive 40) rust/lance/src/dataset/write/merge_insert.rs:3154 — MergeInsertJob::execute_uncommitted_impl has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 3 (9 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.
  • MergeInsertJob::update_fragments::handle_fragment (cognitive 31) rust/lance/src/dataset/write/merge_insert.rs:2010 — MergeInsertJob::update_fragments::handle_fragment has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (17 pts), if/else 9 (13 pts), boolean chains 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. 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 20) rust/lance/src/dataset/write/merge_insert.rs:1578 — MergeInsertJob::create_indexed_scan_joined_stream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 1 (3 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.
  • MergeInsertJob::can_use_create_plan (cognitive 18) rust/lance/src/dataset/write/merge_insert.rs:3024 — 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 · Duplicated block (24 lines × 2) · ×5
  • Duplicated block (24 lines × 2) java/lance-jni/src/lib.rs:107 — java/lance-jni/src/lib.rs:107-130 | python/src/lib.rs:202-225 — 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 (24 lines × 2) java/lance-jni/src/transaction.rs:1349 — java/lance-jni/src/transaction.rs:1349-1372 | java/lance-jni/src/transaction.rs:2333-2356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (24 lines × 2) rust/lance-index/src/vector/graph.rs:404 — rust/lance-index/src/vector/graph.rs:404-427 | rust/lance-index/src/vector/graph.rs:488-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (24 lines × 2) rust/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.
  • Duplicated block (24 lines × 2) rust/lance/src/dataset/mem_wal/memtable/flush.rs:290 — rust/lance/src/dataset/mem_wal/memtable/flush.rs:290-313 | rust/lance/src/dataset/mem_wal/memtable/flush.rs:568-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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) rust/lance-file/src/reader/structural.rs:124 — rust/lance-file/src/reader/structural.rs:124-142 | rust/lance-file/src/versions/v2_0/reader.rs:104-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 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 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.
  • Duplicated block (19 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:342 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:342-360 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:412-430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) rust/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.
  • Duplicated block (19 lines × 2) rust/lance/src/index/vector.rs:2025 — rust/lance/src/index/vector.rs:2025-2043 | rust/lance/src/index/vector.rs:2064-2082 — both copies are in the same file, so extract the 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–19 lines × 2) · ×5
  • 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18–19 lines × 2) rust/lance/src/dataset/mem_wal/scanner/planner.rs:473 — rust/lance/src/dataset/mem_wal/scanner/planner.rs:473-490 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:763-781 — 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 3 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 (18–19 lines × 2) rust/lance/src/dataset/scanner.rs:6029 — rust/lance/src/dataset/scanner.rs:6029-6046 | rust/lance/src/dataset/scanner.rs:6340-6358 — both copies are in the same file, so extract the block into 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–19 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/write.rs:1227 — rust/lance/src/dataset/write/merge_insert/exec/write.rs:1227-1245 | rust/lance/src/dataset/write/update.rs:420-437 — 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 (18–19 lines × 2) rust/lance/src/io/exec/fts.rs:3380 — rust/lance/src/io/exec/fts.rs:3380-3398 | rust/lance/src/io/exec/fts.rs:5622-5639 — both copies are in the same file, so extract the 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 (14–15 lines × 2) · ×5
  • Duplicated block (14–15 lines × 2) rust/lance-jsonb/src/core/de.rs:375 — rust/lance-jsonb/src/core/de.rs:375-389 | rust/lance-jsonb/src/core/de.rs:591-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.
  • 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.
  • 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.rs:3362 — rust/lance/src/io/exec/fts.rs:3362-3376 | rust/lance/src/io/exec/fts.rs:5606-5619 — both copies are in the same file, so extract the block into 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) java/src/main/java/org/lance/WriteDatasetBuilder.java:491 — java/src/main/java/org/lance/WriteDatasetBuilder.java:491-505 | java/src/main/java/org/lance/WriteDatasetBuilder.java:530-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 `java/src/main/java/org/lance/WriteDatasetBuilder.java:491` it begins part-way through the construct above it, so those exact lines cannot be lifted 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) · ×5
  • Duplicated block (13–14 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:395 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:395-408 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:419-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) rust/lance/src/dataset/index/frag_reuse.rs:147 — rust/lance/src/dataset/index/frag_reuse.rs:147-160 | rust/lance/src/dataset/index/frag_reuse.rs:720-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) rust/lance/src/dataset/write.rs:2289 — rust/lance/src/dataset/write.rs:2289-2301 | rust/lance/src/dataset/write.rs:2348-2361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) rust/lance/src/index/vector.rs:2010 — rust/lance/src/index/vector.rs:2010-2022 | rust/lance/src/index/vector.rs:2046-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 (13–14 lines × 2) rust/lance/src/io/exec/fts.rs:3426 — rust/lance/src/io/exec/fts.rs:3426-3439 | rust/lance/src/io/exec/fts.rs:5666-5678 — both copies are in the same file, so extract the 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–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:545 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:545-557 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:568-579 — both copies are in the same file, so extract the block into 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–13 lines × 2) rust/lance-encoding/src/encodings/physical/binary.rs:894 — rust/lance-encoding/src/encodings/physical/binary.rs:894-905 | rust/lance-encoding/src/encodings/physical/binary.rs:924-936 — both copies are in the same file, so extract the block into 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–13 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:1697 — rust/lance-index/src/scalar/inverted/wand.rs:1697-1709 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:230-241 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12–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.
  • Duplicated block (12–13 lines × 2) rust/lance/src/index/frag_reuse.rs:1058 — rust/lance/src/index/frag_reuse.rs:1058-1069 | rust/lance/src/index/frag_reuse.rs:2360-2372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×5
  • Duplicated block (11–12 lines × 2) python/src/dataset.rs:1488 — python/src/dataset.rs:1488-1499 | python/src/fragment.rs:368-378 — 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 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11–12 lines × 2) rust/lance-encoding/src/encodings/physical/alp/restore.rs:472 — rust/lance-encoding/src/encodings/physical/alp/restore.rs:472-483 | rust/lance-encoding/src/encodings/physical/alp/restore.rs:493-503 — both copies are in the same file, so extract the block into 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-index/src/vector/bq/storage.rs:2124 — rust/lance-index/src/vector/bq/storage.rs:2124-2134 | rust/lance-index/src/vector/storage.rs:245-256 — 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 (11–12 lines × 2) rust/lance/src/dataset/hash_joiner.rs:153 — rust/lance/src/dataset/hash_joiner.rs:153-164 | rust/lance/src/dataset/hash_joiner.rs:240-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.
  • Duplicated block (11–12 lines × 2) rust/lance/src/index/scalar/btree.rs:136 — rust/lance/src/index/scalar/btree.rs:136-146 | rust/lance/src/index/scalar/ngram.rs:52-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
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.
  • Duplicated block (9 lines × 3) rust/lance-io/src/object_store/providers/oss.rs:143 — rust/lance-io/src/object_store/providers/oss.rs:143-151 | rust/lance-io/src/object_store/providers/tencent.rs:99-107 | rust/lance-io/src/object_store/providers/tos.rs:149-157 — 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.
  • Duplicated block (9 lines × 3) rust/lance-linalg/src/distance/dot.rs:504 — rust/lance-linalg/src/distance/dot.rs:504-512 | rust/lance-linalg/src/distance/l2.rs:708-716 | rust/lance-linalg/src/distance/norm_l2.rs:291-299 — before extracting anything, compare `rust/lance-linalg/src/distance/dot.rs` and `rust/lance-linalg/src/distance/l2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) rust/lance/src/index/vector/ivf.rs:1164 — rust/lance/src/index/vector/ivf.rs:1164-1172 | rust/lance/src/index/vector/ivf.rs:2491-2499 | rust/lance/src/index/vector/ivf.rs:2560-2568 — all 3 copies are in the same file, so extract the block into one function there and call 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) 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×5
  • Duplicated block (7 lines × 4) java/lance-jni/src/mem_wal.rs:772 — java/lance-jni/src/mem_wal.rs:772-780 | java/lance-jni/src/mem_wal.rs:895-901 | python/src/mem_wal.rs:753-760 | python/src/mem_wal.rs:826-832 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • 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.
  • 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.
  • Duplicated block (7 lines × 4) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:290 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:290-296 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:725-731 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scalar_index.rs:501-507 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:351-359 — 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 3 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. If that is what happened, the fix is to keep one copy and have the 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.
D1 · Cyclomatic Complexity · CleanupTask · ×4
  • CleanupTask::cleanup_file_if_not_referenced (cyclomatic 48) rust/lance/src/dataset/cleanup.rs:1410 — 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 33) rust/lance/src/dataset/cleanup.rs:1083 — CleanupTask::delete_unreferenced_files 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.
  • CleanupTask::process_branch_referenced_manifests (cyclomatic 26) rust/lance/src/dataset/cleanup.rs:1977 — CleanupTask::process_branch_referenced_manifests 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.
  • CleanupTask::process_manifest_file (cyclomatic 16) rust/lance/src/dataset/cleanup.rs:815 — CleanupTask::process_manifest_file 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 · FileFragment · ×4
  • FileFragment::scanner (cyclomatic 26) python/src/fragment.rs:268 — FileFragment::scanner 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.
  • FileFragment::validate (cyclomatic 24) rust/lance/src/dataset/fragment.rs:1955 — 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::update_columns_with_offsets (cyclomatic 21) rust/lance/src/dataset/fragment.rs:2596 — FileFragment::update_columns_with_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.
  • FileFragment::open (cyclomatic 17) rust/lance/src/dataset/fragment.rs:1247 — 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.
D2 · Cognitive Complexity · CleanupTask · ×4
  • CleanupTask::cleanup_file_if_not_referenced (cognitive 78) rust/lance/src/dataset/cleanup.rs:1410 — 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 57) rust/lance/src/dataset/cleanup.rs:1083 — CleanupTask::delete_unreferenced_files has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (38 pts), loops 3 (7 pts), boolean chains 6, match/switch 3 (6 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CleanupTask::process_branch_referenced_manifests (cognitive 54) rust/lance/src/dataset/cleanup.rs:1977 — CleanupTask::process_branch_referenced_manifests has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 6 (9 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • CleanupTask::process_manifest_file (cognitive 20) rust/lance/src/dataset/cleanup.rs:815 — CleanupTask::process_manifest_file has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FtsMemIndex · ×4
  • FtsMemIndex::to_index_builder (cognitive 61) rust/lance/src/dataset/mem_wal/index/fts.rs:2944 — 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:2702 — 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:2302 — 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:1877 — 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:54 — 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:126 — 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:447 — 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 · FileFragment · ×4
  • FileFragment::validate (cognitive 38) rust/lance/src/dataset/fragment.rs:1955 — 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::update_columns_with_offsets (cognitive 37) rust/lance/src/dataset/fragment.rs:2596 — FileFragment::update_columns_with_offsets has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FileFragment::scanner (cognitive 31) python/src/fragment.rs:268 — FileFragment::scanner has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (27 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:1247 — 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.
D2 · Cognitive Complexity · ManifestNamespace · ×4
  • ManifestNamespace::rewrite_manifest (cognitive 37) rust/lance-namespace-impls/src/dir/manifest.rs:1995 — ManifestNamespace::rewrite_manifest has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 4 (10 pts), loops 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.
  • ManifestNamespace::describe_table (cognitive 24) rust/lance-namespace-impls/src/dir/manifest.rs:2913 — 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::create_table (cognitive 24) rust/lance-namespace-impls/src/dir/manifest.rs:3061 — ManifestNamespace::create_table has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, 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::list_tables (cognitive 17) rust/lance-namespace-impls/src/dir/manifest.rs:2827 — ManifestNamespace::list_tables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 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 · 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 · Duplicated block (11 lines × 3) · ×4
  • Duplicated block (11 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:2593 — rust/lance-namespace-impls/src/dir/manifest.rs:2593-2603 | rust/lance-namespace-impls/src/dir/manifest.rs:2629-2639 | rust/lance-namespace-impls/src/dir/manifest.rs:2740-2752 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:132 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:132-142 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:142-152 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:108-118 — 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 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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.rs:1561 — rust/lance/src/io/exec/fts.rs:1561-1571 | rust/lance/src/io/exec/fts.rs:2114-2125 | rust/lance/src/io/exec/minhash.rs:183-193 — 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 × 3) · ×4
  • Duplicated block (10 lines × 3) rust/lance-encoding/src/decoder.rs:911 — rust/lance-encoding/src/decoder.rs:911-923 | rust/lance-encoding/src/decoder.rs:928-940 | rust/lance-encoding/src/decoder.rs:952-961 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) rust/lance-file/src/reader.rs:1356 — rust/lance-file/src/reader.rs:1356-1365 | rust/lance-file/src/reader.rs:1396-1405 | rust/lance-file/src/reader.rs:1436-1445 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) rust/lance-index/src/scalar/bitmap.rs:2706 — rust/lance-index/src/scalar/bitmap.rs:2706-2715 | rust/lance-index/src/scalar/btree.rs:4047-4056 | rust/lance-index/src/scalar/label_list.rs:1146-1155 — 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.
  • Duplicated block (10 lines × 3) rust/lance-index/src/vector/pq/storage.rs:427 — rust/lance-index/src/vector/pq/storage.rs:427-436 | rust/lance-index/src/vector/quantizer.rs:385-394 | rust/lance-index/src/vector/sq/storage.rs:232-241 — 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.
D1 · Cyclomatic Complexity · Transaction · ×3
  • Transaction::build_manifest_prepared (cyclomatic 180) rust/lance-table/src/transaction/manifest_build.rs:620 — Transaction::build_manifest_prepared has cyclomatic complexity 180 (threshold 15). To reduce it, separate the cases: extract each independent 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 34) rust/lance-table/src/transaction/proto.rs:87 — Transaction::try_from 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.
  • Transaction::withdraw_rewritten_coverage (cyclomatic 16) rust/lance-table/src/transaction/index_maintenance.rs:280 — Transaction::withdraw_rewritten_coverage 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 · MergeInsertJob · ×3
  • MergeInsertJob::update_fragments (cyclomatic 39) rust/lance/src/dataset/write/merge_insert.rs:1904 — MergeInsertJob::update_fragments has cyclomatic complexity 39 (threshold 15). Of this number, 23 points are the body's own statements and 16 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • MergeInsertJob::execute_uncommitted_impl (cyclomatic 19) rust/lance/src/dataset/write/merge_insert.rs:3154 — MergeInsertJob::execute_uncommitted_impl 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.
  • MergeInsertJob::can_use_create_plan (cyclomatic 17) rust/lance/src/dataset/write/merge_insert.rs:3024 — 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.
D1 · Cyclomatic Complexity · lance_datafusion · ×3
  • lance_datafusion::substrait::normalize_expr (cyclomatic 31) rust/lance-datafusion/src/substrait.rs:384 — lance_datafusion::substrait::normalize_expr has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • lance_datafusion::signed_zero::rewrite_node (cyclomatic 24) rust/lance-datafusion/src/signed_zero.rs:630 — 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::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.
D1 · Cyclomatic Complexity · lance_io · ×3
  • lance_io::local::remove_empty_dirs (cyclomatic 28) rust/lance-io/src/local.rs:54 — 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:789 — 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 · 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 · IVFIndex · ×3
  • IVFIndex::search_partitions (cognitive 74) rust/lance/src/index/vector/ivf/v2.rs:2882 — IVFIndex::search_partitions has cognitive complexity 74 (threshold 15). Drivers by points: if/else 17 (41 pts), loops 7 (15 pts), match/switch 4 (12 pts), boolean chains 6 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • IVFIndex::prewarm_partition_window (cognitive 26) rust/lance/src/index/vector/ivf/v2.rs:2334 — IVFIndex::prewarm_partition_window has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (7 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.
  • IVFIndex::search_partitions_batch (cognitive 16) rust/lance/src/index/vector/ivf/v2.rs:3229 — IVFIndex::search_partitions_batch has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 5 (6 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · 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:4773 — 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:4510 — 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:4841 — 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 · SerializerContext · ×3
  • SerializerContext::record_offsets (cognitive 35) rust/lance-encoding/src/repdef.rs:714 — SerializerContext::record_offsets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 6 (16 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:958 — 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.
  • SerializerContext::multiply_levels (cognitive 26) rust/lance-encoding/src/repdef.rs:871 — SerializerContext::multiply_levels has cognitive complexity 26 (threshold 15). Drivers by points: loops 8 (21 pts), if/else 4, boolean chains 1 (nesting depth added 13). 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 · LsmFtsSearchPlanner · ×3
  • LsmFtsSearchPlanner::build_source_plan (cognitive 33) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1231 — 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:913 — 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:1097 — 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 · MinHashLshIndex · ×3
  • MinHashLshIndex::refine (cognitive 31) rust/lance-index/src/scalar/minhash_lsh/index.rs:672 — 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:775 — 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.
  • MinHashLshIndex::next_candidate (cognitive 21) rust/lance-index/src/scalar/minhash_lsh/index.rs:519 — MinHashLshIndex::next_candidate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:359 — 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:467 — 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:312 — 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:857 — 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:989 — 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:1195 — 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 · 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:138 — TooManyFields — 97 stored fields. The bar is 30 stored fields; this is 67 over it, 3.23× 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:1139 — TooManyFields — 41 stored fields beside 170 methods. The bar is 30 stored fields; this is 11 over it, 1.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: Wand rust/lance-index/src/scalar/inverted/wand.rs:2422 — TooManyFields — 31 stored fields beside 55 methods. The bar is 30 stored fields; this is 1 over it, 1.03× 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.
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: binary.rs → encoder.rs, fixed_size_list.rs, list.rs rust/lance-encoding/src/array_encoding/logical/binary.rs — `rust/lance-encoding/src/array_encoding/logical/binary.rs` changes together with 3 other files — `rust/lance-encoding/src/encoder.rs`, `rust/lance-encoding/src/encodings/logical/fixed_size_list.rs`, `rust/lance-encoding/src/encodings/logical/list.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) rust/lance-namespace-impls/src/dir/manifest.rs:2213 — rust/lance-namespace-impls/src/dir/manifest.rs:2213-2281 | rust/lance-namespace-impls/src/dir/manifest.rs:2386-2414 | rust/lance-namespace-impls/src/dir/manifest.rs:2517-2583 | rust/lance-namespace-impls/src/dir/manifest.rs:2827-2911 | rust/lance-namespace-impls/src/dir/manifest.rs:3348-3403 — 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:1639 — python/python/lance/dataset.py:1639-1772 | python/python/lance/dataset.py:1801-1839 | python/python/lance/dataset.py:2237-2271 | python/python/lance/fragment.py:723-740 | python/python/lance/fragment.py:761-776 — 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 · Duplicated block (24–25 lines × 2) · ×3
  • Duplicated block (24–25 lines × 2) rust/lance-encoding/src/array_encoding/strategy.rs:137 — rust/lance-encoding/src/array_encoding/strategy.rs:137-161 | rust/lance-encoding/src/encoder/structural.rs:43-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (24–25 lines × 2) rust/lance-index/src/scalar/inverted.rs:130 — rust/lance-index/src/scalar/inverted.rs:130-153 | rust/lance-index/src/scalar/inverted/index/search.rs:426-450 — 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 3 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.
  • Duplicated block (24–25 lines × 2) rust/lance/src/dataset/scanner.rs:5949 — rust/lance/src/dataset/scanner.rs:5949-5972 | rust/lance/src/dataset/scanner.rs:6266-6290 — both copies are in the same file, so extract the 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 (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) rust/lance-io/src/uring/current_thread.rs:280 — rust/lance-io/src/uring/current_thread.rs:280-302 | rust/lance-io/src/uring/reader.rs:131-153 — 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 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.
  • Duplicated block (23 lines × 2) rust/lance/src/dataset/scanner.rs:8132 — rust/lance/src/dataset/scanner.rs:8132-8154 | rust/lance/src/dataset/scanner.rs:8193-8215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2) rust/lance/src/io/commit.rs:1981 — rust/lance/src/io/commit.rs:1981-2003 | rust/lance/src/io/commit.rs:2054-2076 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×3
  • 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.
  • Duplicated block (16 lines × 3) rust/lance-index/src/scalar/inverted.rs:162 — rust/lance-index/src/scalar/inverted.rs:162-177 | rust/lance-index/src/scalar/inverted/index/partition.rs:995-1010 | rust/lance-index/src/scalar/inverted/index/search.rs:457-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 3 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.
  • Duplicated block (16 lines × 3) python/python/lance/dataset.py:4704 — python/python/lance/dataset.py:4704-4719 | python/python/lance/dataset.py:4851-4866 | python/python/lance/fragment.py:1459-1474 — 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 (12–14 lines × 2) · ×3
  • Duplicated block (12–14 lines × 2) rust/lance-encoding/src/encodings/physical/bitpacking.rs:461 — rust/lance-encoding/src/encodings/physical/bitpacking.rs:461-472 | rust/lance-encoding/src/encodings/physical/bitpacking.rs:484-497 — both copies are in the same file, so extract the block into 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–14 lines × 2) rust/lance/src/dataset/mem_wal/index/fts.rs:2028 — rust/lance/src/dataset/mem_wal/index/fts.rs:2028-2039 | rust/lance/src/io/exec/fts.rs:2459-2472 — 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 (12–14 lines × 2) rust/lance/src/index/vector/ivf.rs:1123 — rust/lance/src/index/vector/ivf.rs:1123-1136 | rust/lance/src/index/vector/ivf.rs:1212-1223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×3
  • Duplicated block (11–14 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:588 — rust/lance-linalg/src/simd/dist_table.rs:588-598 | rust/lance-linalg/src/simd/dist_table.rs:687-700 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–14 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2188 — rust/lance-namespace-impls/src/dir/manifest.rs:2188-2201 | rust/lance-namespace-impls/src/dir/manifest.rs:3529-3539 — both copies are in the same file, so extract the block into 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–14 lines × 2) rust/lance/src/dataset/scanner.rs:4467 — rust/lance/src/dataset/scanner.rs:4467-4480 | rust/lance/src/dataset/scanner.rs:7810-7820 — both copies are in the same file, so extract the 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 (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) java/lance-jni/src/namespace.rs:412 — java/lance-jni/src/namespace.rs:412-424 | java/lance-jni/src/namespace.rs:736-748 | java/lance-jni/src/namespace.rs:926-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.
  • Duplicated block (13 lines × 3) rust/lance-encoding/src/decoder.rs:1688 — rust/lance-encoding/src/decoder.rs:1688-1700 | rust/lance-encoding/src/decoder.rs:1935-1947 | rust/lance-encoding/src/decoder.rs:2153-2165 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) rust/lance/src/index/vector/ivf.rs:3483 — rust/lance/src/index/vector/ivf.rs:3483-3495 | rust/lance/src/index/vector/ivf.rs:5522-5534 | rust/lance/src/index/vector/ivf.rs:5723-5735 — all 3 copies are in the same file, so extract the block into one function there and call 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 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:110 — rust/lance-namespace/src/schema.rs:110-121 | rust/lance-namespace/src/schema.rs:128-139 | rust/lance-namespace/src/schema.rs:146-157 | rust/lance-namespace/src/schema.rs:190-201 — 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/src/dataset/mem_wal/scanner/builder.rs:653 — rust/lance/src/dataset/mem_wal/scanner/builder.rs:653-664 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:718-729 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:764-775 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:792-803 — 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:896 — java/lance-jni/src/mem_wal.rs:896-905 | python/src/mem_wal.rs:827-838 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10–12 lines × 2) python/src/dataset.rs:2225 — python/src/dataset.rs:2225-2236 | python/src/dataset.rs:2259-2268 — both copies are in the same file, so extract the block into 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/src/dataset/write/merge_insert/exec/delete.rs:157 — rust/lance/src/dataset/write/merge_insert/exec/delete.rs:157-166 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1021-1032 — 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 7 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (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.
  • Duplicated block (9–11 lines × 2) rust/lance-index/src/scalar/rtree.rs:408 — rust/lance-index/src/scalar/rtree.rs:408-418 | rust/lance-index/src/scalar/rtree.rs:449-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–11 lines × 2) rust/lance/src/io/exec/fts.rs:3545 — rust/lance/src/io/exec/fts.rs:3545-3555 | rust/lance/src/io/exec/fts.rs:5764-5772 — both copies are in the same file, so extract the 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 × 4) · ×3
  • 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.rs:3477-3486 | rust/lance/src/dataset/write/merge_insert/exec.rs:86-95 | rust/lance/src/dataset/write/update.rs:720-729 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • 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.rs:3508-3517 | rust/lance/src/dataset/write/merge_insert/exec.rs:117-126 | rust/lance/src/dataset/write/update.rs:751-760 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 4) rust/lance/src/io/exec/fts.rs:3378 — rust/lance/src/io/exec/fts.rs:3378-3387 | rust/lance/src/io/exec/fts.rs:3400-3409 | rust/lance/src/io/exec/fts.rs:5620-5629 | rust/lance/src/io/exec/fts.rs:5640-5649 — 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 (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:568-575 — both copies are in the same file, so extract the block into 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:633 — rust/lance-index/src/scalar/json.rs:633-640 | rust/lance-index/src/scalar/json.rs:763-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.
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×3
  • Duplicated block (9 lines × 4) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1279 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1279-1287 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:408-416 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:852-860 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:660-668 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.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 (9 lines × 4) python/src/dataset/optimize.rs:241 — python/src/dataset/optimize.rs:241-249 | python/src/dataset/optimize.rs:353-361 | python/src/fragment.rs:788-796 | python/src/fragment.rs:847-855 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 4) 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×3
  • Duplicated block (6 lines × 4) rust/lance-namespace-impls/src/dir/manifest.rs:2216 — rust/lance-namespace-impls/src/dir/manifest.rs:2216-2222 | rust/lance-namespace-impls/src/dir/manifest.rs:2520-2525 | rust/lance-namespace-impls/src/dir/manifest.rs:2849-2854 | rust/lance-namespace-impls/src/dir/manifest.rs:3370-3375 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 4) java/src/main/java/org/lance/Dataset.java:1499 — java/src/main/java/org/lance/Dataset.java:1499-1504 | java/src/main/java/org/lance/Dataset.java:1540-1545 | java/src/main/java/org/lance/Dataset.java:2049-2054 | java/src/main/java/org/lance/Dataset.java:2171-2176 — 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:1499` it does not close everything it opens, so those exact lines 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:1670 — java/src/main/java/org/lance/Dataset.java:1670-1675 | java/src/main/java/org/lance/Dataset.java:1829-1834 | java/src/main/java/org/lance/Dataset.java:2597-2602 | java/src/main/java/org/lance/ipc/LanceScanner.java:269-274 — 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.
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 16) rust/lance-datafusion-exec/src/exec.rs:455 — lance_datafusion_exec::exec::collect_execution_metrics 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 · CreateIndexBuilder · ×2
  • CreateIndexBuilder::execute_uncommitted_impl (cyclomatic 47) rust/lance/src/index/create.rs:181 — CreateIndexBuilder::execute_uncommitted_impl has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CreateIndexBuilder::execute_multi_segment_fmindex (cyclomatic 16) rust/lance/src/index/create.rs:764 — CreateIndexBuilder::execute_multi_segment_fmindex 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 · 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 · 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:958 — 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:714 — SerializerContext::record_offsets 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 · PyLance · ×2
  • PyLance::into_pyobject (cyclomatic 26) python/src/transaction.rs:713 — PyLance::into_pyobject 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.
  • PyLance::extract (cyclomatic 22) python/src/transaction.rs:453 — 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:504 — 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:708 — 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 · IvfIndexBuilder · ×2
  • IvfIndexBuilder::build_partitions (cyclomatic 25) rust/lance/src/index/vector/builder.rs:1159 — IvfIndexBuilder::build_partitions 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.
  • IvfIndexBuilder::merge_partitions (cyclomatic 22) rust/lance/src/index/vector/builder.rs:1762 — IvfIndexBuilder::merge_partitions 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 · lance_file · ×2
  • lance_file::concat::validate_blob_field (cyclomatic 23) rust/lance-file/src/concat.rs:380 — 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::concat::check_compatibility (cyclomatic 17) rust/lance-file/src/concat.rs:699 — 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 · FilteredReadExec · ×2
  • FilteredReadExec::try_new_row_stream (cyclomatic 21) rust/lance/src/io/exec/filtered_read.rs:2454 — 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::partition_statistics (cyclomatic 17) rust/lance/src/io/exec/filtered_read.rs:3673 — FilteredReadExec::partition_statistics 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:1231 — 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:913 — 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:390 — 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:578 — 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:90 — // 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 83) rust/lance/src/index/create.rs:181 — CreateIndexBuilder::execute_uncommitted_impl has cognitive complexity 83 (threshold 15). Drivers by points: if/else 46 (69 pts), boolean chains 7, 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 21) rust/lance/src/index/create.rs:764 — CreateIndexBuilder::execute_multi_segment_fmindex has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, 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 · 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 16) rust/lance-datafusion-exec/src/exec.rs:455 — lance_datafusion_exec::exec::collect_execution_metrics has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (7 pts), match/switch 2 (6 pts), if/else 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 · fsst · ×2
  • fsst::fsst::build_symbol_table (cognitive 65) rust/compression/fsst/src/fsst.rs:574 — fsst::fsst::build_symbol_table has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (51 pts), loops 9 (11 pts), boolean chains 3 (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.
  • fsst::fsst::decompress_bulk (cognitive 25) rust/compression/fsst/src/fsst.rs:939 — fsst::fsst::decompress_bulk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobPreprocessor · ×2
  • BlobPreprocessor::logical_to_prepared_blob_array (cognitive 53) rust/lance/src/dataset/blob/write.rs:974 — 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 21) rust/lance/src/dataset/blob/write.rs:742 — BlobPreprocessor::preprocess_field has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · U64Segment · ×2
  • U64Segment::with_new_high (cognitive 38) rust/lance-table/src/rowids/segment.rs:523 — 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:196 — 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:688 — 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:872 — 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 · FilteredReadExec · ×2
  • FilteredReadExec::partition_statistics (cognitive 34) rust/lance/src/io/exec/filtered_read.rs:3673 — FilteredReadExec::partition_statistics 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:2454 — 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:401 — 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:247 — 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 · HNSW · ×2
  • HNSW::flat_search (cognitive 33) rust/lance-index/src/vector/hnsw/builder.rs:636 — HNSW::flat_search has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (6 pts), boolean chains 2, 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 17) rust/lance-index/src/vector/hnsw/builder.rs:1699 — HNSW::search has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, 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 · PlanarSparseScheduler · ×2
  • PlanarSparseScheduler::try_new (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:504 — 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:708 — 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:578 — 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:390 — 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 · DatasetIndexRemapper · ×2
  • DatasetIndexRemapper::remap_indices_with_context (cognitive 29) rust/lance/src/dataset/index.rs:258 — 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:139 — 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 · PyLance · ×2
  • PyLance::into_pyobject (cognitive 28) python/src/transaction.rs:713 — PyLance::into_pyobject has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 4 (8 pts), loops 1 (4 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • PyLance::extract (cognitive 16) python/src/transaction.rs:453 — 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 · SegmentCursorState · ×2
  • SegmentCursorState::extend_dense_bitmap_range (cognitive 28) rust/lance-table/src/rowids/segment.rs:873 — 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:788 — 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:1069 — 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:1746 — 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:777 — 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:1389 — 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 · Schema · ×2
  • Schema::do_project (cognitive 24) rust/lance-core/src/datatypes/schema.rs:267 — Schema::do_project has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2, 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.
  • Schema::validate (cognitive 17) rust/lance-core/src/datatypes/schema.rs:358 — 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 · RowIdIndex · ×2
  • RowIdIndex::probe (cognitive 23) rust/lance-table/src/rowids/index.rs:214 — 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 18) rust/lance-table/src/rowids/index.rs:166 — RowIdIndex::get_many has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InvertedIndexBuilder · ×2
  • InvertedIndexBuilder::merge_existing_segments (cognitive 22) rust/lance-index/src/scalar/inverted/builder.rs:351 — 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:457 — 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 · ShardWriter · ×2
  • ShardWriter::drain_for_close (cognitive 21) rust/lance/src/dataset/mem_wal/write.rs:4313 — 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.rs:2798 — 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 · PostingListReader · ×2
  • PostingListReader::build_packed_chunk (cognitive 21) rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:376 — PostingListReader::build_packed_chunk has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 7 (9 pts), match/switch 2 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • PostingListReader::posting_read_chunk_ranges (cognitive 16) rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:689 — 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 · NGramIndexBuilder · ×2
  • NGramIndexBuilder::stream_spill_reader (cognitive 21) rust/lance-index/src/scalar/ngram.rs:1376 — 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:1553 — 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 · 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 · lance_arrow · ×2
  • 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.
  • lance_arrow::ipc::read_ipc_stream_at (cognitive 17) rust/lance-arrow/src/ipc.rs:203 — lance_arrow::ipc::read_ipc_stream_at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 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 · BTreeIndex · ×2
  • BTreeIndex::merge_segments (cognitive 19) rust/lance-index/src/scalar/btree.rs:2423 — 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:2874 — 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:1024 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFunctions · ×2
  • 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_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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (26 shared lines) · ×2
  • Near-duplicate member pair (26 shared lines) rust/lance-file/src/versions/v2_0/writer.rs:852 — rust/lance-file/src/versions/v2_0/writer.rs:852-941 | rust/lance-file/src/writer/structural.rs:837-918 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (26 shared lines) rust/lance/src/index/scalar/bloomfilter.rs:21 — rust/lance/src/index/scalar/bloomfilter.rs:21-106 | rust/lance/src/index/scalar/zonemap.rs:21-94 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×2
  • 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.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×2
  • Edited copy of a member (18 corresponding lines) rust/lance-linalg/src/distance/cosine.rs:937 — rust/lance-linalg/src/distance/cosine.rs:937-967 | rust/lance-linalg/src/distance/norm_l2.rs:261-280 — 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-linalg/src/distance/dot.rs:496 — rust/lance-linalg/src/distance/dot.rs:496-521 | rust/lance-linalg/src/distance/norm_l2.rs:284-303 — 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 · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) 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:670-748 | java/lance-jni/src/namespace.rs:759-829 | java/lance-jni/src/namespace.rs:844-938 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) 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 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/lance-namespace-impls/src/dir/manifest.rs:2913 — rust/lance-namespace-impls/src/dir/manifest.rs:2913-3033 | rust/lance-namespace-impls/src/dir/manifest.rs:3035-3059 | rust/lance-namespace-impls/src/dir/manifest.rs:3065-3279 | rust/lance-namespace-impls/src/dir/manifest.rs:3281-3343 | rust/lance-namespace-impls/src/dir/manifest.rs:3697-3770 | rust/lance-namespace-impls/src/dir/manifest.rs:3775-3814 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/lance/src/io/exec/fts.rs:4300 — rust/lance/src/io/exec/fts.rs:4300-4424 | rust/lance/src/io/exec/fts.rs:4772-4935 | rust/lance/src/io/exec/fts.rs:5151-5311 | rust/lance/src/io/exec/knn.rs:995-1069 | rust/lance/src/io/exec/rowids.rs:181-231 | rust/lance/src/io/exec/scalar_index.rs:632-711 — 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 · Duplicated block (35 lines × 2) · ×2
  • Duplicated block (35 lines × 2) rust/lance-index/src/vector/hnsw/remap.rs:62 — rust/lance-index/src/vector/hnsw/remap.rs:62-96 | rust/lance-index/src/vector/hnsw/remap.rs:230-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (35 lines × 2) rust/lance/src/index/vector/ivf.rs:1260 — rust/lance/src/index/vector/ivf.rs:1260-1294 | rust/lance/src/index/vector/ivf.rs:2657-2691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×2
  • Duplicated block (33 lines × 2) rust/lance-file/src/reader/structural.rs:285 — rust/lance-file/src/reader/structural.rs:285-317 | rust/lance-file/src/versions/v2_0/reader.rs:245-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 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (33 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1280 — rust/lance-index/src/vector/distributed/index_merger.rs:1280-1312 | rust/lance-index/src/vector/distributed/index_merger.rs:1438-1470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • 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.
  • Duplicated block (32 lines × 2) rust/lance/src/index/vector/ivf/v2.rs:1386 — rust/lance/src/index/vector/ivf/v2.rs:1386-1417 | rust/lance/src/index/vector/ivf/v2.rs:1470-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.
D4 · Code Duplication · Duplicated block (27–29 lines × 2) · ×2
  • Duplicated block (27–29 lines × 2) java/lance-jni/src/otel.rs:235 — java/lance-jni/src/otel.rs:235-261 | python/src/otel.rs:293-321 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (27–29 lines × 2) rust/lance/src/io/exec/scan.rs:470 — rust/lance/src/io/exec/scan.rs:470-496 | rust/lance/src/io/exec/scan.rs:504-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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) rust/lance-encoding/src/encodings/physical/fsst.rs:233 — rust/lance-encoding/src/encodings/physical/fsst.rs:233-259 | rust/lance-encoding/src/encodings/physical/fsst.rs:264-290 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×2
  • Duplicated block (20–23 lines × 2) rust/lance-table/src/io/commit/external_manifest.rs:80 — rust/lance-table/src/io/commit/external_manifest.rs:80-102 | rust/lance-table/src/io/commit/external_manifest.rs:685-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20–23 lines × 2) rust/lance/src/dataset/mem_wal/memtable/flush.rs:349 — rust/lance/src/dataset/mem_wal/memtable/flush.rs:349-368 | rust/lance/src/dataset/mem_wal/memtable/flush.rs:641-663 — both copies are in the same file, so extract the 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 (19–22 lines × 2) · ×2
  • Duplicated block (19–22 lines × 2) rust/lance/src/dataset/scanner.rs:5908 — rust/lance/src/dataset/scanner.rs:5908-5926 | rust/lance/src/dataset/scanner.rs:6228-6249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×2
  • Duplicated block (19 lines × 3) rust/lance-file/src/versions/v2_1/writer.rs:206 — rust/lance-file/src/versions/v2_1/writer.rs:206-224 | rust/lance-file/src/versions/v2_2/writer.rs:206-224 | rust/lance-file/src/versions/v2_3/writer.rs:206-224 — `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 62 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 (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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) java/lance-jni/src/fragment.rs:485 — java/lance-jni/src/fragment.rs:485-502 | java/lance-jni/src/fragment.rs:545-561 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) rust/lance-datafusion/src/planner.rs:639 — rust/lance-datafusion/src/planner.rs:639-654 | rust/lance-datafusion/src/planner.rs:656-670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–16 lines × 2) rust/lance/src/index/vector/utils.rs:799 — rust/lance/src/index/vector/utils.rs:799-813 | rust/lance/src/index/vector/utils.rs:1006-1021 — both copies are in the same file, so extract the 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 (13–16 lines × 2) · ×2
  • Duplicated block (13–16 lines × 2) rust/lance/src/dataset/hash_joiner.rs:132 — rust/lance/src/dataset/hash_joiner.rs:132-147 | rust/lance/src/dataset/hash_joiner.rs:221-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 (13–16 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:2225 — rust/lance/src/io/commit/conflict_resolver.rs:2225-2240 | rust/lance/src/io/commit/conflict_resolver.rs:2364-2376 — both copies are in the same file, so extract the 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-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.
  • Duplicated block (15 lines × 4) rust/lance/src/index/vector.rs:1745 — rust/lance/src/index/vector.rs:1745-1759 | rust/lance/src/index/vector.rs:1763-1777 | rust/lance/src/index/vector.rs:1781-1795 | rust/lance/src/index/vector.rs:1799-1813 — 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 (15 lines × 3) · ×2
  • 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.
  • Duplicated block (15 lines × 3) rust/lance/src/index/vector.rs:1638 — rust/lance/src/index/vector.rs:1638-1652 | rust/lance/src/index/vector.rs:1656-1670 | rust/lance/src/index/vector.rs:1696-1710 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×2
  • Duplicated block (11–15 lines × 2) java/lance-jni/src/blocking_dataset.rs:2892 — java/lance-jni/src/blocking_dataset.rs:2892-2906 | java/lance-jni/src/blocking_dataset.rs:2937-2947 — both copies are in the same file, so extract the block into 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–15 lines × 2) rust/lance/src/dataset/fragment.rs:2194 — rust/lance/src/dataset/fragment.rs:2194-2208 | 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) rust/lance-encoding/src/compression.rs:222 — rust/lance-encoding/src/compression.rs:222-234 | rust/lance-encoding/src/compression.rs:347-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–13 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1124 — rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1124-1136 | rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1190-1200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×2
  • 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:338-348 — `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 8 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.
  • 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:381-391 — `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 8 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.
D4 · Code Duplication · Duplicated block (3–6 lines × 4) · ×2
  • Duplicated block (3–6 lines × 4) rust/lance-linalg/src/distance/cosine.rs:941 — rust/lance-linalg/src/distance/cosine.rs:941-943 | rust/lance-linalg/src/distance/dot.rs:467-472 | rust/lance-linalg/src/distance/l2.rs:664-669 | rust/lance-linalg/src/distance/norm_l2.rs:262-267 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (3–6 lines × 4) rust/lance-linalg/src/distance/cosine.rs:950 — rust/lance-linalg/src/distance/cosine.rs:950-952 | rust/lance-linalg/src/distance/dot.rs:474-479 | rust/lance-linalg/src/distance/l2.rs:672-677 | rust/lance-linalg/src/distance/norm_l2.rs:268-273 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) java/lance-jni/src/blocking_dataset.rs:910 — java/lance-jni/src/blocking_dataset.rs:910-923 | java/lance-jni/src/blocking_scanner.rs:809-822 | java/lance-jni/src/file_reader.rs:85-89 | java/lance-jni/src/file_writer.rs:51-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (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.
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:1056 — `count` is read from the bytes being parsed at line 1054 (`u32::from_le_bytes`), then used to size a `Vec::with_capacity` at line 1056 — 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:669 — `.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.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · Operation · ×1
  • Operation::eq (cyclomatic 240) rust/lance-table/src/transaction/conflicts.rs:19 — Operation::eq has cyclomatic complexity 240 (threshold 15). Of this number, 239 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:166 — 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:4044 — 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 69) rust/lance-index/src/scalar/zonemap.rs:295 — ZoneMapIndex::evaluate_zone_against_query has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BloomFilterIndex · ×1
  • BloomFilterIndex::evaluate_block_against_query (cyclomatic 56) rust/lance-index/src/scalar/bloomfilter.rs:306 — 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 · Planner · ×1
  • Planner::parse_sql_expr (cyclomatic 45) rust/lance-datafusion/src/planner.rs:700 — Planner::parse_sql_expr 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_namespace · ×1
  • lance_namespace::schema::arrow_type_to_json (cyclomatic 44) rust/lance-namespace/src/schema.rs:50 — lance_namespace::schema::arrow_type_to_json has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
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:326 — 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 · IVFIndex · ×1
  • IVFIndex::search_partitions (cyclomatic 37) rust/lance/src/index/vector/ivf/v2.rs:2882 — IVFIndex::search_partitions has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PQDistCalculator · ×1
  • PQDistCalculator::accumulate_topk_with_scratch (cyclomatic 36) rust/lance-index/src/vector/pq/storage.rs:982 — 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 · DecodeMiniBlockTask · ×1
  • DecodeMiniBlockTask::map_range (cyclomatic 35) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:391 — 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.
D1 · Cyclomatic Complexity · fsst · ×1
  • fsst::fsst::build_symbol_table (cyclomatic 33) rust/compression/fsst/src/fsst.rs:574 — fsst::fsst::build_symbol_table has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackedStructVariablePerValueDecompressor · ×1
  • PackedStructVariablePerValueDecompressor::decompress (cyclomatic 31) rust/lance-encoding/src/encodings/physical/packed.rs:638 — PackedStructVariablePerValueDecompressor::decompress 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 · DefaultCompactionPlanner · ×1
  • DefaultCompactionPlanner::plan (cyclomatic 29) rust/lance/src/dataset/optimize.rs:907 — DefaultCompactionPlanner::plan 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 · Merger · ×1
  • Merger::execute_batch (cyclomatic 29) rust/lance/src/dataset/write/merge_insert.rs:3974 — Merger::execute_batch 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 · RowIdSequence · ×1
  • RowIdSequence::mask_to_offset_ranges (cyclomatic 28) rust/lance-table/src/rowids.rs:609 — 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 · dataset._build_vector_search_query (cyclomatic 28) · ×1
  • dataset._build_vector_search_query (cyclomatic 28) python/python/lance/dataset.py:8681 — dataset._build_vector_search_query 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 · DatasetBuilder · ×1
  • DatasetBuilder::load_impl (cyclomatic 27) rust/lance/src/dataset/builder.rs:688 — 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 · 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:3565 — 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:2944 — 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 · BlobPreprocessor · ×1
  • BlobPreprocessor::logical_to_prepared_blob_array (cyclomatic 25) rust/lance/src/dataset/blob/write.rs:974 — 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.
D1 · Cyclomatic Complexity · FilteredReadStream · ×1
  • FilteredReadStream::plan_scan (cyclomatic 25) rust/lance/src/io/exec/filtered_read.rs:847 — FilteredReadStream::plan_scan 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 · PostingIterator · ×1
  • PostingIterator::merge_optional_freqs (cyclomatic 25) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:112 — 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:523 — 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 · types._coerce_reader (cyclomatic 25) · ×1
  • types._coerce_reader (cyclomatic 25) python/python/lance/types.py:101 — types._coerce_reader has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FtsIndexExec · ×1
  • FtsIndexExec::materialize_rows_sorted (cyclomatic 24) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:328 — 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 · CompactionOptions · ×1
  • CompactionOptions::apply_dataset_config (cyclomatic 24) rust/lance/src/dataset/optimize.rs:455 — CompactionOptions::apply_dataset_config 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 · CompoundQueryExec · ×1
  • CompoundQueryExec::execute (cyclomatic 24) rust/lance/src/io/exec/fts.rs:1585 — CompoundQueryExec::execute 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 · IndexWorker · ×1
  • IndexWorker::process_document (cyclomatic 24) rust/lance-index/src/scalar/inverted/builder.rs:1680 — IndexWorker::process_document 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 · 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.rs:1381 — 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 · CommitBuilder · ×1
  • CommitBuilder::execute_inner (cyclomatic 23) rust/lance/src/dataset/write/commit.rs:336 — CommitBuilder::execute_inner 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:137 — 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 · DefaultDecompressionStrategy · ×1
  • DefaultDecompressionStrategy::create_miniblock_decompressor (cyclomatic 23) rust/lance-encoding/src/compression.rs:1188 — DefaultDecompressionStrategy::create_miniblock_decompressor 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 · DataBlock · ×1
  • DataBlock::from_arrays_impl (cyclomatic 23) rust/lance-encoding/src/data.rs:2173 — DataBlock::from_arrays_impl 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 · BitmapIndex · ×1
  • BitmapIndex::search_with_options (cyclomatic 23) rust/lance-index/src/scalar/bitmap.rs:1077 — 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:1086 — 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:8284 — 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 · FetchedPostings · ×1
  • FetchedPostings::into_loaded (cyclomatic 22) rust/lance-index/src/scalar/inverted/index/partition.rs:1701 — FetchedPostings::into_loaded 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 · ChunkInstructions · ×1
  • ChunkInstructions::schedule_instructions (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:1214 — 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:1720 — 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 · 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:189 — 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:377 — 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:291 — 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 · RQPairScorer · ×1
  • RQPairScorer::stage (cyclomatic 20) rust/lance-index/src/vector/bq/pairwise.rs:137 — 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 · ManifestNamespace · ×1
  • ManifestNamespace::create_table (cyclomatic 20) rust/lance-namespace-impls/src/dir/manifest.rs:3061 — ManifestNamespace::create_table 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 · RepDefBuilder · ×1
  • RepDefBuilder::concat_layers (cyclomatic 19) rust/lance-encoding/src/repdef.rs:1409 — 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:138 — 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.rs:4997 — 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:801 — 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 · 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 · PlanarSparseTask · ×1
  • PlanarSparseTask::decode_checked (cyclomatic 18) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:1048 — PlanarSparseTask::decode_checked 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 · GooseFsStoreProvider · ×1
  • GooseFsStoreProvider::parse_decimal_times_unit (cyclomatic 18) rust/lance-io/src/object_store/providers/goosefs.rs:294 — 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:481 — 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 · udf.normalize_transform (cyclomatic 18) · ×1
  • udf.normalize_transform (cyclomatic 18) REDACTED:185 — 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 · 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:4773 — 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:214 — 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 · UpdateJob · ×1
  • UpdateJob::execute_impl (cyclomatic 17) rust/lance/src/dataset/write/update.rs:344 — UpdateJob::execute_impl 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 · TakeStream · ×1
  • TakeStream::map_batch (cyclomatic 17) rust/lance/src/io/exec/take.rs:244 — TakeStream::map_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.
D1 · Cyclomatic Complexity · CoreFieldDecoderStrategy · ×1
  • CoreFieldDecoderStrategy::create_array_field_scheduler (cyclomatic 17) rust/lance-encoding/src/decoder.rs:1012 — 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:1389 — 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 · FlatIndex · ×1
  • FlatIndex::search_with_scratch (cyclomatic 17) rust/lance-index/src/vector/flat/index.rs:141 — FlatIndex::search_with_scratch 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 · 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:359 — 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:175 — 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:204 — 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 · IndexDescriptionImpl · ×1
  • IndexDescriptionImpl::try_new (cyclomatic 16) rust/lance/src/index.rs:2276 — IndexDescriptionImpl::try_new 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:181 — 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 · BTreeIndex · ×1
  • BTreeIndex::search_with_options (cyclomatic 16) rust/lance-index/src/scalar/btree.rs:2874 — 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:756 — 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 · HNSW · ×1
  • HNSW::flat_search (cyclomatic 16) rust/lance-index/src/vector/hnsw/builder.rs:636 — HNSW::flat_search 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 · 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:388 — 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:138 — 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.
D2 · Cognitive Complexity · OrderableScalarValue · ×1
  • OrderableScalarValue::cmp (cognitive 144) rust/lance-index/src/scalar/btree.rs:166 — 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:4044 — 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 · DecodeMiniBlockTask · ×1
  • DecodeMiniBlockTask::map_range (cognitive 128) rust/lance-encoding/src/encodings/logical/primitive/miniblock_decode.rs:391 — 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.
D2 · Cognitive Complexity · ZoneMapIndex · ×1
  • ZoneMapIndex::evaluate_zone_against_query (cognitive 127) rust/lance-index/src/scalar/zonemap.rs:295 — ZoneMapIndex::evaluate_zone_against_query has cognitive complexity 127 (threshold 15). Drivers by points: if/else 44 (89 pts), match/switch 11 (25 pts), boolean chains 13 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch 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:609 — 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 · Merger · ×1
  • Merger::execute_batch (cognitive 71) rust/lance/src/dataset/write/merge_insert.rs:3974 — Merger::execute_batch has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (51 pts), match/switch 6 (12 pts), loops 3 (8 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:982 — 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 · FilteredReadStream · ×1
  • FilteredReadStream::plan_scan (cognitive 65) rust/lance/src/io/exec/filtered_read.rs:847 — FilteredReadStream::plan_scan has cognitive complexity 65 (threshold 15). Drivers by points: if/else 26 (59 pts), boolean chains 4, loops 2 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PackedStructVariablePerValueDecompressor · ×1
  • PackedStructVariablePerValueDecompressor::decompress (cognitive 61) rust/lance-encoding/src/encodings/physical/packed.rs:638 — PackedStructVariablePerValueDecompressor::decompress has cognitive complexity 61 (threshold 15). Drivers by points: if/else 13 (41 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 · BitpackedPageDecoder · ×1
  • BitpackedPageDecoder::decode (cognitive 56) rust/lance-encoding/src/array_encoding/physical/bitpack.rs:377 — 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:801 — 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:1214 — 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 · ScalarMemIndexExec · ×1
  • ScalarMemIndexExec::read_rows (cognitive 50) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scalar_index.rs:189 — 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 · Planner · ×1
  • Planner::parse_sql_expr (cognitive 47) rust/lance-datafusion/src/planner.rs:700 — Planner::parse_sql_expr has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 6 (13 pts), loops 3 (7 pts) (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · 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 · FetchedPostings · ×1
  • FetchedPostings::into_loaded (cognitive 44) rust/lance-index/src/scalar/inverted/index/partition.rs:1701 — FetchedPostings::into_loaded has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 4 (8 pts), boolean chains 5 (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 · SequenceCursor · ×1
  • SequenceCursor::fill (cognitive 41) rust/lance/src/dataset/delta.rs:868 — 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 · LanceDataset._prepare_scalar_index_request (cognitive 41) · ×1
  • LanceDataset._prepare_scalar_index_request (cognitive 41) python/python/lance/dataset.py:3565 — 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 · FtsIndexExec · ×1
  • FtsIndexExec::materialize_rows_sorted (cognitive 39) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:328 — 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 · DefaultCompactionPlanner · ×1
  • DefaultCompactionPlanner::plan (cognitive 39) rust/lance/src/dataset/optimize.rs:907 — DefaultCompactionPlanner::plan has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 6, loops 4 (6 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 · FlatIndex · ×1
  • FlatIndex::search_with_scratch (cognitive 39) rust/lance-index/src/vector/flat/index.rs:141 — FlatIndex::search_with_scratch has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TakeOperation · ×1
  • TakeOperation::try_from_expr (cognitive 38) rust/lance/src/dataset/scanner.rs:1381 — 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 · IndexWorker · ×1
  • IndexWorker::process_document (cognitive 38) rust/lance-index/src/scalar/inverted/builder.rs:1680 — IndexWorker::process_document has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 4 (8 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · CompoundQueryExec · ×1
  • CompoundQueryExec::execute (cognitive 37) rust/lance/src/io/exec/fts.rs:1585 — CompoundQueryExec::execute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 5 (12 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlanarSparseTask · ×1
  • PlanarSparseTask::decode_checked (cognitive 37) rust/lance-encoding/src/encodings/logical/primitive/sparse/planar.rs:1048 — PlanarSparseTask::decode_checked has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (21 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 · CommitBuilder · ×1
  • CommitBuilder::execute_inner (cognitive 36) rust/lance/src/dataset/write/commit.rs:336 — CommitBuilder::execute_inner has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (28 pts), match/switch 5 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · FixedFullZipDecodeTask · ×1
  • FixedFullZipDecodeTask::decode (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:1149 — 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:1077 — 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 · 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 · ZoneTrainer · ×1
  • ZoneTrainer::train (cognitive 34) rust/lance-index/src/scalar/zoned.rs:92 — ZoneTrainer::train has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileScheduler · ×1
  • FileScheduler::submit_request (cognitive 34) rust/lance-io/src/scheduler.rs:1197 — 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:214 — 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 · TaskDispatcher · ×1
  • TaskDispatcher::run (cognitive 32) rust/lance/src/dataset/mem_wal/write.rs:491 — 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 · MemTableFlushHandler · ×1
  • MemTableFlushHandler::flush_memtable (cognitive 32) rust/lance/src/dataset/mem_wal/write.rs:4997 — 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 · TopKLateMaterialization · ×1
  • TopKLateMaterialization::rewrite (cognitive 32) rust/lance/src/io/exec/topk_late_materialization.rs:137 — 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.
D2 · Cognitive Complexity · CoreFieldDecoderStrategy · ×1
  • CoreFieldDecoderStrategy::create_array_field_scheduler (cognitive 32) rust/lance-encoding/src/decoder.rs:1012 — 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.
D2 · Cognitive Complexity · RepDefUnraveler · ×1
  • RepDefUnraveler::unravel_offsets (cognitive 32) rust/lance-encoding/src/repdef.rs:1720 — 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 · dataset._build_vector_search_query (cognitive 32) · ×1
  • dataset._build_vector_search_query (cognitive 32) python/python/lance/dataset.py:8681 — dataset._build_vector_search_query has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 9 (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 · SymbolTable · ×1
  • SymbolTable::finalize (cognitive 31) rust/compression/fsst/src/fsst.rs:424 — SymbolTable::finalize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemTableDedupScanExec · ×1
  • MemTableDedupScanExec::execute (cognitive 31) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:175 — 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:589 — 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 · CoalesceFirstStream · ×1
  • CoalesceFirstStream::poll_next (cognitive 30) rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs:204 — 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:181 — 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 · 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:185 — 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:1182 — 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:8284 — 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 · TakeStream · ×1
  • TakeStream::map_batch (cognitive 28) rust/lance/src/io/exec/take.rs:244 — TakeStream::map_batch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · AddRowAddrExec · ×1
  • AddRowAddrExec::compute_row_addrs (cognitive 27) rust/lance/src/io/exec/rowids.rs:127 — 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 · LanceEncodingsIo · ×1
  • LanceEncodingsIo::submit_request (cognitive 27) rust/lance-file/src/io.rs:62 — LanceEncodingsIo::submit_request has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 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 · 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:756 — 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:137 — 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 · IndexDescriptionImpl · ×1
  • IndexDescriptionImpl::try_new (cognitive 26) rust/lance/src/index.rs:2276 — IndexDescriptionImpl::try_new has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FixedFullZipDecoder · ×1
  • FixedFullZipDecoder::slice_next_task (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:600 — 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 · VariableFullZipDecoder · ×1
  • VariableFullZipDecoder::unzip (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs:929 — VariableFullZipDecoder::unzip has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BTreeLookup · ×1
  • BTreeLookup::pages_between (cognitive 26) rust/lance-index/src/scalar/btree.rs:1086 — 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 · ProductQuantizer · ×1
  • ProductQuantizer::transform_impl (cognitive 26) rust/lance-index/src/vector/pq.rs:174 — 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 · HnswGraph · ×1
  • HnswGraph::visit_published_neighbors (cognitive 25) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:1006 — 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 · MergeState · ×1
  • MergeState::process_row_action (cognitive 24) rust/lance/src/dataset/write/merge_insert/exec/write.rs:155 — 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 · 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:1409 — 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 · 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:138 — 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 · PlannedHopRemapper · ×1
  • PlannedHopRemapper::remap_row_ids (cognitive 22) rust/lance/src/dataset/optimize/remapping.rs:762 — 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 · 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.rs:6209 — 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:291 — 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:816 — 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:294 — 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:909 — 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:440 — 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 · 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:4609 — 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::deserialize_seed (cognitive 21) rust/lance-index/src/scalar/zonemap.rs:1895 — ZoneMapSeedWriter::deserialize_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 · 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:263 — 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 · BloomFilterIndex · ×1
  • BloomFilterIndex::evaluate_block_against_query (cognitive 20) rust/lance-index/src/scalar/bloomfilter.rs:306 — 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 · dataset._coerce_query_vector (cognitive 20) · ×1
  • dataset._coerce_query_vector (cognitive 20) python/python/lance/dataset.py:8630 — dataset._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 · sampler._filtered_efficient_sample (cognitive 20) · ×1
  • sampler._filtered_efficient_sample (cognitive 20) python/python/lance/sampler.py:114 — sampler._filtered_efficient_sample has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 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 · types._coerce_reader (cognitive 20) · ×1
  • types._coerce_reader (cognitive 20) python/python/lance/types.py:101 — types._coerce_reader has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatasetDelta · ×1
  • 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.
D2 · Cognitive Complexity · VectorIndexExec · ×1
  • VectorIndexExec::materialize_rows (cognitive 19) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:198 — 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 · UpdateJob · ×1
  • UpdateJob::execute_impl (cognitive 19) rust/lance/src/dataset/write/update.rs:344 — UpdateJob::execute_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 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 · FlatCombinedFieldsExec · ×1
  • FlatCombinedFieldsExec::execute (cognitive 19) rust/lance/src/io/exec/fts.rs:5147 — 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 · 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 · ScalarIndexExpr · ×1
  • ScalarIndexExpr::optimize_and_leaves (cognitive 19) rust/lance-index/src/scalar/expression.rs:1767 — 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 · RTreeIndexPlugin · ×1
  • RTreeIndexPlugin::write_index (cognitive 19) rust/lance-index/src/scalar/rtree.rs:1086 — 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 · 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 · RowAddrTreeMap · ×1
  • RowAddrTreeMap::from (cognitive 19) rust/lance-table/src/rowids.rs:866 — 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.
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 · Evaluator · ×1
  • Evaluator::apply (cognitive 18) rust/lance/src/dataset/write/merge_insert/exec/condition.rs:252 — 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 · 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 · BlobPageScheduler · ×1
  • BlobPageScheduler::schedule_ranges (cognitive 18) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:363 — BlobPageScheduler::schedule_ranges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 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 · 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:268 — 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:1247 — 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:156 — 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 · ObjectStore · ×1
  • ObjectStore::copy_via_stream_inner (cognitive 18) rust/lance-io/src/object_store.rs:1353 — 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 · BitmapSlice · ×1
  • BitmapSlice::count_ones (cognitive 18) rust/lance-table/src/rowids/bitmap.rs:127 — 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:1275 — 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:110 — 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 · DatasetPreFilter · ×1
  • DatasetPreFilter::create_deletion_mask_impl (cognitive 17) rust/lance/src/index/prefilter.rs:349 — DatasetPreFilter::create_deletion_mask_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddRowOffsetExec · ×1
  • AddRowOffsetExec::compute_row_offsets (cognitive 17) rust/lance/src/io/exec/rowids.rs:440 — 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 · DataBlock · ×1
  • DataBlock::from_arrays_impl (cognitive 17) rust/lance-encoding/src/data.rs:2173 — DataBlock::from_arrays_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 3 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · 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 · 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:481 — 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:388 — 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:1225 — 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.rs:1205 — 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 · BlobV2FieldRewritePlan · ×1
  • BlobV2FieldRewritePlan::try_new (cognitive 16) rust/lance/src/dataset/optimize.rs:1852 — 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.
D2 · Cognitive Complexity · RowStreamRead · ×1
  • RowStreamRead::plan_batch_from_row_ids (cognitive 16) rust/lance/src/io/exec/filtered_read.rs:3211 — 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 · BlobDescriptionDecodePageTask · ×1
  • BlobDescriptionDecodePageTask::decode (cognitive 16) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:152 — BlobDescriptionDecodePageTask::decode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StructuralPrimitiveFieldDecoder · ×1
  • StructuralPrimitiveFieldDecoder::plan_decoded_bytes (cognitive 16) rust/lance-encoding/src/encodings/logical/primitive/field.rs:1050 — 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 · BinaryMiniBlockDecompressor · ×1
  • BinaryMiniBlockDecompressor::decompress (cognitive 16) rust/lance-encoding/src/encodings/physical/binary.rs:806 — BinaryMiniBlockDecompressor::decompress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ByteStreamSplitEncoder · ×1
  • ByteStreamSplitEncoder::compress (cognitive 16) rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:110 — ByteStreamSplitEncoder::compress has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (6 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · 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:234 — 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:190 — 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:1253 — 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 (4 members, 20 shared lines) · ×1
  • Near-duplicate member family (4 members, 20 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.rs:3476-3517 | rust/lance/src/dataset/write/merge_insert/exec.rs:85-126 | rust/lance/src/dataset/write/update.rs:719-760 — These 4 members are variants of one another: a block of 20 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 11 shared lines) · ×1
  • Near-duplicate member family (3 members, 11 shared lines) rust/lance-namespace-impls/src/rest.rs:1052 — rust/lance-namespace-impls/src/rest.rs:1052-1075 | rust/lance-namespace-impls/src/rest.rs:1454-1475 | rust/lance-namespace-impls/src/rest.rs:1500-1530 — These 3 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (88 shared lines) · ×1
  • Near-duplicate member pair (88 shared lines) rust/lance/src/dataset/scanner.rs:5902 — rust/lance/src/dataset/scanner.rs:5902-6058 | rust/lance/src/dataset/scanner.rs:6218-6370 — These two members are variants of one another: 88 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (57 shared lines) · ×1
  • Near-duplicate member pair (57 shared lines) rust/lance-encoding/src/encodings/physical/alp.rs:836 — rust/lance-encoding/src/encodings/physical/alp.rs:836-922 | rust/lance-encoding/src/encodings/physical/alp.rs:931-1016 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (55 shared lines) · ×1
  • Near-duplicate member pair (55 shared lines) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:310 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:310-372 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:380-442 — 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 (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) rust/lance-index/src/vector/hnsw/remap.rs:50 — rust/lance-index/src/vector/hnsw/remap.rs:50-194 | rust/lance-index/src/vector/hnsw/remap.rs:218-317 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) rust/lance-io/src/object_store/providers/oss.rs:106 — rust/lance-io/src/object_store/providers/oss.rs:106-151 | rust/lance-io/src/object_store/providers/tos.rs:112-157 — 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 · Near-duplicate member pair (25 shared lines) · ×1
  • Near-duplicate member pair (25 shared lines) rust/lance/src/index/scalar/label_list.rs:79 — rust/lance/src/index/scalar/label_list.rs:79-193 | rust/lance/src/index/scalar/rtree.rs:29-101 — These two members are variants of one another: 25 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (20 shared lines) · ×1
  • Near-duplicate member pair (20 shared lines) rust/lance/src/dataset/index/frag_reuse.rs:582 — rust/lance/src/dataset/index/frag_reuse.rs:582-628 | rust/lance/src/index/frag_reuse.rs:1995-2032 — These two members are variants of one another: 20 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) rust/lance-linalg/src/distance/cosine.rs:545 — rust/lance-linalg/src/distance/cosine.rs:545-574 | rust/lance-linalg/src/distance/cosine.rs:1131-1156 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×1
  • 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.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:125 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:125-158 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:90-131 — 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 copy of a member (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) rust/lance-linalg/src/distance/cosine.rs:1183 — rust/lance-linalg/src/distance/cosine.rs:1183-1204 | rust/lance-linalg/src/distance/cosine.rs:1208-1225 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (60–63 lines × 2) · ×1
  • Duplicated block (60–63 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1216 — rust/lance-index/src/vector/distributed/index_merger.rs:1216-1278 | rust/lance-index/src/vector/distributed/index_merger.rs:1377-1436 — both copies are in the same file, so extract the 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 (50–55 lines × 2) · ×1
  • Duplicated block (50–55 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1050 — rust/lance-index/src/vector/distributed/index_merger.rs:1050-1104 | rust/lance-index/src/vector/distributed/index_merger.rs:1473-1522 — both copies are in the same file, so extract the 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 (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:606 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:606-653 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:719-766 — both copies are in the same file, so extract the 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 (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) rust/lance-file/src/versions/v2_1/reader.rs:34 — rust/lance-file/src/versions/v2_1/reader.rs:34-77 | rust/lance-file/src/versions/v2_2/reader.rs:34-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 8 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.
D4 · Code Duplication · Duplicated block (41–42 lines × 2) · ×1
  • Duplicated block (41–42 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:840 — rust/lance-encoding/src/encodings/physical/alp.rs:840-881 | rust/lance-encoding/src/encodings/physical/alp.rs:935-975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (39–42 lines × 2) · ×1
  • Duplicated block (39–42 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:504 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:504-542 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:240-281 — 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 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:560 — rust/lance-index/src/scalar/inverted/index/inverted_index.rs:560-600 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:673-713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (39–41 lines × 2) · ×1
  • Duplicated block (39–41 lines × 2) rust/lance/src/dataset/fragment.rs:4029 — rust/lance/src/dataset/fragment.rs:4029-4067 | rust/lance/src/dataset/fragment.rs:4222-4262 — both copies are in the same file, so extract the 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 (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:724 — rust/lance/src/io/commit/conflict_resolver.rs:724-763 | rust/lance/src/io/commit/conflict_resolver.rs:974-1013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) rust/lance-index/src/vector/graph.rs:429 — rust/lance-index/src/vector/graph.rs:429-466 | rust/lance-index/src/vector/graph.rs:512-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.
D4 · Code Duplication · Duplicated block (33–38 lines × 2) · ×1
  • Duplicated block (33–38 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:468 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:468-500 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:199-236 — 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 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:309 — rust/lance-encoding/src/encodings/logical/primitive/dict.rs:309-345 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:365-401 — both copies are in the same file, so extract the 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 (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) java/lance-jni/src/async_scanner.rs:275 — java/lance-jni/src/async_scanner.rs:275-310 | java/lance-jni/src/blocking_scanner.rs:746-781 — 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 (29–34 lines × 2) · ×1
  • Duplicated block (29–34 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:594 — rust/lance-file/src/versions/v2_0/writer.rs:594-627 | 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 16 separate duplicated blocks between them, totalling at least 194 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (32–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) java/lance-jni/src/async_scanner.rs:210 — java/lance-jni/src/async_scanner.rs:210-241 | java/lance-jni/src/blocking_scanner.rs:679-711 — 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 (31–33 lines × 2) · ×1
  • Duplicated block (31–33 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:768 — rust/lance/src/io/commit/conflict_resolver.rs:768-800 | rust/lance/src/io/commit/conflict_resolver.rs:1018-1048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) rust/lance-file/src/versions/v2_1/writer.rs:155 — rust/lance-file/src/versions/v2_1/writer.rs:155-186 | rust/lance-file/src/versions/v2_2/writer.rs:155-186 | rust/lance-file/src/versions/v2_3/writer.rs:155-186 — `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 62 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (30–32 lines × 3) · ×1
  • Duplicated block (30–32 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:3824 — rust/lance-namespace-impls/src/dir/manifest.rs:3824-3855 | rust/lance-namespace-impls/src/dir/manifest.rs:3889-3918 | rust/lance-namespace-impls/src/dir/manifest.rs:3941-3970 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (28–31 lines × 2) · ×1
  • Duplicated block (28–31 lines × 2) rust/lance-encoding/src/encodings/physical/alp.rs:314 — rust/lance-encoding/src/encodings/physical/alp.rs:314-344 | rust/lance-encoding/src/encodings/physical/alp.rs:356-383 — both copies are in the same file, so extract the 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 (21–30 lines × 2) · ×1
  • Duplicated block (21–30 lines × 2) rust/lance/src/index/frag_reuse.rs:1269 — rust/lance/src/index/frag_reuse.rs:1269-1289 | rust/lance/src/index/frag_reuse.rs:1837-1866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) rust/lance/src/index/create.rs:860 — rust/lance/src/index/create.rs:860-888 | rust/lance/src/index/create.rs:938-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) java/lance-jni/src/lib.rs:133 — java/lance-jni/src/lib.rs:133-160 | python/src/lib.rs:228-255 — 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 (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:2109 — rust/lance-index/src/scalar/inverted/builder.rs:2109-2134 | rust/lance-index/src/scalar/inverted/builder.rs:2187-2214 — both copies are in the same file, so extract the 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) · ×1
  • Duplicated block (26 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:4260 — rust/lance-index/src/scalar/inverted/wand.rs:4260-4285 | rust/lance-index/src/scalar/inverted/wand.rs:4371-4396 — both copies are in the same file, so extract the 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 (22–26 lines × 2) · ×1
  • Duplicated block (22–26 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/write.rs:166 — rust/lance/src/dataset/write/merge_insert/exec/write.rs:166-191 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:198-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • 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 (17–26 lines × 2) · ×1
  • Duplicated block (17–26 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:1200 — rust/lance/src/io/commit/conflict_resolver.rs:1200-1225 | rust/lance/src/io/commit/conflict_resolver.rs:1486-1502 — both copies are in the same file, so extract the 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 (19–25 lines × 2) · ×1
  • Duplicated block (19–25 lines × 2) rust/lance/src/dataset/mem_wal/write.rs:515 — rust/lance/src/dataset/mem_wal/write.rs:515-533 | rust/lance/src/dataset/mem_wal/write.rs:539-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) java/lance-jni/src/blocking_dataset.rs:784 — java/lance-jni/src/blocking_dataset.rs:784-806 | java/lance-jni/src/fragment.rs:359-380 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17–22 lines × 2) · ×1
  • Duplicated block (17–22 lines × 2) java/lance-jni/src/otel.rs:264 — java/lance-jni/src/otel.rs:264-280 | python/src/otel.rs:375-396 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) java/lance-jni/src/optimize.rs:99 — java/lance-jni/src/optimize.rs:99-119 | java/lance-jni/src/optimize.rs:198-218 | java/lance-jni/src/optimize.rs:312-332 — all 3 copies are in the same file, so extract the block into one function there and call 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 (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) rust/lance-index/src/vector/hnsw/remap.rs:174 — rust/lance-index/src/vector/hnsw/remap.rs:174-194 | rust/lance-index/src/vector/hnsw/remap.rs:682-701 — both copies are in the same file, so extract the 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–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) rust/lance/src/dataset.rs:1086 — rust/lance/src/dataset.rs:1086-1106 | rust/lance/src/dataset.rs:1155-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.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) rust/lance/src/io/commit/conflict_resolver.rs:331 — rust/lance/src/io/commit/conflict_resolver.rs:331-350 | rust/lance/src/io/commit/conflict_resolver.rs:393-412 | rust/lance/src/io/commit/conflict_resolver.rs:416-435 | rust/lance/src/io/commit/conflict_resolver.rs:438-457 — 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 (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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) python/src/dataset.rs:1510 — python/src/dataset.rs:1510-1529 | python/src/fragment.rs:340-358 — 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 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2593 — rust/lance-namespace-impls/src/dir/manifest.rs:2593-2610 | rust/lance-namespace-impls/src/dir/manifest.rs:2741-2760 — both copies are in the same file, so extract the 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-encoding/src/encodings/physical/alp.rs:525 — rust/lance-encoding/src/encodings/physical/alp.rs:525-542 | rust/lance-encoding/src/encodings/physical/alp.rs:594-611 | rust/lance-encoding/src/encodings/physical/alp.rs:1054-1071 — all 3 copies are in the same file, so extract the block into one function there and call 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 (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) rust/lance-index/src/scalar/zonemap.rs:1332 — rust/lance-index/src/scalar/zonemap.rs:1332-1349 | rust/lance-index/src/scalar/zonemap.rs:1870-1885 — both copies are in the same file, so extract the 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–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) rust/lance/src/index/vector/ivf.rs:5252 — rust/lance/src/index/vector/ivf.rs:5252-5269 | rust/lance/src/index/vector/ivf/streaming_hamming.rs:754-768 — 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 (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) java/lance-jni/src/blocking_dataset.rs:2547 — java/lance-jni/src/blocking_dataset.rs:2547-2563 | java/lance-jni/src/blocking_dataset.rs:2599-2615 | java/lance-jni/src/blocking_dataset.rs:2657-2673 — all 3 copies are in the same file, so extract the block into one function there and call 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–17 lines × 3) · ×1
  • Duplicated block (12–17 lines × 3) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1277 — rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1277-1288 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:406-422 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:658-674 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) java/lance-jni/src/blocking_dataset.rs:449 — java/lance-jni/src/blocking_dataset.rs:449-464 | java/lance-jni/src/transaction.rs:2426-2442 — 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 (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) python/src/indices.rs:423 — python/src/indices.rs:423-437 | python/src/indices.rs:593-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) rust/lance-encoding/src/array_encoding/physical/fsst.rs:162 — rust/lance-encoding/src/array_encoding/physical/fsst.rs:162-175 | rust/lance-encoding/src/encodings/physical/fsst.rs:55-70 | rust/lance-encoding/src/encodings/physical/fsst.rs:88-103 — 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 (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) rust/lance/src/index/vector/ivf.rs:3018 — rust/lance/src/index/vector/ivf.rs:3018-3032 | rust/lance/src/index/vector/ivf.rs:3166-3181 | rust/lance/src/index/vector/ivf.rs:3222-3237 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) rust/lance/src/dataset/optimize/remapping.rs:388 — rust/lance/src/dataset/optimize/remapping.rs:388-398 | rust/lance/src/dataset/optimize/remapping.rs:1086-1101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:1053 — rust/lance-index/src/vector/distributed/index_merger.rs:1053-1067 | rust/lance-index/src/vector/distributed/index_merger.rs:1112-1124 | rust/lance-index/src/vector/distributed/index_merger.rs:1219-1233 | rust/lance-index/src/vector/distributed/index_merger.rs:1380-1392 | rust/lance-index/src/vector/distributed/index_merger.rs:1476-1488 — 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 (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:264 — rust/lance-encoding/src/encodings/logical/primitive/dict.rs:264-278 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:347-360 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:403-416 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–15 lines × 2) · ×1
  • Duplicated block (8–15 lines × 2) python/src/file.rs:341 — python/src/file.rs:341-355 | python/src/file.rs:952-959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) rust/lance-index/src/vector/pq/storage.rs:556 — rust/lance-index/src/vector/pq/storage.rs:556-570 | rust/lance-index/src/vector/pq/storage.rs:590-601 — both copies are in the same file, so extract the 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 (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) rust/lance/src/dataset/scanner.rs:7403 — rust/lance/src/dataset/scanner.rs:7403-7416 | rust/lance/src/dataset/scanner.rs:8516-8529 | rust/lance/src/dataset/scanner.rs:8576-8589 | rust/lance/src/dataset/scanner.rs:8599-8612 — 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/compression/fsst/src/fsst.rs:976 — rust/compression/fsst/src/fsst.rs:976-989 | rust/compression/fsst/src/fsst.rs:1006-1019 | rust/compression/fsst/src/fsst.rs:1036-1047 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10–13 lines × 3) · ×1
  • Duplicated block (10–13 lines × 3) python/src/file.rs:339 — python/src/file.rs:339-351 | python/src/file.rs:502-511 | python/src/file.rs:950-959 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) rust/lance/src/dataset/optimize.rs:772 — rust/lance/src/dataset/optimize.rs:772-784 | rust/lance/src/dataset/optimize/binary_copy.rs:188-197 — 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 (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) rust/lance-namespace-impls/src/dir/manifest.rs:2914 — rust/lance-namespace-impls/src/dir/manifest.rs:2914-2925 | rust/lance-namespace-impls/src/dir/manifest.rs:3036-3047 | rust/lance-namespace-impls/src/dir/manifest.rs:3066-3077 | rust/lance-namespace-impls/src/dir/manifest.rs:3282-3293 | rust/lance-namespace-impls/src/dir/manifest.rs:3698-3709 | rust/lance-namespace-impls/src/dir/manifest.rs:3776-3787 — 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.
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:526 — rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:526-536 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:527-538 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:264-275 — 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 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7–12 lines × 2) · ×1
  • Duplicated block (7–12 lines × 2) rust/lance-index/src/vector/hnsw/builder.rs:352 — rust/lance-index/src/vector/hnsw/builder.rs:352-363 | rust/lance-index/src/vector/hnsw/builder.rs:545-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.
D4 · Code Duplication · Duplicated block (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) rust/lance-io/src/object_store/providers.rs:252 — rust/lance-io/src/object_store/providers.rs:252-259 | rust/lance-io/src/object_store/providers.rs:280-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) rust/lance-namespace-impls/src/rest.rs:991 — rust/lance-namespace-impls/src/rest.rs:991-1001 | rust/lance-namespace-impls/src/rest.rs:1057-1067 | rust/lance-namespace-impls/src/rest.rs:1457-1467 | rust/lance-namespace-impls/src/rest.rs:1505-1515 | rust/lance-namespace-impls/src/rest.rs:1749-1759 | rust/lance-namespace-impls/src/rest.rs:1837-1847 — 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 5) · ×1
  • Duplicated block (10–11 lines × 5) rust/lance/src/dataset/blob/prepared.rs:130 — rust/lance/src/dataset/blob/prepared.rs:130-140 | rust/lance/src/dataset/blob/prepared.rs:161-170 | rust/lance/src/dataset/blob/prepared.rs:179-189 | rust/lance/src/dataset/blob/prepared.rs:198-208 | rust/lance/src/dataset/blob/write.rs:962-972 — 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) rust/lance/src/dataset/scanner.rs:6421 — rust/lance/src/dataset/scanner.rs:6421-6430 | rust/lance/src/dataset/scanner.rs:8138-8148 | rust/lance/src/dataset/scanner.rs:8199-8209 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–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:82-89 | rust/lance/src/index/scalar/rtree.rs:87-97 — 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 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–10 lines × 10) · ×1
  • Duplicated block (9–10 lines × 10) rust/lance/src/index/vector/ivf.rs:885 — rust/lance/src/index/vector/ivf.rs:885-893 | rust/lance/src/index/vector/ivf.rs:904-913 | rust/lance/src/index/vector/ivf.rs:926-935 | rust/lance/src/index/vector/ivf.rs:947-956 | rust/lance/src/index/vector/ivf.rs:968-977 | rust/lance/src/index/vector/ivf.rs:988-997 | rust/lance/src/index/vector/ivf.rs:1010-1018 | rust/lance/src/index/vector/ivf.rs:1029-1038 | rust/lance/src/index/vector/ivf.rs:1051-1060 | rust/lance/src/index/vector/ivf.rs:1072-1081 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
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:994-1003 | rust/lance/src/index/scalar/minhash_lsh.rs:27-36 | rust/lance/src/index/scalar/rtree.rs:30-39 | rust/lance/src/index/scalar/zonemap.rs:22-31 — 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 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
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:120-129 | rust/lance/src/index/scalar/inverted.rs:1080-1089 | rust/lance/src/index/scalar/label_list.rs:179-188 | rust/lance/src/index/scalar/zonemap.rs:80-89 — 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 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) rust/lance/src/dataset/refs.rs:219 — rust/lance/src/dataset/refs.rs:219-228 | rust/lance/src/dataset/refs.rs:254-263 | rust/lance/src/dataset/refs.rs:269-277 | rust/lance/src/dataset/refs.rs:302-310 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (4–10 lines × 4) · ×1
  • Duplicated block (4–10 lines × 4) rust/lance-linalg/src/distance/cosine.rs:1009 — rust/lance-linalg/src/distance/cosine.rs:1009-1012 | rust/lance-linalg/src/distance/dot.rs:623-632 | rust/lance-linalg/src/distance/l2.rs:842-851 | rust/lance-linalg/src/distance/norm_l2.rs:357-366 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (2–10 lines × 5) · ×1
  • Duplicated block (2–10 lines × 5) rust/lance-linalg/src/distance/cosine.rs:561 — rust/lance-linalg/src/distance/cosine.rs:561-570 | rust/lance-linalg/src/distance/cosine.rs:1146-1153 | rust/lance-linalg/src/distance/cosine.rs:1241-1243 | rust/lance-linalg/src/distance/cosine.rs:1294-1295 | rust/lance-linalg/src/distance/cosine.rs:1296-1298 — 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 (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) java/lance-jni/src/namespace.rs:357 — java/lance-jni/src/namespace.rs:357-365 | java/lance-jni/src/namespace.rs:438-446 | java/lance-jni/src/namespace.rs:497-505 | java/lance-jni/src/namespace.rs:580-588 | java/lance-jni/src/namespace.rs:674-682 | java/lance-jni/src/namespace.rs:762-770 | java/lance-jni/src/namespace.rs:848-856 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (4–9 lines × 4) · ×1
  • Duplicated block (4–9 lines × 4) rust/lance-linalg/src/distance/cosine.rs:1020 — rust/lance-linalg/src/distance/cosine.rs:1020-1023 | rust/lance-linalg/src/distance/dot.rs:634-642 | rust/lance-linalg/src/distance/l2.rs:854-862 | rust/lance-linalg/src/distance/norm_l2.rs:367-375 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (3–9 lines × 3) · ×1
  • Duplicated block (3–9 lines × 3) rust/lance-linalg/src/distance/cosine.rs:552 — rust/lance-linalg/src/distance/cosine.rs:552-560 | rust/lance-linalg/src/distance/cosine.rs:1137-1145 | rust/lance-linalg/src/distance/cosine.rs:1234-1236 — all 3 copies are in the same file, so extract the block into one function there and call 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–9 lines × 2) · ×1
  • 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.
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.
D4 · Code Duplication · Duplicated block (7–8 lines × 4) · ×1
  • 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:34-41 — 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 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) rust/lance-index/src/scalar/btree.rs:2607 — rust/lance-index/src/scalar/btree.rs:2607-2613 | rust/lance-index/src/scalar/rtree.rs:572-579 — 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 (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) rust/lance/src/index/scalar/bitmap.rs:132 — rust/lance/src/index/scalar/bitmap.rs:132-138 | rust/lance/src/index/scalar/bloomfilter.rs:100-106 | rust/lance/src/index/scalar/label_list.rs:187-193 | rust/lance/src/index/scalar/minhash_lsh.rs:87-93 | rust/lance/src/index/scalar/rtree.rs:95-101 | rust/lance/src/index/scalar/zonemap.rs:88-94 — 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 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–7 lines × 4) · ×1
  • Duplicated block (6–7 lines × 4) rust/lance/src/io/exec/fts.rs:4417 — rust/lance/src/io/exec/fts.rs:4417-4422 | rust/lance/src/io/exec/knn.rs:1062-1067 | rust/lance/src/io/exec/rowids.rs:221-227 | rust/lance/src/io/exec/scalar_index.rs:701-707 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) rust/lance/src/io/exec/fts.rs:1242 — rust/lance/src/io/exec/fts.rs:1242-1245 | rust/lance/src/io/exec/fts.rs:1598-1602 | rust/lance/src/io/exec/fts.rs:2152-2156 — all 3 copies are in the same file, so extract the block into one function there and call 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 (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-index/src/scalar.rs:373 — 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:572-577 | rust/lance-index/src/scalar.rs:601-606 | rust/lance-index/src/scalar.rs:645-650 | rust/lance-index/src/scalar/json.rs:347-352 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) rust/lance/src/io/exec/fts.rs:3069 — rust/lance/src/io/exec/fts.rs:3069-3081 | rust/lance/src/io/exec/fts.rs:4129-4141 | rust/lance/src/io/exec/fts.rs:4544-4556 | rust/lance/src/io/exec/fts.rs:5360-5372 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) rust/lance-namespace-impls/src/rest.rs:988 — rust/lance-namespace-impls/src/rest.rs:988-992 | rust/lance-namespace-impls/src/rest.rs:1054-1058 | rust/lance-namespace-impls/src/rest.rs:1079-1083 | rust/lance-namespace-impls/src/rest.rs:1161-1165 | rust/lance-namespace-impls/src/rest.rs:1502-1506 | rust/lance-namespace-impls/src/rest.rs:1746-1750 | rust/lance-namespace-impls/src/rest.rs:1834-1838 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 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 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 25) · ×1
  • Duplicated block (6 lines × 25) java/src/main/java/org/lance/Dataset.java:1000 — java/src/main/java/org/lance/Dataset.java:1000-1005 | java/src/main/java/org/lance/Dataset.java:1023-1028 | java/src/main/java/org/lance/Dataset.java:1037-1042 | java/src/main/java/org/lance/Dataset.java:1054-1059 | java/src/main/java/org/lance/Dataset.java:1066-1071 | java/src/main/java/org/lance/Dataset.java:1083-1088 | java/src/main/java/org/lance/Dataset.java:1102-1107 | java/src/main/java/org/lance/Dataset.java:1606-1611 | java/src/main/java/org/lance/Dataset.java:1625-1630 | java/src/main/java/org/lance/Dataset.java:1656-1661 | java/src/main/java/org/lance/Dataset.java:1697-1702 | java/src/main/java/org/lance/Dataset.java:1711-1716 | java/src/main/java/org/lance/Dataset.java:1796-1801 | java/src/main/java/org/lance/Dataset.java:1813-1818 | java/src/main/java/org/lance/Dataset.java:1845-1850 | java/src/main/java/org/lance/Dataset.java:2290-2295 | java/src/main/java/org/lance/Dataset.java:2398-2403 | java/src/main/java/org/lance/Dataset.java:2440-2445 | java/src/main/java/org/lance/delta/DatasetDelta.java:57-62 | java/src/main/java/org/lance/ipc/LanceScanner.java:253-258 | 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 25 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 25 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:138-145 | 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 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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–120 lines × 2) · ×1
  • Duplicated block (74–120 lines × 2) python/python/lance/dataset.py:5041 — python/python/lance/dataset.py:5041-5160 | python/python/lance/dataset.py:5244-5317 — both copies are in the same file, so extract the 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:1639 — python/python/lance/dataset.py:1639-1761 | python/python/lance/dataset.py:1801-1830 | python/python/lance/dataset.py:2237-2261 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the 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:1639` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • 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 (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:1748 — python/python/lance/dataset.py:1748-1761 | python/python/lance/dataset.py:1817-1830 | python/python/lance/dataset.py:2248-2261 | python/python/lance/fragment.py:723-736 | python/python/lance/fragment.py:761-774 — 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:1748` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X3 · Exception handling · Swallowed exception (empty catch) · ×1
  • Swallowed exception (empty catch) python/python/ci_benchmarks/datagen/count_rows.py:71 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Minor — 108 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×30
  • Orphaned file rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.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/src/dataset/mem_wal/scanner/exec/generation_tag.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-index/src/vector/shared/partition_merger.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 python/python/lance/download.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/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.
  • Orphaned file java/src/main/java/org/lance/memwal/ShardSnapshot.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.
  • + 5 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • 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:177 — `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.py:8654 — `_check_for_numpy(query) and isinstance(query, np.ndarray)` 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/dataset.py:4106 — `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:251 — `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-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-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:152 — `(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-encoding/src/encodings/physical/alp.rs:396 — `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.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:1026 — `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:298 — `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:267 — `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:2127 — `dist < lower_bound || dist >= upper_bound` appears character-identically in 5 files — rust/lance-index/src/vector/bq/storage.rs, rust/lance-index/src/vector/flat/index.rs, rust/lance-index/src/vector/hnsw/builder.rs, rust/lance-index/src/vector/pq/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:303 — `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:529 — `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/src/index/scalar.rs:1075 — `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:1198 — `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.
  • Duplicated predicate rust/lance-file/src/versions/v2_1/reader.rs:74 — `flat.bits_per_value == 8 && flat.data.is_none()` appears character-identically in 2 files — rust/lance-file/src/versions/v2_1/reader.rs, rust/lance-file/src/versions/v2_2/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/scalar/bitmap.rs:555 — `index.frag_reuse_index.is_none() || index.batch_remapper.is_none()` appears character-identically in 3 files — rust/lance-index/src/scalar/bitmap.rs, rust/lance-index/src/scalar/bloomfilter.rs, rust/lance-index/src/scalar/btree.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-namespace-impls/src/dir/load.rs:34 — `is_child_table || !self.dir_listing_enabled || self.dir_listing_to_manifest_migration_enabled` appears character-identically in 2 files — rust/lance-namespace-impls/src/dir/load.rs, rust/lance-namespace-impls/src/dir/namespace.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-arrow/src/lib.rs:1613 — `is_pwr_two(bytes_per_value) && bytes.as_ptr().align_offset(bytes_per_value as usize) != 0` appears character-identically in 2 files — rust/lance-arrow/src/lib.rs, rust/lance-encoding/src/buffer.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.
X4 · Structured logging · Interpolated log message defeats structured logging · ×14
  • 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/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:1768 — `warn!` at line 1768 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:4647 — `warn!` at line 4647 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:408 — `warn!` at line 408 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:2172 — `info!` at line 2172 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.rs:593 — `warn!` at line 593 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/optimize.rs:1434 — `warn!` at line 1434 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:209 — `warn!` at line 209 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:313 — `info!` at line 313 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:362 — `info!` at line 362 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:591 — `info!` at line 591 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:657 — `info!` at line 657 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`.
X7 · Silent fallback defaults · Silent fallback default on Err · ×8
  • Silent fallback default on Err python/src/indices.rs:712 — `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/vector/builder.rs:1752 — `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.rs:1966 — `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/details.rs:426 — `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-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-index/src/scalar/rtree.rs:218 — `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-io/src/object_store.rs:1934 — `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 · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 25 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-io/src/object_store/read_dir.rs, rust/lance-file/src/versions/v2_3/reader.rs, rust/lance-file/src/versions/mod.rs, ci/format_vote_gate.py, rust/lance-file/src/reader/structural.rs, rust/lance-file/src/version.rs (+17 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 19 significant file(s) lose their only recent owner: rust/lance-index/src/vector/bq/ex_dot.rs, rust/lance-index/src/vector/bq/pairwise.rs, rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs, rust/lance/src/io/exec/knn/adaptive_probe.rs, rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.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 (+11 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 8 significant file(s) lose their only recent owner: rust/lance/src/index/frag_reuse_reader.rs, 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, rust/lance-table/src/system_index/frag_reuse/metadata.rs, 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: java/src/main/java/org/lance/Branch.java, java/src/main/java/org/lance/util/JsonFields.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.
D31 · IaC & Container Security · Low IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 14 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 (76 single-owned of 926 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; 926 of the 1143 production source files in this repository met that bar). They are anonymized user #5 (2 file(s)), anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (1 file(s)) (+8 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, rust/lance/src/dataset/mem_wal/scanner/exec/first_by_pk.rs, rust/lance-io/src/object_store/providers/shared_memory.rs, rust/lance-core/src/cache/backend_uri.rs, java/src/main/java/org/lance/CacheBackendConfig.java, ci/new_contributors.py, ci/review_stats.py (+11 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 8 of 33 project(s) overshoot their size bounds, lowering Project Cohesion to 5.2/10. The most over is `rust/lance` (366680 LoC, 609 module-visible types across 43 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
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 30 of 926 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; 926 of the 1143 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: rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs, rust/lance/src/dataset/mem_wal/scanner/exec/generation_tag.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, rust/lance-index/src/vector/shared/partition_merger.rs (and 22 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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 16/18 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `memtest`, `rust/lance-tools`.
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:200).
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:200).
X5 · Nullable reference types · Java packages are not null-marked everywhere · ×1
  • Java packages are not null-marked everywhere — 0/19 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.

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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-215237854d794d5ebf8a9f7fbdcced4a/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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-215237854d794d5ebf8a9f7fbdcced4a/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/watchdog-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 .54artifacts/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 .41artifacts/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 01a17df4-2006-7567-9fdd-a54a1f38d541 · 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