AI Slop Code Risk Monitor

twitter/the-algorithm

SlopCodeMonitor badge for twitter/the-algorithm Adjusted legacy signal; badge bands: 25 / 50 / 75 (different from dashboard bands).

Source code for the X Recommendation Algorithm

1.6 Low pattern signal View on GitHub

Open-Source Code Quality, Security and Technical Debt Review

This report summarizes scanner evidence for twitter/the-algorithm, a Scala project with 74,122 GitHub stars. SynthScan examined 637,387 lines of code across 6394 source files, recording 576 pattern matches distributed across 19 syntactic categories. The legacy adjusted pattern signal is 1.6 (Low pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

1.6
Adjusted Signal
1.6
Raw Pattern Score
100%
Time Factor
2025-09-08
Last Push
74.1K
Stars
Scala
Language
637.4K
Lines of Code
6.4K
Files
576
Pattern Hits
2026-11-27
Scan Date
0.01
HC Hit Rate

Risk Review · Payload v1

Use each vector to guide manual verification of the underlying findings.

Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-11-27.

Cognitive Ownership Risk 3.1/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 288 finding(s).

Hallucinated Dependency & Supply Chain Risk 3.1/100 · LOW

Are imports declared and package/API names verified? 224 finding(s).

Agent Over-Engineering Ratio 2.8/100 · LOW

Are wrappers, guards, and repeated structures necessary? 206 finding(s).

PR Review Velocity Impact 7.6/100 · LOW

Which changes need focused human review? 576 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 15HIGH 41MEDIUM 44LOW 476

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 576 distinct pattern matches across 19 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hallucination Indicators15 hits · 205 pts
SeverityFileLineSnippetContext
CRITICAL⚡…a/com/twitter/product_mixer/core/feature/Feature.scala33 * Accessing a failed feature via [[com.twitter.product_mixer.core.feature.featuremap.FeatureMap.get()]]COMMENT
CRITICAL⚡…a/com/twitter/product_mixer/core/feature/Feature.scala37 * a failed feature via [[com.twitter.product_mixer.core.feature.featuremap.FeatureMap.get()]]COMMENT
CRITICAL⚡…a/com/twitter/product_mixer/core/feature/Feature.scala41 * @note [[com.twitter.product_mixer.core.feature.featuremap.FeatureMap.getOrElse()]] can also be usedCOMMENT
CRITICAL⚡…a/com/twitter/product_mixer/core/feature/Feature.scala43 * [[com.twitter.product_mixer.core.feature.featuremap.FeatureMap.getOrElse()]] method callCOMMENT
CRITICAL…twitter/frigate/pushservice/rank/LoggedOutRanker.scala28 tweet.get.id -> tweet.get.counts.get.favoriteCount.getOrElse(0L)CODE
CRITICALtrust_and_safety_models/toxicity/load_model.py8from toxicity_ml_pipeline.utils.helpers import execute_commandCODE
CRITICALtrust_and_safety_models/toxicity/rescoring.py2from toxicity_ml_pipeline.utils.helpers import load_inference_func, upload_modelCODE
CRITICALtrust_and_safety_models/toxicity/train.py27from toxicity_ml_pipeline.utils.helpers import check_gpu, set_seeds, upload_modelCODE
CRITICALtrust_and_safety_models/toxicity/optim/callbacks.py7from toxicity_ml_pipeline.utils.helpers import compute_precision_fixed_recall, execute_commandCODE
CRITICALtrust_and_safety_models/toxicity/data/mb_generator.py13from toxicity_ml_pipeline.utils.helpers import execute_commandCODE
CRITICAL…st_and_safety_models/toxicity/data/dataframe_loader.py12from toxicity_ml_pipeline.utils.helpers import execute_command, execute_queryCODE
CRITICAL…n/scala/com/twitter/servo/util/WaitForServerSets.scala12 * See [[com.twitter.finagle.client.ClientRegistry.expAllRegisteredClientsResolved()]] for anCOMMENT
CRITICAL…/search/common/search/GeoQuadTreeQueryBuilderUtil.java63 return new com.twitter.search.common.query.MultiTermDisjunctionQuery(field, geoHashSet);CODE
CRITICAL…g/tweet_similarity/TweetPairFeatureHydrationUtil.scala272 Set(com.twitter.ml.featurestore.lib.UserId(queryFeaturedTweet.author.get))))CODE
CRITICAL…g/tweet_similarity/TweetPairFeatureHydrationUtil.scala282 Set(com.twitter.ml.featurestore.lib.UserId(candidateFeaturedTweet.author.get))))CODE
Unused Imports209 hits · 200 pts
SeverityFileLineSnippetContext
LOWtwml/twml/util.py15CODE
LOWtwml/twml/util.py15CODE
LOWtwml/twml/util.py15CODE
LOWtwml/twml/util.py15CODE
LOWtwml/twml/util.py25CODE
LOWtwml/twml/util.py25CODE
LOWtwml/twml/util.py25CODE
LOWtwml/twml/util.py30CODE
LOWtwml/twml/util.py37CODE
LOWtwml/twml/util.py40CODE
LOWtwml/twml/util.py40CODE
LOWtwml/twml/util.py44CODE
LOWtwml/twml/constants.py3CODE
LOWtwml/twml/constants.py3CODE
LOWtwml/twml/constants.py3CODE
LOWtwml/twml/constants.py3CODE
LOWtwml/twml/constants.py3CODE
LOWtwml/twml/constants.py3CODE
LOWtwml/twml/constants.py3CODE
LOWtwml/twml/__init__.py7CODE
LOWtwml/twml/__init__.py8CODE
LOWtwml/twml/__init__.py10CODE
LOWtwml/twml/__init__.py10CODE
LOWtwml/twml/__init__.py10CODE
LOWtwml/twml/__init__.py10CODE
LOWtwml/twml/__init__.py11CODE
LOWtwml/twml/__init__.py11CODE
LOWtwml/twml/__init__.py11CODE
LOWtwml/twml/__init__.py12CODE
LOWtwml/twml/__init__.py15CODE
LOWtwml/twml/__init__.py15CODE
LOWtwml/twml/__init__.py18CODE
LOWtwml/twml/__init__.py19CODE
LOWtwml/twml/__init__.py20CODE
LOWtwml/twml/__init__.py23CODE
LOWtwml/twml/__init__.py26CODE
LOWtwml/twml/__init__.py29CODE
LOWtwml/twml/__init__.py32CODE
LOWtwml/twml/__init__.py35CODE
LOWtwml/twml/__init__.py37CODE
LOWtwml/twml/__init__.py38CODE
LOWtwml/twml/__init__.py39CODE
LOWtwml/twml/__init__.py40CODE
LOWtwml/twml/__init__.py41CODE
LOWtwml/twml/__init__.py42CODE
LOWtwml/twml/__init__.py43CODE
LOWtwml/twml/__init__.py53CODE
LOWtwml/twml/__init__.py53CODE
LOWtwml/twml/__init__.py53CODE
LOWtwml/twml/__init__.py58CODE
LOWtwml/twml/__init__.py59CODE
LOWtwml/twml/__init__.py60CODE
LOWtwml/twml/__init__.py61CODE
LOWtwml/twml/parsers.py10CODE
LOWtwml/twml/parsers.py10CODE
LOWtwml/twml/parsers.py10CODE
LOWtwml/twml/parsers.py10CODE
LOWtwml/twml/parsers.py10CODE
LOWtwml/twml/parsers.py10CODE
LOWtwml/twml/parsers.py10CODE
149 more matches not shown…
Hyper-Verbose Identifiers117 hits · 114 pts
SeverityFileLineSnippetContext
LOW…product_mixer/core/feature/featuremap/FeatureMap.scala64 def getOrElse[Value](feature: Feature[_, Value], default: => Value): Value = {CODE
LOW…product_mixer/core/feature/featuremap/FeatureMap.scala79 private def getOrElse[Value](CODE
LOW…aturemap/featurestorev1/FeatureStoreV1FeatureMap.scala51 def getOrElseFeatureStoreV1QueryFeature[Query <: PipelineQuery, Value](CODE
LOW…aturemap/featurestorev1/FeatureStoreV1FeatureMap.scala95 def getOrElseFeatureStoreV1CandidateFeature[CODE
LOW…aturemap/featurestorev1/FeatureStoreV1FeatureMap.scala139 def getOrElseFeatureStoreV1QueryFeatureGroup[Query <: PipelineQuery](CODE
LOW…aturemap/featurestorev1/FeatureStoreV1FeatureMap.scala170 def getOrElseFeatureStoreV1CandidateFeatureGroup[CODE
LOW…aturemap/featurestorev1/FeatureStoreV1FeatureMap.scala180 def getOrElseFeatureStoreV1FeatureDataRecord(CODE
LOWtwml/twml/metrics.py945def get_binary_class_metric_fn(metrics=None):CODE
LOWtwml/twml/metrics.py1071def get_multi_binary_class_metric_fn(metrics, classes=None, class_dim=1):CODE
LOWtwml/twml/metrics.py1248def _get_uncalibrated_metric_fn(calibrated_metric_fn, keep_weight=True):CODE
LOWtwml/twml/metrics.py1307def get_multi_binary_class_uncalibrated_metric_fn(CODE
LOWtwml/twml/util.py57def _return_tensors_from_checkpoint_folder(init_dir, model_name=None):CODE
LOWtwml/twml/util.py188def get_checkpoint_variable_names(model_dir, exclude_var_names=None, exclude_scopes=None):CODE
LOWtwml/twml/util.py259def rehash_sparse_features_nbits(sp_a, nbits, hash_fn=multiplicative_hash):CODE
LOWtwml/twml/util.py458def setup_tf_logging_formatter():CODE
LOWtwml/twml/util.py734def change_name_scope_from_dir(init_scope_name, final_scope_name, save_dir):CODE
LOWtwml/twml/util.py910def get_distributed_training_job_path():CODE
LOWtwml/twml/dataset.py93def stream_block_format_dataset(CODE
LOWtwml/twml/dataset.py244def zookeeper_ordered_dataset(CODE
LOWtwml/twml/learning_rate_decay.py6def get_learning_rate_decay_fn(params):CODE
LOWtwml/twml/learning_rate_decay.py88 def bounded_inverse_time_decay_fn(learning_rate, global_step):CODE
LOWtwml/twml/argument_parser.py543def parse_comma_separated_list(element_type=str):STRING
LOWtwml/twml/contrib/feature_config_parsers.py196def create_feature_config_from_dict(config_dict, data_spec_path):CODE
LOWtwml/twml/contrib/initializers.py57def clear_init_feed_collection():CODE
LOWtwml/twml/contrib/metrics/metrics.py23def get_partial_multi_binary_class_metric_fn(metrics, classes=None, class_dim=1, predcols=None):CODE
LOWtwml/twml/contrib/metrics/metrics.py165def get_single_binary_task_metric_fn(metrics, classnames, topK=(5,5,5), use_topK=False):CODE
LOWtwml/twml/contrib/metrics/metrics.py188def get_dual_binary_tasks_metric_fn(metrics, classnames, topK=(5,5,5), use_topK=False):CODE
LOWtwml/twml/contrib/eventbus/input_fn.py12def get_eventbus_data_record_generator(eventbus_reader):CODE
LOWtwml/twml/contrib/eventbus/input_fn.py37def get_eventbus_data_record_dataset(eventbus_reader, parse_fn, batch_size):CODE
LOWtwml/twml/contrib/layers/stacked_rnn.py34def _create_bidirectional_rnn_cell(num_units, dropout, cell_type):CODE
LOWtwml/twml/contrib/layers/stacked_rnn.py53def _create_unidirectional_rnn_cell(num_units, dropout, cell_type):CODE
LOWtwml/twml/contrib/layers/embedding_lookup.py19def load_initializers_from_csv(CODE
LOWtwml/twml/contrib/layers/full_dense.py140 def _get_output_partition_sizes(out_size, num_parts):CODE
LOW…wml/contrib/feature_importances/feature_importances.py69def _infer_if_is_metric_larger_the_better(stopping_metric):CODE
LOW…wml/contrib/feature_importances/feature_importances.py83def _check_whether_tree_should_expand(baseline_performance, computed_performance, sensitivity, stopping_metric, is_metriCODE
LOW…wml/contrib/feature_importances/feature_importances.py100def _compute_multiple_permuted_performances_from_trainer(CODE
LOW…wml/contrib/feature_importances/feature_importances.py114def _get_extra_feature_group_performances(factory, trainer, parse_fn, extra_groups, feature_to_type, record_count):CODE
LOW…wml/contrib/feature_importances/feature_importances.py137def _feature_importances_tree_algorithm(CODE
LOW…wml/contrib/feature_importances/feature_importances.py253def _feature_importances_serial_algorithm(CODE
LOW…wml/contrib/feature_importances/feature_importances.py276def _process_feature_name_for_mldash(feature_name):CODE
LOW…wml/contrib/feature_importances/feature_importances.py282def compute_feature_importances(CODE
LOW…wml/contrib/feature_importances/feature_importances.py323def write_feature_importances_to_hdfs(CODE
LOW…wml/contrib/feature_importances/feature_importances.py363def write_feature_importances_to_ml_dash(trainer, feature_importances, feature_config=None):CODE
LOWtwml/twml/contrib/feature_importances/helpers.py63def _get_feature_types_from_records(records, fnames):CODE
LOWtwml/twml/contrib/feature_importances/helpers.py86def _get_feature_name_from_config(feature_config):CODE
LOWtwml/twml/contrib/utils/datasets.py8def resolve_train_and_eval_files_overlap(CODE
LOWtwml/twml/contrib/utils/datasets.py56def get_time_based_dataset_files_for_train_and_eval(CODE
LOWtwml/twml/contrib/utils/loss_fns.py77def _get_average_cross_entropy_loss(pairwise_label_scores, pairwise_predicted_scores,CODE
LOWtwml/twml/contrib/utils/loss_fns.py144def _get_ordered_predicted_scores(labels, predicted_scores, n_data):STRING
LOWtwml/twml/contrib/utils/loss_fns.py217def _get_attrank_cross_entropy(labels, logits):STRING
LOWtwml/twml/contrib/utils/loss_fns.py269def _get_listnet_cross_entropy(labels, logits):STRING
LOWtwml/twml/contrib/utils/scores.py18def get_pairwise_label_scores(labels):CODE
LOWtwml/twml/contrib/calibrators/hashing_discretizer.py15 def _create_discretizer_layer(self, n_feature, hash_map_keys, hash_map_values,CODE
LOWtwml/twml/contrib/calibrators/percentile_discretizer.py417 def _create_discretizer_layer(self, n_feature, hash_map_keys, hash_map_values,CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py57def _generate_files_by_datetime(params):CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py338def add_discretizer_arguments(parser):CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py370def add_isotonic_calibrator_arguments(parser):CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py413def calibrate_calibrator_and_export(name, calibrator, build_graph_fn, params, feature_config,CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py537def calibrate_discretizer_and_export(name, calibrator, build_graph_fn, params, feature_config):CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py618def build_percentile_discretizer_graph(features, label, mode, params, config=None):CODE
57 more matches not shown…
Synthetic Comment Markers18 hits · 98 pts
SeverityFileLineSnippetContext
HIGH…vi/thrift_bpr_adapter/thrift/src/prediction_service.rs150 features: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH…vi/thrift_bpr_adapter/thrift/src/prediction_service.rs206 prediction: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH…vi/thrift_bpr_adapter/thrift/src/prediction_service.rs275 individual_features_list: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH…vi/thrift_bpr_adapter/thrift/src/prediction_service.rs347 predictions: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH…vi/thrift_bpr_adapter/thrift/src/prediction_service.rs851 request: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH…vi/thrift_bpr_adapter/thrift/src/prediction_service.rs976 batch_request: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs166 strings: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs255 ints: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs344 longs: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs433 floats: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs522 doubles: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs611 booleans: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs702 data_type: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs703 content: f_2.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGHnavi/thrift_bpr_adapter/thrift/src/tensor.rs791 binaries: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH⚡navi/thrift_bpr_adapter/thrift/src/tensor.rs1047 dense_shape: f_1.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH⚡navi/thrift_bpr_adapter/thrift/src/tensor.rs1048 indices: f_2.expect("auto-generated code should have checked for presence of required fields"),CODE
HIGH⚡navi/thrift_bpr_adapter/thrift/src/tensor.rs1049 values: f_3.expect("auto-generated code should have checked for presence of required fields"),CODE
Decorative Section Separators28 hits · 96 pts
SeverityFileLineSnippetContext
MEDIUM⚡simclusters-ann/README.md49# -------------------------------COMMENT
MEDIUM⚡simclusters-ann/README.md51# -------------------------------COMMENT
MEDIUM⚡simclusters-ann/README.md60# -------------------------------COMMENT
MEDIUM⚡simclusters-ann/README.md62# -------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py37 # --------------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py39 # --------------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py76 # --------------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py78 # --------------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py123 # --------------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py125 # --------------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py138 # ----------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py140 # ----------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py166 # --------------------------------------------------------COMMENT
MEDIUM…vice/src/main/python/models/light_ranking/deep_norm.py168 # --------------------------------------------------------COMMENT
MEDIUM⚡…vice/src/main/python/models/light_ranking/deep_norm.py192 # --------------------------------------------COMMENT
MEDIUM⚡…vice/src/main/python/models/light_ranking/deep_norm.py194 # --------------------------------------------COMMENT
MEDIUM⚡…vice/src/main/python/models/light_ranking/deep_norm.py203 # ----------------------------------------------------------------------------------------COMMENT
MEDIUM⚡…vice/src/main/python/models/light_ranking/deep_norm.py205 # ----------------------------------------------------------------------------------------COMMENT
MEDIUM…ice/src/main/python/models/light_ranking/eval_model.py51 # -----------------------------------------------COMMENT
MEDIUM…ice/src/main/python/models/light_ranking/eval_model.py53 # -----------------------------------------------COMMENT
MEDIUM…ice/src/main/python/models/light_ranking/eval_model.py64 # -----------------------------------------------COMMENT
MEDIUM…ice/src/main/python/models/light_ranking/eval_model.py66 # -----------------------------------------------COMMENT
MEDIUM…rc/main/python/models/light_ranking/model_pools_mlp.py46 # --------------------------------------------------------COMMENT
MEDIUM…rc/main/python/models/light_ranking/model_pools_mlp.py48 # --------------------------------------------------------COMMENT
MEDIUM…rc/main/python/models/light_ranking/model_pools_mlp.py68 # --------------------------------------------------------COMMENT
MEDIUM…rc/main/python/models/light_ranking/model_pools_mlp.py70 # --------------------------------------------------------COMMENT
MEDIUM…rc/main/python/models/light_ranking/model_pools_mlp.py165 # --------------------------------------------------------COMMENT
MEDIUM…rc/main/python/models/light_ranking/model_pools_mlp.py167 # --------------------------------------------------------COMMENT
Cross-File Repetition18 hits · 90 pts
SeverityFileLineSnippetContext
HIGHtwml/twml/metrics.py0graph_output: dict that is returned by build_graph given input features. labels: target labels associated to batch. weigSTRING
HIGHtwml/twml/contrib/metrics/metrics.py0graph_output: dict that is returned by build_graph given input features. labels: target labels associated to batch. weigSTRING
HIGHtwml/twml/contrib/metrics/search_metrics.py0graph_output: dict that is returned by build_graph given input features. labels: target labels associated to batch. weigSTRING
HIGH…projects/timelines/scripts/models/earlybird/metrics.py0graph_output: dict that is returned by build_graph given input features. labels: target labels associated to batch. weigSTRING
HIGHtwml/twml/layers/partition.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/percentile_discretizer.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/isotonic.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/mdl.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/sparse_max_norm.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/full_sparse.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/stitch.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/data_record_tensor_writer.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/contrib/layers/factorization_machine.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/batch_prediction_writer.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/sequential.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/layer.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/layers/batch_prediction_tensor_writer.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
HIGHtwml/twml/contrib/layers/zscore_normalization.py0computes the output shape of the layer given the input shape. args: input_shape: a (possibly nested tuple of) `tensorshaSTRING
Over-Commented Block57 hits · 57 pts
SeverityFileLineSnippetContext
LOWtwml/libtwml/include/twml.h1#include <twml/defines.h>COMMENT
LOWtwml/libtwml/include/twml/ThriftWriter.h1#pragma onceCOMMENT
LOWtwml/libtwml/include/twml/BatchPredictionResponse.h1#pragma onceCOMMENT
LOWtwml/libtwml/include/twml/common.h1#ifndef TWML_LIBTWML_INCLUDE_TWML_COMMON_H_COMMENT
LOWtwml/libtwml/include/twml/DataRecord.h1#pragma onceCOMMENT
LOWtwml/libtwml/include/twml/BlockFormatWriter.h1#pragma onceCOMMENT
LOWtwml/libtwml/src/lib/murmur_hash3.cpp1//-----------------------------------------------------------------------------COMMENT
LOWtwml/libtwml/src/lib/hashing_discretizer_impl.cpp21 using search_method = int64_t (*)(const Tx *, const Tx, const int64_t);COMMENT
LOWtwml/libtwml/src/lib/hashing_discretizer_impl.cpp41 // Note - feature_ids may have arbitrary distribution within int32sCOMMENT
LOWtwml/libtwml/src/lib/BatchPredictionResponse.cpp1#include "internal/endianutils.h"COMMENT
LOWtwml/libtwml/src/lib/internal/endianutils.h1//COMMENT
LOWtwml/libtwml/src/lib/internal/endianutils.h21#define betoh64(x) OSSwapBigToHostInt64(x)COMMENT
LOWtwml/libtwml/src/lib/internal/endianutils.h41#endifCOMMENT
LOWtwml/libtwml/src/lib/internal/endianutils.h61#endifCOMMENT
LOWtwml/libtwml/src/lib/internal/endianutils.h81#endifCOMMENT
LOWtwml/libtwml/src/lib/internal/endianutils.h101#endifCOMMENT
LOWtwml/libtwml/src/lib/internal/endianutils.h121#define betoh64 be64tohCOMMENT
LOWtwml/libtwml/src/lib/internal/khash.h141typedef unsigned long khint64_t;COMMENT
LOWtwml/libtwml/src/lib/internal/khash.h161COMMENT
LOWtwml/libtwml/src/lib/internal/khash.h181#endifCOMMENT
LOWtwml/libtwml/src/lib/internal/utf_converter.h1#ifndef _UTF_CONVERTER_H_COMMENT
LOWtwml/libtwml/src/ops/binary_sparse_dense_matmul.cpp21COMMENT
LOWtwml/libtwml/src/ops/block_format_dataset.cpp1#include "block_format_reader.h"COMMENT
LOWtwml/libtwml/src/ops/resource_utils.h1#pragma onceCOMMENT
LOW…meters/revchron/ReverseChronTimelineQueryContext.scala61COMMENT
LOW…r/tweetypie/handler/GetStoredTweetsByUserHandler.scala141 }COMMENT
LOW…tter/tweetypie/handler/DeleteLocationDataHandler.scala21 ): Type =COMMENT
LOW…in/scala/com/twitter/tweetypie/handler/PostTweet.scala261 val contributorUserId: Option[UserId] = getContributor(userId).map(_.userId)COMMENT
LOW…/com/twitter/tweetypie/handler/SelfThreadBuilder.scala41COMMENT
LOW…com/twitter/tweetypie/handler/EditControlBuilder.scala141 // Checks for validity of an edit are implemented as proceduresCOMMENT
LOW…/com/twitter/tweetypie/handler/TweetCreationLock.scala261 // overwrite it with the tombstone. If checkAndSetCOMMENT
LOW…er/tweetypie/repository/ConversationIdRepository.scala61 convIdsFromParent <- getConversationIds(keys, _.parentId)COMMENT
LOW…ter/tweetypie/hydrator/ConversationMutedHydrator.scala41 // It is unlikely that this field will already be set, but if, forCOMMENT
LOW…la/com/twitter/tweetypie/hydrator/TweetHydration.scala601 scrubSuperfluousUrlEntities,COMMENT
LOW…scala/com/twitter/tweetypie/tflock/TFlockIndexer.scala301 } else {COMMENT
LOW…la/com/twitter/tweetypie/caching/CacheOperations.scala41 // [[CacheOperations]] instance will be tracked under this statsCOMMENT
LOW…la/com/twitter/tweetypie/caching/CacheOperations.scala61 // "found" and "not_found" above. If `stale` + `fresh` is not equalCOMMENT
LOW…la/com/twitter/tweetypie/caching/CacheOperations.scala121 // the bad entry that we just loaded.COMMENT
LOW…la/com/twitter/tweetypie/caching/CacheOperations.scala141 val exception =COMMENT
LOW…x/inverted/MultiSegmentTermDictionaryWithFastutil.java41 SearchTimerStats.export("multi_segment_term_dictionary_with_fastutil_creation",COMMENT
LOW…h/core/earlybird/index/inverted/SkipListContainer.java341 lastPointers[currentLevel] = currentPointer;COMMENT
LOW…r/search/common/relevance/entities/TwitterMessage.java501 // the id of the user who started the self-thread.COMMENT
LOW…common/converter/earlybird/BasicIndexingConverter.java521 // Additionally, it may or may not be a Retweet (if it is, then it has retweet-user-id andCOMMENT
LOW…common/converter/earlybird/BasicIndexingConverter.java541 // IS_RETWEET_FLAG should be setCOMMENT
LOW…twitter/search/common/search/TwitterIndexSearcher.java141 if (docsWithField == 0) {COMMENT
LOW…itter/search/common/schema/earlybird/FlushVersion.java121 VERSION_91("Making in_reply_to_user_id field use MPH. SEARCH-10836", true, 0),COMMENT
LOW…/routers/AbstractRecencyAndRelevanceRequestRouter.java341 long protectedMinId = getMinSearchedId(protectedResponse);COMMENT
LOW…ch/earlybird_root/mergers/EarlybirdResponseMerger.java121 // When returned by EarlybirdChainedScatterGatherService,COMMENT
LOW…ch/earlybird_root/mergers/EarlybirdResponseMerger.java401 // When merging across tiers, if we have one failed tier, we should fail the wholeCOMMENT
LOW…java/com/twitter/search/earlybird/EarlybirdServer.java481 // Lucene 6.0.0 changes how boosts are handled: "real" boosts should be wrapped into BoostQueryCOMMENT
LOW…/archive/segmentbuilder/SegmentBuilderCoordinator.java101 if (instanceNumber == FIRST_INSTANCE) {COMMENT
LOW…/search/earlybird/util/CoordinatedEarlybirdAction.java61 private final AtomicBoolean shouldSynchronize;COMMENT
LOW…/search/earlybird/search/queries/BadUserRepFilter.java101 // binary value 10000000, but will be treated as an unsigned value when decoded, and thereforeCOMMENT
LOW…ter/search/earlybird/partition/TweetCreateHandler.java461 currentSegment.getSegmentInfo().getIndexSegment().getNumDocs(),COMMENT
LOW…ter/search/earlybird/partition/TweetCreateHandler.java481 // If it's not the greatest Tweet ID we have seen, then we don't want to create aCOMMENT
LOW…ediction/features/common/TimelinesSharedFeatures.scala681 // In contrast, DISPLAY_SUGGEST_TYPE == RecycledTweet means the tweetCOMMENT
LOW…2/candidate_source/SimClustersANNCandidateSource.scala281 // The max number of candidates for a ANN QueryCOMMENT
Deep Nesting33 hits · 32 pts
SeverityFileLineSnippetContext
LOWann/src/main/python/dataflow/faiss_index_bq_dataset.py83CODE
LOWtwml/twml/metrics.py248CODE
LOWtwml/twml/metrics.py1071CODE
LOWtwml/twml/metrics.py1162CODE
LOWtwml/twml/util.py230CODE
LOWtwml/twml/learning_rate_decay.py6CODE
LOWtwml/twml/contrib/pruning.py212CODE
LOWtwml/twml/contrib/feature_config.py23CODE
LOWtwml/twml/contrib/metrics/metrics.py71CODE
LOWtwml/twml/contrib/metrics/metrics.py97CODE
LOWtwml/twml/contrib/metrics/search_metrics.py132CODE
LOWtwml/twml/contrib/metrics/search_metrics.py221CODE
LOWtwml/twml/contrib/layers/embedding_lookup.py19CODE
LOW…wml/contrib/feature_importances/feature_permutation.py81CODE
LOW…wml/contrib/feature_importances/feature_permutation.py16CODE
LOW…wml/contrib/feature_importances/feature_importances.py363CODE
LOWtwml/twml/contrib/feature_importances/helpers.py47CODE
LOWtwml/twml/contrib/feature_importances/helpers.py63CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py199CODE
LOWtwml/twml/contrib/calibrators/common_calibrators.py265CODE
LOWtwml/twml/contrib/optimizers/pruning_optimizer.py65CODE
LOWtwml/twml/trainers/trainer.py729CODE
LOWtwml/twml/trainers/trainer.py871CODE
LOWtwml/twml/trainers/trainer.py946CODE
LOWtwml/twml/trainers/trainer.py901CODE
LOWtwml/twml/tracking/experiment_tracker.py150CODE
LOW…rc/main/python/models/light_ranking/model_pools_mlp.py32CODE
LOW…e/src/main/python/models/libs/light_ranking_metrics.py223CODE
LOW…ervice/src/main/python/models/libs/warm_start_utils.py106CODE
LOWtrust_and_safety_models/toxicity/rescoring.py8CODE
LOW…_and_safety_models/toxicity/data/data_preprocessing.py64CODE
LOW…projects/timelines/scripts/models/earlybird/metrics.py9CODE
LOW…projects/timelines/scripts/models/earlybird/metrics.py23CODE
AI Structural Patterns25 hits · 24 pts
SeverityFileLineSnippetContext
LOWtwml/twml/metrics.py248CODE
LOWtwml/twml/util.py803CODE
LOWtwml/twml/dataset.py93CODE
LOWtwml/twml/dataset.py244CODE
LOWtwml/twml/input_fns.py9CODE
LOWtwml/twml/layers/full_dense.py176CODE
LOWtwml/twml/layers/sparse_max_norm.py174CODE
LOWtwml/twml/layers/full_sparse.py276CODE
LOWtwml/twml/layers/full_sparse.py78CODE
LOWtwml/twml/contrib/layers/embedding_lookup.py258CODE
LOWtwml/twml/contrib/layers/factorization_machine.py54CODE
LOWtwml/twml/contrib/layers/full_dense.py280CODE
LOWtwml/twml/contrib/layers/full_dense.py97CODE
LOW…wml/contrib/feature_importances/feature_importances.py137CODE
LOW…trib/optimizers/deep_gradient_compression_optimizer.py67CODE
LOWtwml/twml/contrib/export/exporters.py71CODE
LOWtwml/twml/trainers/trainer.py150CODE
LOWtwml/twml/trainers/trainer.py946CODE
LOWtwml/twml/trainers/trainer.py1194CODE
LOW…rc/main/python/models/light_ranking/model_pools_mlp.py32CODE
LOWpushservice/src/main/python/models/libs/model_utils.py314CODE
LOW…service/src/main/python/models/libs/get_feat_config.py37CODE
LOW…ice/src/main/python/models/heavy_ranking/lib/layers.py108CODE
LOW…ice/src/main/python/models/heavy_ranking/lib/layers.py128CODE
LOWtrust_and_safety_models/toxicity/train.py42CODE
Self-Referential Comments11 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMtwml/twml/util.py374 # Create an empty list of lists first, will be converted to right type afterwards.COMMENT
MEDIUMtwml/twml/util.py757 # Create a backup_checkpoints dirCOMMENT
MEDIUMtwml/twml/dataset.py183 # Creating a dataset from an input directoryCOMMENT
MEDIUMtwml/twml/dataset.py230 # Create a batch of datarecords and decode themCOMMENT
MEDIUMtwml/twml/dataset.py360 # Create a batch of datarecords and decode themCOMMENT
MEDIUMtwml/twml/argument_parser.py359 # Create the parser for the "exponential_learning_rate_decay_fn"STRING
MEDIUMtwml/twml/argument_parser.py373 # Create the parser for the "polynomial_learning_rate_decay_fn"STRING
MEDIUMtwml/twml/argument_parser.py395 # Create the parser for the "piecewise_constant_learning_rate_decay_fn"STRING
MEDIUMtwml/twml/argument_parser.py424 # Create the parser for the "inverse_learning_rate_decay_fn"STRING
MEDIUMtwml/twml/argument_parser.py445 # Create the parser for the "cosine_learning_rate_decay_fn"STRING
MEDIUMtwml/twml/argument_parser.py461 # Create the parser for the "cosine_restart_learning_rate_decay_fn"STRING
Verbosity Indicators12 hits · 20 pts
SeverityFileLineSnippetContext
LOW…in/scala/com/twitter/servo/cache/ForwardingCache.scala118 // otherwise, we're just writing a tombstone, so we need to check if it existsCOMMENT
LOW⚡…n/scala/com/twitter/home_mixer/util/RerankerUtil.scala48 // Step 1: Transpose scores to group by headsCOMMENT
LOW⚡…n/scala/com/twitter/home_mixer/util/RerankerUtil.scala53 // Step 2: Get max scores per headCOMMENT
LOW⚡…n/scala/com/twitter/home_mixer/util/RerankerUtil.scala56 // Step 3: Use max scores to get per head transformed scoresCOMMENT
LOW…d/queryparser/HighFrequencyTermPairRewriteVisitor.java95 // Step 1: extract high frequency term pairs and phrases.COMMENT
LOW…d/queryparser/HighFrequencyTermPairRewriteVisitor.java106 // Step 2: rewrite (safely).COMMENT
LOW…rlybird/archive/segmentbuilder/NotYetBuiltSegment.java37 * In both cases, we need to check if the segment can now be marked as BUILT_AND_FINALIZED.COMMENT
LOW…gregates/real_time/TimelinesStormAggregateSource.scala94 // Step 1: => LogEventCOMMENT
LOW…gregates/real_time/TimelinesStormAggregateSource.scala104 // Step 1: => LogEventCOMMENT
LOW…gregates/real_time/TimelinesStormAggregateSource.scala116 // Step 1: => LogEventCOMMENT
LOW…gregates/real_time/TimelinesStormAggregateSource.scala140 // Step 2:COMMENT
LOW…gregates/real_time/TimelinesStormAggregateSource.scala174 // Step 3: Join with Feature Store featuresCOMMENT
Empty Error Handlers4 hits · 20 pts
SeverityFileLineSnippetContext
HIGHtwml/twml/contrib/export/export_fn.py246except NameError:CODE
HIGHtrust_and_safety_models/toxicity/utils/helpers.py14except ModuleNotFoundError:CODE
HIGHtrust_and_safety_models/toxicity/utils/helpers.py30except subprocess.CalledProcessError:CODE
HIGHtrust_and_safety_models/toxicity/utils/helpers.py36except subprocess.CalledProcessError:CODE
Excessive Try-Catch Wrapping14 hits · 14 pts
SeverityFileLineSnippetContext
LOWtwml/twml/contrib/eventbus/reader.py108 except Exception as e:CODE
LOWtwml/twml/contrib/eventbus/reader.py118 except Exception as e:CODE
MEDIUMtwml/twml/contrib/eventbus/reader.py113def close(self):CODE
LOW…wml/contrib/feature_importances/feature_importances.py388 except Exception as ex:CODE
LOWtwml/twml/trainers/trainer.py372 except Exception as err:STRING
LOWtwml/twml/trainers/trainer.py919 except Exception as e:STRING
LOWtwml/twml/tracking/experiment_tracker.py203 except Exception as err:CODE
LOWtwml/twml/tracking/experiment_tracker.py214 except Exception as err:CODE
LOWtwml/twml/tracking/experiment_tracker.py228 except Exception as err:CODE
LOWtwml/twml/tracking/experiment_tracker.py264 except Exception as err:CODE
LOWtwml/twml/tracking/experiment_tracker.py318 except Exception as err:CODE
LOWtwml/twml/tracking/experiment_tracker.py414 except Exception as err:CODE
LOW…st_and_safety_models/toxicity/data/dataframe_loader.py76 except Exception:CODE
LOW…st_and_safety_models/toxicity/data/dataframe_loader.py87 except Exception:CODE
Structural Annotation Overuse6 hits · 11 pts
SeverityFileLineSnippetContext
LOW⚡…n/scala/com/twitter/home_mixer/util/RerankerUtil.scala48 // Step 1: Transpose scores to group by headsCOMMENT
LOW⚡…n/scala/com/twitter/home_mixer/util/RerankerUtil.scala53 // Step 2: Get max scores per headCOMMENT
LOW⚡…n/scala/com/twitter/home_mixer/util/RerankerUtil.scala56 // Step 3: Use max scores to get per head transformed scoresCOMMENT
LOW…d/queryparser/HighFrequencyTermPairRewriteVisitor.java95 // Step 1: extract high frequency term pairs and phrases.COMMENT
LOW…d/queryparser/HighFrequencyTermPairRewriteVisitor.java106 // Step 2: rewrite (safely).COMMENT
LOW…gregates/real_time/TimelinesStormAggregateSource.scala174 // Step 3: Join with Feature Store featuresCOMMENT
AI Slop Vocabulary4 hits · 10 pts
SeverityFileLineSnippetContext
LOWtwml/twml/contrib/feature_importances/helpers.py33 # If the strings are the same, just return the full stringCOMMENT
MEDIUM…ons/common/clients/socialgraph/SocialGraphClient.scala32 // prefer to default value to better utilize the caching function of stitchCOMMENT
MEDIUM…main/scala/com/twitter/tsp/stores/TweetInfoStore.scala126 // There many different types of videos. To be robust to new types being added, we just useCOMMENT
MEDIUM…witter/search/earlybird/archive/ArchiveTimeSlicer.java101 // partition does not exist. This check makes the code more robust against futureCOMMENT
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHtwml/twml/util.py594List files matching `base_path/dt_prefix_format/*.extension` for the requested datetime range. Args: base_path: STRING
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM…mer_executor/CandidateFeatureTransformerExecutor.scala82 * It's worth noting that the outer Seq is bounded by the number of Transformers that areCOMMENT
Redundant / Tautological Comments2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtwml/twml/contrib/calibrators/percentile_discretizer.py116 # Check if we have less values than bin_valsCOMMENT
LOWtwml/twml/trainers/trainer.py343 # Check if should delete the tsd running this training job. In certain use case whenSTRING
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWnavi/navi/src/onnx_model.rs204 //TODO: implement a generic online warmup for all runtimesCOMMENT