Repository Analysis

facebookresearch/faiss

A library for efficient similarity search and clustering of dense vectors.

4.6 Likely human-written View on GitHub
4.6
Adjusted Score
4.6
Raw Score
100%
Time Factor
2026-05-30
Last Push
40,163
Stars
C++
Language
222,956
Lines of Code
881
Files
825
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 28MEDIUM 36LOW 761

Pattern Findings

825 matches across 15 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers322 hits · 328 pts
SeverityFileLineSnippet
LOWtests/test_local_search_quantizer.py183 def test_update_codebooks_with_double(self):
LOWtests/test_local_search_quantizer.py206 def test_compute_binary_terms(self):
LOWtests/test_local_search_quantizer.py485 def test_index_accuracy_reconstruct(self):
LOWtests/test_local_search_quantizer.py491 def test_index_accuracy_cqint(self):
LOWtests/test_fast_scan_ivf.py203 def test_by_residual_no_precomputed(self):
LOWtests/test_fast_scan_ivf.py255 def test_qloss_no_residual_ip(self):
LOWtests/test_fast_scan_ivf.py258 def test_qloss_by_residual_ip(self):
LOWtests/test_fast_scan_ivf.py316 def test_equiv_pq_encode_decode(self):
LOWtests/test_fast_scan_ivf.py401 def test_no_residual_single_query(self):
LOWtests/test_fast_scan_ivf.py404 def test_by_residual_single_query(self):
LOWtests/test_fast_scan_ivf.py407 def test_no_residual_ip_single_query(self):
LOWtests/test_fast_scan_ivf.py410 def test_by_residual_ip_single_query(self):
LOWtests/test_fast_scan_ivf.py413 def test_no_residual_odd_dim_single_query(self):
LOWtests/test_fast_scan_ivf.py416 def test_by_residual_odd_dim_single_query(self):
LOWtests/test_fast_scan_ivf.py1037 def test_fastscan_defaults_roundtrip(self):
LOWtests/test_fast_scan_ivf.py1050 def test_fastscan_max_lists_num_caps_probes(self):
LOWtests/test_fast_scan_ivf.py1069 def test_fastscan_ensure_topk_full_fills_heap(self):
LOWtests/test_fast_scan_ivf.py1087 def test_fastscan_ensure_topk_full_with_restrictive_selector(self):
LOWtests/test_fast_scan_ivf.py1108 def test_fastscan_ensure_topk_full_multi_query_works(self):
LOWtests/test_fast_scan_ivf.py1133 def test_fastscan_range_honors_max_empty_result_buckets(self):
LOWtests/test_fast_scan_ivf.py1169 def test_fastscan_fields_exposed(self):
LOWtests/test_contrib.py318 def test_index_pretransformed(self):
LOWtests/test_contrib.py467 def test_range_search_preassigned_coarse_dis_none_matches_zeros(self):
LOWtests/test_contrib.py834 def test_ondisk_merge_with_shift_ids(self):
LOWtests/test_graph_based.py63 def test_hnsw_unbounded_queue(self):
LOWtests/test_graph_based.py232 def test_add_nan_vector_to_ivf_hnsw(self):
LOWtests/test_graph_based.py452 def test_nsg_supports_pre_built_knn_graph(self):
LOWtests/test_graph_based.py461 def test_nsg_with_pre_built_knn_graph_throws_when_rebuilding_via_add(self):
LOWtests/test_graph_based.py481 def test_nsg_rebuild_throws_with_pre_built_knn_graph(self):
LOWtests/test_clustering_initialization.py23def verify_centroids_from_dataset(test_case, centroids, dataset):
LOWtests/test_clustering_initialization.py63 def test_initialization_methods(self):
LOWtests/test_clustering_initialization.py123 def test_with_existing_centroids(self):
LOWtests/test_super_kmeans.py14 def test_train_rejects_too_few_points(self):
LOWtests/test_super_kmeans.py20 def test_objective_decreases_monotonically(self):
LOWtests/test_super_kmeans.py35 def test_pruned_iter_assignments_close_to_vanilla(self):
LOWtests/test_super_kmeans.py56 def test_pruning_rate_in_expected_range(self):
LOWtests/test_super_kmeans.py77 def test_pdx_offset_correct_for_unaligned_y_batch(self):
LOWtests/test_super_kmeans.py132 def test_cluster_splitting_with_many_duplicates(self):
LOWtests/test_super_kmeans.py159 def test_train_populates_kmeans_surface(self):
LOWtests/test_super_kmeans.py177 def test_final_obj_matches_vanilla_kmeans(self):
LOWtests/test_svs_py.py446 def test_svs_range_search_selected(self):
LOWtests/test_svs_py.py450 def test_svs_add_search_remove_interface(self):
LOWtests/test_svs_py.py454 def test_svs_batch_operations(self):
LOWtests/test_svs_py.py629 def test_svs_leanvec_ood_training(self):
LOWtests/test_svs_py.py634 def test_svs_leanvec_ood_training_smaller(self):
LOWtests/test_svs_py.py637 def test_svs_leanvec_ood_training_wrong_dim(self):
LOWtests/test_svs_py.py642 def test_svs_leanvec_ood_training_wrong_type(self):
LOWtests/test_svs_py.py980 def test_ivf_leanvec_ood_training(self):
LOWtests/test_svs_py.py987 def test_ivf_leanvec_ood_training_smaller_queries(self):
LOWtests/test_svs_py.py993 def test_ivf_leanvec_ood_training_wrong_dim(self):
LOWtests/test_svs_py.py1000 def test_ivf_leanvec_ood_training_wrong_type(self):
LOWtests/test_svs_py.py1008 def test_ivf_leanvec_ood_search(self):
LOWtests/test_svs_py.py1155 def test_static_ivf_add_throws(self):
LOWtests/test_svs_py.py1163 def test_static_ivf_remove_throws(self):
LOWtests/test_svs_py.py1172 def test_static_ivf_serialization(self):
LOWtests/test_svs_py.py1232 def test_static_ivf_lvq_train_search(self):
LOWtests/test_svs_py.py1242 def test_static_ivf_lvq_add_throws(self):
LOWtests/test_svs_py.py1249 def test_static_ivf_lvq_serialization(self):
LOWtests/test_svs_py.py1284 def test_static_ivf_leanvec_train_search(self):
LOWtests/test_svs_py.py1294 def test_static_ivf_leanvec_add_throws(self):
262 more matches not shown…
Over-Commented Block232 hits · 231 pts
SeverityFileLineSnippet
LOWCMakeLists.txt1# @lint-ignore-every LICENSELINT
LOWtutorial/python/11-SVS.py1# Portions Copyright (c) Meta Platforms, Inc. and affiliates.
LOWtests/test_fastscan_filter.cpp1/*
LOWtests/test_svs.cpp21 * limitations under the License.
LOWtests/test_extra_distances.py141 )
LOWtests/test_hnsw.cpp1/*
LOWtests/test_transfer_invlists.cpp1/*
LOWtests/test_svs_py.py1# Portions Copyright (c) Meta Platforms, Inc. and affiliates.
LOWtests/test_ivf_index.cpp1/*
LOWtests/test_distances_dispatch.cpp1/*
LOWtests/test_distances_dispatch.cpp21// * Functions returning an integer (fvec_L2sqr_ny_nearest's chosen
LOWtests/test_ivf_early_termination.cpp1/*
LOWtests/test_omp_exception_safety.cpp1/*
LOWtests/test_omp_exception_safety.cpp381 std::vector<idx_t> labels(1);
LOWtests/test_mmap.cpp1/*
LOWtests/test_scalar_quantizer.cpp1/*
LOWtests/test_custom_result_handler.cpp1/*
LOWtests/test_read_index_deserialize.cpp1/*
LOWtests/test_read_index_deserialize.cpp21#include <faiss/IndexBinaryHNSW.h>
LOWtests/test_read_index_deserialize.cpp161 // whose AdditiveQuantizer has M=10 but nbits vector has only 1 element.
LOWtests/test_read_index_deserialize.cpp181 // codebooks (empty vector is fine)
LOWtests/test_read_index_deserialize.cpp221 push_fourcc(buf, "Imiq");
LOWtests/test_read_index_deserialize.cpp421// IndexLattice payloads whose r2 exceeds the limit, separately from
LOWtests/test_read_index_deserialize.cpp801// Test: read_binary_multi_hash_map with crafted ilsz values that sum to
LOWtests/test_read_index_deserialize.cpp1221// Test: IndexProductResidualQuantizer codes vector size mismatch.
LOWtests/test_read_index_deserialize.cpp3641}
LOWtests/test_read_index_deserialize.cpp4281 expect_read_throws_with(buf, "fourcc");
LOWfaiss/index_factory.cpp21#include <faiss/Index2Layer.h>
LOWfaiss/index_factory.cpp41#include <faiss/IndexPQFastScan.h>
LOWfaiss/IndexFastScan.cpp1/*
LOWfaiss/IndexHNSW.h41 // When set to false, level 0 in the knn graph is not initialized.
LOWfaiss/IndexHNSW.cpp1/*
LOWfaiss/IndexHNSW.cpp21
LOWfaiss/IndexFlat.cpp1/*
LOWfaiss/IndexFlat.cpp841
LOWfaiss/AutoTune.cpp21
LOWfaiss/IndexIVFPQ.cpp21
LOWfaiss/index_io.h121// When nonzero, deserialization rejects loop-driving fields (nlist,
LOWfaiss/index_io.h141// When nonzero, deserialization rejects IndexLattice payloads whose
LOWfaiss/IndexBinaryIVF.cpp21#include <faiss/IndexLSH.h>
LOWfaiss/SuperKMeans.h1/*
LOWfaiss/IndexIVFFlatPanorama.h21/// IDEA:
LOWfaiss/IndexIVFRaBitQFastScan.cpp1/*
LOWfaiss/SuperKMeans.cpp1/*
LOWfaiss/SuperKMeans.cpp21#include <faiss/impl/AdSampling.h>
LOWfaiss/IVFlib.cpp1/*
LOWfaiss/IndexIVFRaBitQFastScan.h1/*
LOWfaiss/IndexBinaryHNSW.cpp21#include <faiss/impl/AuxIndexStructures.h>
LOWfaiss/Clustering.h41 /// If fewer than this number of training vectors per centroid are provided,
LOWfaiss/Clustering.h61
LOWfaiss/IndexRowwiseMinMax.h21/// Basically, this index performs a rowwise scaling to [0,1] of every row
LOWfaiss/clone_index.cpp21#include <faiss/IndexFlat.h>
LOWfaiss/impl/RaBitQuantizer.h21// with a Theoretical Error Bound for Approximate Nearest Neighbor Search".
LOWfaiss/impl/RaBitQuantizer.h101// abstraction layer due to its unique split encoding strategy
LOWfaiss/impl/Panorama.h21#include <cstring>
LOWfaiss/impl/Panorama.h281 /// 1. Apply ID selection filter and initialize distances
LOWfaiss/impl/RaBitQuantizer.cpp1/*
LOWfaiss/impl/RaBitQuantizerMultiBit.h1/*
LOWfaiss/impl/RaBitQUtils.h1/*
LOWfaiss/impl/ClusteringInitialization.cpp1/*
172 more matches not shown…
Cross-File Repetition27 hits · 135 pts
SeverityFileLineSnippet
HIGHtests/test_local_search_quantizer.py0check that the error is in the same ballpark as pq.
HIGHtests/test_local_search_quantizer.py0check that the error is in the same ballpark as pq.
HIGHtests/test_residual_quantizer.py0check that the error is in the same ballpark as pq.
HIGHtests/test_rabitq_fastscan.py0test serialize/deserialize preserves search results.
HIGHtests/test_rabitq_fastscan.py0test serialize/deserialize preserves search results.
HIGHtests/test_rabitq.py0test serialize/deserialize preserves search results.
HIGHtests/test_ivf_flat_panorama.py0test correctness with various n_levels parameter values
HIGHtests/test_flat_panorama.py0test correctness with various n_levels parameter values
HIGHtests/test_refine_panorama.py0test correctness with various n_levels parameter values
HIGHtests/test_ivf_flat_panorama.py0test edge case: more levels than dimension naturally supports
HIGHtests/test_flat_panorama.py0test edge case: more levels than dimension naturally supports
HIGHtests/test_refine_panorama.py0test edge case: more levels than dimension naturally supports
HIGHtests/test_ivf_flat_panorama.py0test id selectors with dataset smaller than batch size
HIGHtests/test_flat_panorama.py0test id selectors with dataset smaller than batch size
HIGHtests/test_refine_panorama.py0test id selectors with dataset smaller than batch size
HIGHtests/test_ivf_flat_panorama.py0test adding vectors incrementally in multiple batches
HIGHtests/test_flat_panorama.py0test adding vectors incrementally in multiple batches
HIGHtests/test_refine_panorama.py0test adding vectors incrementally in multiple batches
HIGHtests/test_ivf_flat_panorama.py0test the correctness of the ratio of dimensions scanned
HIGHtests/test_flat_panorama.py0test the correctness of the ratio of dimensions scanned
HIGHtests/test_refine_panorama.py0test the correctness of the ratio of dimensions scanned
HIGHcontrib/torch_utils.py0gets a faiss swig pointer from a pytorch tensor (on cpu or gpu)
HIGHcontrib/torch_utils.py0gets a faiss swig pointer from a pytorch tensor (on cpu or gpu)
HIGHcontrib/torch_utils.py0gets a faiss swig pointer from a pytorch tensor (on cpu or gpu)
HIGHcontrib/torch_utils.py0gets a faiss swig pointer from a pytorch tensor (on cpu or gpu)
HIGHcontrib/torch_utils.py0gets a faiss swig pointer from a pytorch tensor (on cpu or gpu)
HIGHcontrib/torch_utils.py0gets a faiss swig pointer from a pytorch tensor (on cpu or gpu)
Unused Imports102 hits · 97 pts
SeverityFileLineSnippet
LOWtests/test_referenced_objects.py7
LOWtests/test_referenced_objects.py7
LOWtests/test_referenced_objects.py7
LOWtests/test_referenced_objects.py7
LOWtests/test_contrib.py15
LOWtests/test_product_quantizer.py6
LOWtests/test_product_quantizer.py6
LOWtests/test_product_quantizer.py6
LOWtests/test_index_binary_from_float.py6
LOWtests/test_index_binary_from_float.py6
LOWtests/test_index_binary_from_float.py6
LOWtests/test_binary_io.py8
LOWtests/test_binary_io.py8
LOWtests/test_binary_io.py8
LOWtests/test_binary_io.py8
LOWtests/test_scalar_quantizer_correctness.py6
LOWtests/test_scalar_quantizer_correctness.py6
LOWtests/test_scalar_quantizer_correctness.py6
LOWtests/test_wheel_smoke.py174
LOWtests/test_build_blocks.py6
LOWtests/test_build_blocks.py6
LOWtests/test_build_blocks.py6
LOWtests/test_binary_factory.py6
LOWtests/test_binary_factory.py6
LOWtests/test_binary_factory.py6
LOWtests/test_index.py7
LOWtests/test_index.py7
LOWtests/test_index.py7
LOWtests/test_omp_threads_py.py6
LOWtests/test_omp_threads_py.py6
LOWtests/test_omp_threads_py.py6
LOWtests/test_omp_threads_py.py6
LOWtests/test_index_accuracy.py6
LOWtests/test_index_accuracy.py6
LOWtests/test_index_accuracy.py6
LOWtests/test_ivflib.py6
LOWtests/test_ivflib.py6
LOWtests/test_ivflib.py6
LOWtests/common_faiss_tests.py8
LOWtests/common_faiss_tests.py8
LOWtests/common_faiss_tests.py8
LOWtests/common_faiss_tests.py8
LOWtests/test_standalone_codec.py8
LOWtests/test_clustering.py6
LOWtests/test_clustering.py6
LOWtests/test_clustering.py6
LOWcontrib/torch/clustering.py14
LOWfaiss/gpu/test/test_gpu_basics.py6
LOWfaiss/gpu/test/test_gpu_basics.py6
LOWfaiss/gpu/test/test_gpu_basics.py6
LOWfaiss/gpu/test/test_gpu_basics.py6
LOWfaiss/gpu/test/test_gpu_index_refs.py6
LOWfaiss/gpu/test/test_gpu_index_ivfsq.py6
LOWfaiss/gpu/test/test_gpu_index.py6
LOWfaiss/gpu/test/test_gpu_index.py6
LOWfaiss/gpu/test/test_gpu_index.py6
LOWfaiss/gpu/test/test_gpu_index.py6
LOWfaiss/python/extra_wrappers.py13
LOWfaiss/python/__init__.py95
LOWfaiss/python/__init__.py99
42 more matches not shown…
Deep Nesting68 hits · 64 pts
SeverityFileLineSnippet
LOWtests/test_local_search_quantizer.py70
LOWtests/test_graph_based.py642
LOWtests/test_rabitq_fastscan.py169
LOWtests/test_rabitq_fastscan.py517
LOWtests/test_rabitq_fastscan.py664
LOWtests/test_rabitq_fastscan.py711
LOWtests/test_rabitq_fastscan.py765
LOWtests/test_rabitq_fastscan.py847
LOWtests/test_rabitq_fastscan.py939
LOWtests/test_ivf_flat_panorama.py716
LOWtests/test_flat_panorama.py452
LOWtests/test_flat_panorama.py682
LOWtests/test_fastscan_filter.py31
LOWtests/test_merge_index.py23
LOWtests/test_merge_index.py89
LOWtests/test_refine_panorama.py426
LOWtests/test_index_composite.py714
LOWtests/test_hnsw_panorama.py349
LOWtests/test_rabitq.py688
LOWtests/test_rabitq.py714
LOWtests/test_rabitq.py737
LOWtests/test_rabitq.py769
LOWtests/test_rabitq.py812
LOWtests/test_rabitq.py833
LOWtests/test_rabitq.py866
LOWtests/test_rabitq.py909
LOWtests/test_rabitq.py990
LOWtests/test_index_accuracy.py407
LOWtests/test_search_params.py26
LOWcontrib/exhaustive_search.py59
LOWcontrib/datasets.py426
LOWcontrib/factory_tools.py10
LOWcontrib/factory_tools.py81
LOWcontrib/big_batch_search.py234
LOWcontrib/big_batch_search.py216
LOWfaiss/gpu/test/torch_test_contrib_gpu.py263
LOWfaiss/gpu/test/torch_test_contrib_gpu.py393
LOWfaiss/gpu/test/test_gpu_index_ivfsq.py107
LOWbenchs/bench_hybrid_cpu_gpu.py215
LOWbenchs/bench_hybrid_cpu_gpu.py277
LOWbenchs/bench_quantizer.py35
LOWbenchs/bench_pq_tables.py19
LOWbenchs/bench_hnsw_prune_headroom.py53
LOWbenchs/bench_gpu_1bn.py690
LOWbenchs/bench_rabitq.py156
LOWbenchs/bench_fw/optimize.py128
LOWbenchs/bench_fw/benchmark.py128
LOWbenchs/bench_fw/benchmark.py1137
LOWbenchs/bench_fw/index.py73
LOWbenchs/bench_fw/index.py270
LOWbenchs/bench_fw/index.py587
LOWbenchs/bench_fw/index.py737
LOWbenchs/bench_fw/index.py1045
LOWbenchs/bench_fw/benchmark_io.py91
LOWbenchs/bench_fw/benchmark_io.py107
LOWbenchs/bench_fw/benchmark_io.py127
LOWbenchs/bench_fw/utils.py174
LOWbenchs/distributed_ondisk/distributed_kmeans.py139
LOWbenchs/bench_all_ivf/bench_all_ivf.py401
LOWbenchs/bench_all_ivf/parse_bench_all_ivf.py39
8 more matches not shown…
Decorative Section Separators14 hits · 45 pts
SeverityFileLineSnippet
MEDIUMCMakeLists.txt8# =============================================================================
MEDIUMCMakeLists.txt20# =============================================================================
MEDIUMtests/test_rabitq.py559# ==============================================================================
MEDIUMtests/test_rabitq.py561# ==============================================================================
MEDIUMfaiss/CMakeLists.txt6# =============================================================================
MEDIUMfaiss/CMakeLists.txt10# =============================================================================
MEDIUMfaiss/CMakeLists.txt80# =============================================================================
MEDIUMfaiss/CMakeLists.txt508# =============================================================================
MEDIUMfaiss/CMakeLists.txt513# =============================================================================
MEDIUMfaiss/gpu/CMakeLists.txt7# =============================================================================
MEDIUMfaiss/gpu/CMakeLists.txt19# =============================================================================
MEDIUMfaiss/gpu/test/CMakeLists.txt7# =============================================================================
MEDIUMfaiss/gpu/test/CMakeLists.txt19# =============================================================================
MEDIUMfaiss/utils/simd_impl/partitioning_simdlib256.h47// ── Per-TU SIMD type aliases ──────────────────────────────────────────
Verbosity Indicators14 hits · 26 pts
SeverityFileLineSnippet
LOW.github/workflows/index-io-backward-compatibility.yml23 # Step 1: Build with CMake and write files
LOW.github/workflows/index-io-backward-compatibility.yml48 # Step 2: Install conda faiss-cpu in a clean environment and read files
LOW.github/workflows/index-io-backward-compatibility.yml85 # Step 1: Install conda faiss-cpu in a clean environment and write files
LOW.github/workflows/index-io-backward-compatibility.yml114 # Step 2: Build with CMake and read files
LOWfaiss/impl/RaBitQuantizer.cpp115 // Step 1: Compute 1-bit quantization and base factors
LOWfaiss/impl/RaBitQuantizer.cpp155 // Step 2: Compute ex-bits quantization (if nb_bits > 1)
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp263 // Step 1: Compute L2 norm of residual
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp278 // Step 2: Normalize residual
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp284 // Step 3: Take absolute value
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp290 // Step 4: Find optimal scaling factor
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp293 // Step 5: Quantize to ex_bits
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp304 // Step 6: Handle negative dimensions (flip bits)
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp312 // Step 7: Pack codes into byte array
LOWfaiss/impl/RaBitQuantizerMultiBit.cpp315 // Step 8: Compute factors for distance computation
AI Slop Vocabulary9 hits · 24 pts
SeverityFileLineSnippet
MEDIUMtests/test_index_accuracy.py246 index.nprobe = 4 # hopefully more robust than 1
MEDIUMtests/test_index_accuracy.py304 index.nprobe = 4 # hopefully more robust than 1
MEDIUMfaiss/IndexPQ.h118/// statistics are robust to internal threading, but not if
MEDIUMfaiss/IndexIVFPQ.h175/// statistics are robust to internal threading, but not if
MEDIUMfaiss/impl/PanoramaStats.h17/// Statistics are not robust to internal threading nor to
MEDIUMfaiss/gpu/test/test_gpu_index.py247 # precomputed codes also utilize the coarse quantizer
LOWfaiss/python/array_conversions.py88# TODO: once deprecated classes are removed, remove the dict and just use .lower() below
MEDIUMfaiss/utils/hamming_distance/hamming_computer-avx512.h16// leverage SSE/AVX2 intrinsics.
MEDIUMfaiss/utils/hamming_distance/hamming_computer-avx2.h14// GenHammingComputer classes leverage SSE/AVX2 intrinsics.
Excessive Try-Catch Wrapping17 hits · 22 pts
SeverityFileLineSnippet
LOWtests/test_io.py577 except Exception:
LOWtests/test_io.py609 except Exception:
LOWtests/test_build_blocks.py221 except Exception:
LOW…ndex_io_backward_compatibility/cmake_conda_io_utils.py259 except Exception as e:
LOW…ndex_io_backward_compatibility/cmake_conda_io_utils.py292 except Exception as e:
LOW…ndex_io_backward_compatibility/cmake_conda_io_utils.py322 except Exception as e:
LOW…ndex_io_backward_compatibility/cmake_conda_io_utils.py352 except Exception as e:
LOWcontrib/rpc.py144 except Exception as e:
LOWfaiss/gpu/test/test_index_cpu_to_gpu.py43 except Exception as e:
LOWfaiss/gpu/test/test_index_cpu_to_gpu.py56 except Exception as e:
LOWfaiss/gpu/test/test_index_cpu_to_gpu.py92 except Exception as e:
MEDIUMfaiss/gpu/test/test_index_cpu_to_gpu.py40def verify_throws_not_implemented_exception(self, factory_string):
MEDIUMfaiss/gpu/test/test_index_cpu_to_gpu.py48def verify_clones_successfully(self, factory_string,
MEDIUMfaiss/gpu/test/test_index_cpu_to_gpu.py88def test_with_flag_set_to_false(self):
LOWbenchs/bench_all_ivf/parse_bench_all_ivf.py138 except Exception as e:
LOWdemos/offline_ivf/offline_ivf.py611 except Exception:
MEDIUMdemos/offline_ivf/offline_ivf.py599def _knn_function(self, xq, xb, k, metric, thread_id=None):
Self-Referential Comments7 hits · 21 pts
SeverityFileLineSnippet
MEDIUMtests/test_graph_based.py243 # Create a vector with NaN in the first component
MEDIUMtests/test_flat_panorama.py649 # Create a random permutation
MEDIUMtests/test_wheel_smoke_gpu.py26# This file is the faiss-gpu wheel smoke test. It also gets collected by
MEDIUMtests/test_hnsw_panorama.py427 # Create a permutation (reverse order for simplicity)
MEDIUMtests/test_index.py818 # Create the dataset
MEDIUMtests/test_search_params.py163 # Create a mask of valid IDs (those in subset)
MEDIUMfaiss/gpu/hipify.sh42 # Create a backup of the original gpu directory
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippet
LOWtests/test_svs_py.py28# Check if LVQ/LeanVec support is available
LOWtests/test_hnsw_panorama.py400 # Check if this neighbor is still in the result set
LOWfaiss/python/class_wrappers.py255 # Check if the attribute already exists (valid attribute)
LOWfaiss/python/class_wrappers.py257 # Check if it exists on the instance or class
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippet
HIGHcontrib/vecs_io.py83 Memory-mapped iterator over chunked .bvecs files. Iterates through all chunk files in order (chunk_0000.bvecs,
Example Usage Blocks3 hits · 4 pts
SeverityFileLineSnippet
LOWfaiss/impl/ClusteringInitialization.h46/// Example usage:
LOWfaiss/utils/extra_distances.h64/// Example usage:
LOWdemos/index_pq_flat_separate_codes_from_codebook.py256# # Example usage:
Slop Phrases3 hits · 4 pts
SeverityFileLineSnippet
LOWtests/test_build_blocks.py335 # make sure to test extreme cases
LOWtests/test_index_accuracy.py574 # make sure to test below and above
MEDIUMcontrib/rpc.py10This code is for demonstration purposes only, and does not include certain
Dead Code2 hits · 4 pts
SeverityFileLineSnippet
MEDIUMbenchs/bench_fw/index.py150
MEDIUMbenchs/bench_fw/index.py151