AI Slop Code Risk Monitor

d2l-ai/d2l-zh

SlopCodeMonitor badge for d2l-ai/d2l-zh Adjusted legacy signal; badge bands: 25 / 50 / 75 (different from dashboard bands).

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

13.2 Moderate pattern signal View on GitHub

Open-Source Code Quality, Security and Technical Debt Review

This report summarizes scanner evidence for d2l-ai/d2l-zh, a Python project with 82,781 GitHub stars. SynthScan examined 115,143 lines of code across 331 source files, recording 342 pattern matches distributed across 8 syntactic categories. The legacy adjusted pattern signal is 13.2 (Moderate 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.

13.2
Adjusted Signal
13.2
Raw Pattern Score
100%
Time Factor
2024-07-30
Last Push
82.8K
Stars
Python
Language
115.1K
Lines of Code
331
Files
342
Pattern Hits
2026-11-27
Scan Date
0.89
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 1.8/100 · LOW

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

Hallucinated Dependency & Supply Chain Risk 0.4/100 · LOW

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

Agent Over-Engineering Ratio 47.5/100 · MEDIUM

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

PR Review Velocity Impact 54.4/100 · HIGH

Which changes need focused human review? 342 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 0HIGH 293MEDIUM 0LOW 49

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 342 distinct pattern matches across 8 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.

Cross-File Repetition292 hits · 1460 pts
SeverityFileLineSnippetContext
HIGHd2l/mxnet.py0使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus`STRING
HIGHd2l/paddle.py0使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus`STRING
HIGHd2l/tensorflow.py0使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus`STRING
HIGHd2l/torch.py0使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus`STRING
HIGHd2l/mxnet.py0设置matplotlib的图表大小 defined in :numref:`sec_calculus`STRING
HIGHd2l/paddle.py0设置matplotlib的图表大小 defined in :numref:`sec_calculus`STRING
HIGHd2l/tensorflow.py0设置matplotlib的图表大小 defined in :numref:`sec_calculus`STRING
HIGHd2l/torch.py0设置matplotlib的图表大小 defined in :numref:`sec_calculus`STRING
HIGHd2l/mxnet.py0生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch`STRING
HIGHd2l/paddle.py0生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch`STRING
HIGHd2l/tensorflow.py0生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch`STRING
HIGHd2l/torch.py0生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch`STRING
HIGHd2l/mxnet.py0返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/paddle.py0返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/tensorflow.py0返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/torch.py0返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/mxnet.py0下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/paddle.py0下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/tensorflow.py0下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/torch.py0下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist`STRING
HIGHd2l/mxnet.py0计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/paddle.py0计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/tensorflow.py0计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/torch.py0计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/mxnet.py0训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/paddle.py0训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/tensorflow.py0训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/torch.py0训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/mxnet.py0训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/paddle.py0训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/tensorflow.py0训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/torch.py0训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/mxnet.py0预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/paddle.py0预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/tensorflow.py0预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/torch.py0预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch`STRING
HIGHd2l/mxnet.py0评估给定数据集上模型的损失 defined in :numref:`sec_model_selection`STRING
HIGHd2l/tensorflow.py0评估给定数据集上模型的损失 defined in :numref:`sec_model_selection`STRING
HIGHd2l/torch.py0评估给定数据集上模型的损失 defined in :numref:`sec_model_selection`STRING
HIGHd2l/mxnet.py0下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/paddle.py0下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/tensorflow.py0下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/torch.py0下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/mxnet.py0下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/paddle.py0下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/tensorflow.py0下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/torch.py0下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/mxnet.py0下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/paddle.py0下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/tensorflow.py0下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/torch.py0下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house`STRING
HIGHd2l/mxnet.py0如果存在,则返回gpu(i),否则返回cpu() defined in :numref:`sec_use_gpu`STRING
HIGHd2l/tensorflow.py0如果存在,则返回gpu(i),否则返回cpu() defined in :numref:`sec_use_gpu`STRING
HIGHd2l/torch.py0如果存在,则返回gpu(i),否则返回cpu() defined in :numref:`sec_use_gpu`STRING
HIGHd2l/mxnet.py0将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing`STRING
HIGHd2l/paddle.py0将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing`STRING
HIGHd2l/tensorflow.py0将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing`STRING
HIGHd2l/torch.py0将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing`STRING
HIGHd2l/mxnet.py0将文本行拆分为单词或字符词元 defined in :numref:`sec_text_preprocessing`STRING
HIGHd2l/paddle.py0将文本行拆分为单词或字符词元 defined in :numref:`sec_text_preprocessing`STRING
232 more matches not shown…
Hyper-Verbose Identifiers13 hits · 13 pts
SeverityFileLineSnippetContext
LOWd2l/mxnet.py2217def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len):CODE
LOWd2l/mxnet.py2257def _get_mlm_data_from_tokens(tokens, vocab):CODE
LOWd2l/paddle.py2356def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len):CODE
LOWd2l/paddle.py2396def _get_mlm_data_from_tokens(tokens, vocab):CODE
LOWd2l/torch.py2346def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len):CODE
LOWd2l/torch.py2386def _get_mlm_data_from_tokens(tokens, vocab):CODE
LOWcontrib/to-rm-mx-contrib-text/d2lzh/utils.py617def train_and_predict_rnn_gluon(model, num_hiddens, vocab_size, ctx,CODE
LOWcontrib/to-rm-mx-contrib-text/d2lzh/text/embedding.py48def get_pretrained_file_names(embedding_name=None):CODE
LOW…language-processing-pretraining/bert-dataset_origin.md102def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len):CODE
LOW…language-processing-pretraining/bert-dataset_origin.md174def _get_mlm_data_from_tokens(tokens, vocab):CODE
LOW…atural-language-processing-pretraining/bert-dataset.md82def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len):CODE
LOW…atural-language-processing-pretraining/bert-dataset.md135def _get_mlm_data_from_tokens(tokens, vocab):CODE
LOWstatic/post_latex/main.py81def _delete_discussions_title(lines):CODE
Deep Nesting9 hits · 9 pts
SeverityFileLineSnippetContext
LOWd2l/mxnet.py343CODE
LOWd2l/paddle.py381CODE
LOWd2l/paddle.py752CODE
LOWd2l/tensorflow.py359CODE
LOWd2l/torch.py370CODE
LOWd2l/torch.py739CODE
LOWci/submit-job.py126CODE
LOWcontrib/to-rm-mx-contrib-text/d2lzh/utils.py572CODE
LOWstatic/post_latex/main.py6CODE
Unused Imports9 hits · 9 pts
SeverityFileLineSnippetContext
LOWd2l/paddle.py35CODE
LOWd2l/tensorflow.py20CODE
LOWd2l/tensorflow.py26CODE
LOWd2l/torch.py7CODE
LOWd2l/torch.py43CODE
LOWcontrib/to-rm-mx-contrib-text/d2lzh/__init__.py1CODE
LOWcontrib/to-rm-mx-contrib-text/d2lzh/__init__.py2CODE
LOWcontrib/to-rm-mx-contrib-text/d2lzh/text/__init__.py1CODE
LOWcontrib/to-rm-mx-contrib-text/d2lzh/text/__init__.py2CODE
AI Structural Patterns8 hits · 8 pts
SeverityFileLineSnippetContext
LOWd2l/mxnet.py69CODE
LOWd2l/mxnet.py264CODE
LOWd2l/paddle.py66CODE
LOWd2l/paddle.py300CODE
LOWd2l/tensorflow.py64CODE
LOWd2l/tensorflow.py269CODE
LOWd2l/torch.py76CODE
LOWd2l/torch.py289CODE
Over-Commented Block8 hits · 8 pts
SeverityFileLineSnippetContext
LOWd2l/paddle.py1221 # (batch_size,查询或者“键-值”对的个数,num_hiddens)COMMENT
LOWchapter_convolutional-modern/alexnet_origin.md321COMMENT
LOWchapter_convolutional-modern/alexnet_origin.md361 return tf.keras.models.Sequential([COMMENT
LOW…deep-learning-computation/model-construction_origin.md261 # required model output based on the input `X`COMMENT
LOW…ter_attention-mechanisms/multihead-attention_origin.md201of the `transpose_qkv` function.COMMENT
LOWchapter_attention-mechanisms/nadaraya-waston.md241```{.python .input}COMMENT
LOW…ocessing-applications/sentiment-analysis-rnn_origin.md81 super(BiRNN, self).__init__(**kwargs)COMMENT
LOW…ocessing-applications/sentiment-analysis-rnn_origin.md121 # LSTM requires its input's first dimension to be the temporalCOMMENT
Empty Error Handlers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHcontrib/to-rm-mx-contrib-text/d2lzh/utils.py773except mx.base.MXNetError:CODE
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippetContext
LOWstatic/post_latex/main.py34 # Set tocdepth to 2 after Chap 1COMMENT
LOW.github/workflow_scripts/build_and_deploy.sh29# Check if the JOB_NAME is "$REPO_NAME/release"COMMENT