AI Slop Code RIsk Monitor

mindee/doctr

docTR (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning. Ongoing development and maintenance by t2k.

21.0 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for mindee/doctr, a Python project with 6,386 GitHub stars. SynthScan examined 57,459 lines of code across 306 source files, recording 801 pattern matches distributed across 17 syntactic categories. The legacy adjusted pattern signal is 21.0 (Elevated 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.

21.0
Adjusted Signal
21.0
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
6.4K
Stars
Python
Language
57.5K
Lines of Code
306
Files
801
Pattern Hits
2026-10-12
Scan Date
0.34
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 28.7/100 · MEDIUM

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

Hallucinated Dependency & Supply Chain Risk 14.3/100 · LOW

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

Agent Over-Engineering Ratio 56.0/100 · HIGH

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

PR Review Velocity Impact 68.8/100 · HIGH

Which changes need focused human review? 801 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

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

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 104MEDIUM 8LOW 689

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 801 distinct pattern matches across 17 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 Repetition98 hits · 490 pts
SeverityFileLineSnippetContext
HIGHreferences/classification/train_orientation.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/classification/train_character.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/layout/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/table/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/recognition/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/detection/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/classification/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHreferences/layout/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHreferences/detection/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHreferences/recognition/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHreferences/classification/utils.py0turn a cli device spec (none, "cpu", "mps", "cuda", "cuda:1", 0) into a torch device. with `none`, pick cuda if availablSTRING
HIGHreferences/layout/utils.py0turn a cli device spec (none, "cpu", "mps", "cuda", "cuda:1", 0) into a torch device. with `none`, pick cuda if availablSTRING
HIGHreferences/table/utils.py0turn a cli device spec (none, "cpu", "mps", "cuda", "cuda:1", 0) into a torch device. with `none`, pick cuda if availablSTRING
HIGHreferences/recognition/utils.py0turn a cli device spec (none, "cpu", "mps", "cuda", "cuda:1", 0) into a torch device. with `none`, pick cuda if availablSTRING
HIGHreferences/detection/utils.py0turn a cli device spec (none, "cpu", "mps", "cuda", "cuda:1", 0) into a torch device. with `none`, pick cuda if availablSTRING
HIGHreferences/classification/utils.py0device holding the parameters of a model (works through ddp wrappers).STRING
HIGHreferences/layout/utils.py0device holding the parameters of a model (works through ddp wrappers).STRING
HIGHreferences/table/utils.py0device holding the parameters of a model (works through ddp wrappers).STRING
HIGHreferences/recognition/utils.py0device holding the parameters of a model (works through ddp wrappers).STRING
HIGHreferences/detection/utils.py0device holding the parameters of a model (works through ddp wrappers).STRING
HIGHreferences/classification/utils.py0save the model weights as `<output_dir>/<name>.pt`. args: model: the model to save (unwrapped from ddp if needed) outputSTRING
HIGHreferences/layout/utils.py0save the model weights as `<output_dir>/<name>.pt`. args: model: the model to save (unwrapped from ddp if needed) outputSTRING
HIGHreferences/table/utils.py0save the model weights as `<output_dir>/<name>.pt`. args: model: the model to save (unwrapped from ddp if needed) outputSTRING
HIGHreferences/recognition/utils.py0save the model weights as `<output_dir>/<name>.pt`. args: model: the model to save (unwrapped from ddp if needed) outputSTRING
HIGHreferences/detection/utils.py0save the model weights as `<output_dir>/<name>.pt`. args: model: the model to save (unwrapped from ddp if needed) outputSTRING
HIGHreferences/classification/utils.py0write the run metadata as `<output_dir>/<name>.json`. the metadata (architecture, task settings such as class names or vSTRING
HIGHreferences/layout/utils.py0write the run metadata as `<output_dir>/<name>.json`. the metadata (architecture, task settings such as class names or vSTRING
HIGHreferences/table/utils.py0write the run metadata as `<output_dir>/<name>.json`. the metadata (architecture, task settings such as class names or vSTRING
HIGHreferences/recognition/utils.py0write the run metadata as `<output_dir>/<name>.json`. the metadata (architecture, task settings such as class names or vSTRING
HIGHreferences/detection/utils.py0write the run metadata as `<output_dir>/<name>.json`. the metadata (architecture, task settings such as class names or vSTRING
HIGHreferences/classification/utils.py0common run description written next to every checkpoint: versions, git revision and the full arguments.STRING
HIGHreferences/layout/utils.py0common run description written next to every checkpoint: versions, git revision and the full arguments.STRING
HIGHreferences/table/utils.py0common run description written next to every checkpoint: versions, git revision and the full arguments.STRING
HIGHreferences/recognition/utils.py0common run description written next to every checkpoint: versions, git revision and the full arguments.STRING
HIGHreferences/detection/utils.py0common run description written next to every checkpoint: versions, git revision and the full arguments.STRING
HIGHreferences/layout/ddp_utils.py0whether a process group with more than one rank is activeSTRING
HIGHreferences/table/ddp_utils.py0whether a process group with more than one rank is activeSTRING
HIGHreferences/recognition/ddp_utils.py0whether a process group with more than one rank is activeSTRING
HIGHreferences/detection/ddp_utils.py0whether a process group with more than one rank is activeSTRING
HIGHreferences/layout/ddp_utils.py0whether this process is rank 0 (always true when not distributed)STRING
HIGHreferences/table/ddp_utils.py0whether this process is rank 0 (always true when not distributed)STRING
HIGHreferences/recognition/ddp_utils.py0whether this process is rank 0 (always true when not distributed)STRING
HIGHreferences/detection/ddp_utils.py0whether this process is rank 0 (always true when not distributed)STRING
HIGHreferences/layout/ddp_utils.py0sum a short list of scalars across all ranks. no-op when not distributedSTRING
HIGHreferences/table/ddp_utils.py0sum a short list of scalars across all ranks. no-op when not distributedSTRING
HIGHreferences/recognition/ddp_utils.py0sum a short list of scalars across all ranks. no-op when not distributedSTRING
HIGHreferences/detection/ddp_utils.py0sum a short list of scalars across all ranks. no-op when not distributedSTRING
HIGHreferences/layout/ddp_utils.py0concatenate a per-rank list into the full list, in rank orderSTRING
HIGHreferences/table/ddp_utils.py0concatenate a per-rank list into the full list, in rank orderSTRING
HIGHreferences/recognition/ddp_utils.py0concatenate a per-rank list into the full list, in rank orderSTRING
HIGHreferences/detection/ddp_utils.py0concatenate a per-rank list into the full list, in rank orderSTRING
HIGHreferences/layout/ddp_utils.py0merge per-rank validation state so `summary()` reflects the whole validation set args: val_metric: the metric instance tSTRING
HIGHreferences/table/ddp_utils.py0merge per-rank validation state so `summary()` reflects the whole validation set args: val_metric: the metric instance tSTRING
HIGHreferences/recognition/ddp_utils.py0merge per-rank validation state so `summary()` reflects the whole validation set args: val_metric: the metric instance tSTRING
HIGHreferences/detection/ddp_utils.py0merge per-rank validation state so `summary()` reflects the whole validation set args: val_metric: the metric instance tSTRING
HIGHreferences/layout/ddp_utils.py0context manager that lets rank 0 populate the doctr cache before the others read itSTRING
HIGHreferences/table/ddp_utils.py0context manager that lets rank 0 populate the doctr cache before the others read itSTRING
HIGHreferences/recognition/ddp_utils.py0context manager that lets rank 0 populate the doctr cache before the others read itSTRING
HIGHreferences/detection/ddp_utils.py0context manager that lets rank 0 populate the doctr cache before the others read itSTRING
HIGHreferences/layout/ddp_utils.py0split a dataset across ranks without padding, so no sample is evaluated twiceSTRING
38 more matches not shown…
Hyper-Verbose Identifiers298 hits · 277 pts
SeverityFileLineSnippetContext
LOWreferences/detection/train.py66def convert_to_multiclass_targets(targets: list) -> list[dict[str, np.ndarray]]:CODE
LOWtests/conftest.py106def mock_artefact_image_stream():CODE
LOWtests/common/test_utils_fonts.py26def test_get_font_respects_size():CODE
LOWtests/common/test_utils_fonts.py33def test_get_font_explicit_family():CODE
LOWtests/common/test_utils_fonts.py46def test_get_font_resolution_is_cached():CODE
LOWtests/common/test_utils_fonts.py70def test_get_font_candidates_only_lists_installed_fonts():CODE
LOWtests/common/test_utils_fonts.py79def test_get_font_candidates_skips_missing(monkeypatch):CODE
LOWtests/common/test_models_builder.py194def test_documentbuilder_layout():CODE
LOWtests/common/test_models_builder.py269def test_documentbuilder_tables():CODE
LOWtests/common/test_models_builder.py366def test_kiedocumentbuilder_layout():CODE
LOWtests/common/test_models_builder.py482def test_documentbuilder_tables_straight_geometry():CODE
LOWtests/common/test_models_builder.py529def test_documentbuilder_argument_length_validation():CODE
LOWtests/common/test_models_builder.py561def test_sort_boxes_degenerate_heights():CODE
LOWtests/common/test_models_builder.py569def test_documentbuilder_table_cell_scores():CODE
LOWtests/common/test_models_builder.py601def test_documentbuilder_tables_empty_cells():CODE
LOWtests/common/test_models_builder.py620def test_documentbuilder_keep_reading_order():CODE
LOWtests/common/test_models_builder.py678def test_documentbuilder_keep_reading_order_keeps_figures():CODE
LOWtests/common/test_models_builder.py716def test_documentbuilder_keep_reading_order_rotated():CODE
LOWtests/common/test_models_builder.py783def test_documentbuilder_keep_reading_order_all_flag_combinations():CODE
LOWtests/common/test_models_builder.py804def test_documentbuilder_keep_reading_order_without_resolve_lines():CODE
LOWtests/common/test_models_builder.py815def test_documentbuilder_keep_reading_order_prefers_layout_furniture():CODE
LOWtests/common/test_models_builder.py840def test_documentbuilder_keep_reading_order_without_resolve_lines_rotated():CODE
LOWtests/common/test_models_builder.py865def test_documentbuilder_keep_reading_order_no_double_sort_across_exports():CODE
LOWtests/common/test_models_builder.py899def test_documentbuilder_tables_multi_word_cells():CODE
LOWtests/common/test_models_builder.py932def test_documentbuilder_tables_nearest_cell_fallback():CODE
LOWtests/common/test_models_builder.py957def test_documentbuilder_tables_rotated_geometry():CODE
LOWtests/common/test_models_builder.py994def test_documentbuilder_tables_without_words():CODE
LOWtests/common/test_models_builder.py1011def test_documentbuilder_sort_boxes_mixed_rotation():CODE
LOWtests/common/test_models_builder.py1028def test_documentbuilder_tables_skips_empty_grids():CODE
LOWtests/common/test_utils_geometry.py81def test_resolve_enclosing_bbox():CODE
LOWtests/common/test_utils_geometry.py87def test_resolve_enclosing_rbbox():CODE
LOWtests/common/test_utils_geometry.py186def test_remove_image_padding():CODE
LOWtests/common/test_utils_geometry.py226def test_convert_to_relative_coords(abs_geoms, img_size, rel_geoms):CODE
LOWtests/common/test_utils_geometry.py333def test_straighten_page_inverse(angle, shape):CODE
LOWtests/common/test_utils_geometry.py362def test_straighten_page_projected_corner_clamp():CODE
LOWtests/common/test_io_figures.py100def test_figure_encoder_validation(tmp_path):CODE
LOW⚡tests/common/test_io_figures.py126def test_figure_encoder_modes(tmp_path):CODE
LOWtests/common/test_io_figures.py163def test_figure_encoder_does_not_pin_pages():CODE
LOWtests/common/test_io_figures.py181def test_figure_encoder_releases_its_sources():CODE
LOWtests/common/test_io_figures.py199def test_referenced_figures_of_several_documents_share_a_directory(tmp_path):CODE
LOWtests/common/test_io_figures.py223def test_figure_encoder_path_prefix_defaults_to_image_dir(tmp_path, monkeypatch, image_dir, expected):CODE
LOWtests/common/test_io_figures.py253def test_figure_encoder_path_prefix_is_portable(tmp_path, path_prefix, expected):CODE
LOWtests/common/test_datasets_utils.py24def test_translate_unknown_vocab():CODE
LOWtests/common/test_datasets_utils.py46def test_encode_string_unknown_char():CODE
LOWtests/common/test_datasets_utils.py51def test_encode_string_duplicate_vocab_chars():CODE
LOWtests/common/test_datasets_utils.py108def test_convert_target_to_relative(target, mock_image_stream):CODE
LOWtests/common/test_datasets_utils.py125def test_crop_bboxes_from_image(geoms, mock_image_path):CODE
LOWtests/common/test_datasets_utils.py142def test_pre_transform_multiclass():CODE
LOWtests/common/test_datasets.py14def test_synthesize_text_img_rejects_inkless_text(text):CODE
LOWtests/common/test_datasets.py20def test_synthesize_text_img_keeps_the_whole_glyph(text):CODE
LOWtests/common/test_datasets.py35def test_renders_char_smoke_on_a_real_font():CODE
LOWtests/common/test_datasets.py41def test_renders_char_rejects_blank_and_notdef(monkeypatch):CODE
LOW⚡tests/common/test_datasets.py54def test_fonts_per_char_falls_back_to_system_fonts(monkeypatch):CODE
LOW⚡tests/common/test_datasets.py64def test_fonts_per_char_accepts_whitespace():CODE
LOW⚡tests/common/test_datasets.py68def test_fonts_per_char_raises_when_no_font_renders(monkeypatch):CODE
LOW⚡tests/common/test_datasets.py76def test_resolve_fonts_raises_when_font_is_missing():CODE
LOWtests/common/test_models_reading_order.py35def test_detect_text_direction(texts, language, expected):CODE
LOWtests/common/test_models_reading_order.py39def test_normalize_layout_label():CODE
LOWtests/common/test_models_reading_order.py69def test_sort_reading_order_basic():CODE
LOWtests/common/test_models_reading_order.py81def test_sort_reading_order_columns():CODE
238 more matches not shown…
Unused Imports134 hits · 132 pts
SeverityFileLineSnippetContext
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py2CODE
LOWdoctr/datasets/__init__.py1CODE
LOWdoctr/datasets/__init__.py2CODE
LOWdoctr/datasets/__init__.py3CODE
LOWdoctr/datasets/__init__.py4CODE
LOWdoctr/datasets/__init__.py5CODE
LOWdoctr/datasets/__init__.py6CODE
LOWdoctr/datasets/__init__.py7CODE
LOWdoctr/datasets/__init__.py8CODE
LOWdoctr/datasets/__init__.py9CODE
LOWdoctr/datasets/__init__.py10CODE
LOWdoctr/datasets/__init__.py11CODE
LOWdoctr/datasets/__init__.py12CODE
LOWdoctr/datasets/__init__.py13CODE
LOWdoctr/datasets/__init__.py14CODE
LOWdoctr/datasets/__init__.py15CODE
LOWdoctr/datasets/__init__.py16CODE
LOWdoctr/datasets/__init__.py17CODE
LOWdoctr/datasets/__init__.py18CODE
LOWdoctr/datasets/__init__.py19CODE
LOWdoctr/datasets/__init__.py20CODE
LOWdoctr/datasets/__init__.py21CODE
LOWdoctr/datasets/__init__.py22CODE
LOWdoctr/datasets/__init__.py23CODE
LOWdoctr/datasets/__init__.py24CODE
LOWdoctr/datasets/datasets/__init__.py1CODE
LOWdoctr/datasets/generator/__init__.py1CODE
LOWdoctr/io/__init__.py1CODE
LOWdoctr/io/__init__.py2CODE
LOWdoctr/io/__init__.py3CODE
LOWdoctr/io/__init__.py4CODE
LOWdoctr/io/__init__.py5CODE
LOWdoctr/io/__init__.py6CODE
LOWdoctr/io/__init__.py7CODE
LOWdoctr/io/figures.py20CODE
LOWdoctr/io/figures.py20CODE
LOWdoctr/io/exporters.py20CODE
LOWdoctr/io/exporters.py20CODE
LOWdoctr/io/image/__init__.py1CODE
LOWdoctr/io/image/__init__.py2CODE
LOWdoctr/utils/__init__.py1CODE
LOWdoctr/utils/__init__.py2CODE
LOWdoctr/utils/__init__.py3CODE
LOWdoctr/utils/__init__.py4CODE
LOWdoctr/models/__init__.py1CODE
LOWdoctr/models/__init__.py2CODE
LOWdoctr/models/__init__.py3CODE
LOWdoctr/models/__init__.py4CODE
LOWdoctr/models/__init__.py5CODE
LOWdoctr/models/__init__.py6CODE
LOWdoctr/models/__init__.py7CODE
LOWdoctr/models/classification/__init__.py1CODE
LOWdoctr/models/classification/__init__.py2CODE
LOWdoctr/models/classification/__init__.py3CODE
74 more matches not shown…
Modern Structural Boilerplate121 hits · 121 pts
SeverityFileLineSnippetContext
LOWreferences/layout/ddp_utils.py13__all__ = [CODE
LOWreferences/table/ddp_utils.py13__all__ = [CODE
LOWreferences/recognition/ddp_utils.py13__all__ = [CODE
LOWreferences/detection/ddp_utils.py13__all__ = [CODE
LOWdoctr/file_utils.py9__all__ = ["requires_package", "CLASS_NAME"]CODE
LOWdoctr/file_utils.py11logger = logging.getLogger(__name__)CODE
LOWdoctr/datasets/recognition.py13__all__ = ["RecognitionDataset"]CODE
LOWdoctr/datasets/synthtext.py18__all__ = ["SynthText"]CODE
LOWdoctr/datasets/detection.py18__all__ = ["DetectionDataset"]CODE
LOWdoctr/datasets/coco_text.py17__all__ = ["COCOTEXT"]CODE
LOWdoctr/datasets/orientation.py13__all__ = ["OrientationDataset"]CODE
LOWdoctr/datasets/table_structure.py19__all__ = ["TableStructureDataset"]CODE
LOWdoctr/datasets/layout.py16__all__ = ["LayoutDataset"]CODE
LOWdoctr/datasets/cord.py17__all__ = ["CORD"]CODE
LOWdoctr/datasets/mjsynth.py13__all__ = ["MJSynth"]CODE
LOWdoctr/datasets/wildreceipt.py17__all__ = ["WILDRECEIPT"]CODE
LOWdoctr/datasets/doc_artefacts.py14__all__ = ["DocArtefacts"]CODE
LOWdoctr/datasets/svhn.py16__all__ = ["SVHN"]CODE
LOWdoctr/datasets/iiit5k.py17__all__ = ["IIIT5K"]CODE
LOWdoctr/datasets/imgur5k.py20__all__ = ["IMGUR5K"]CODE
LOWdoctr/datasets/ic13.py17__all__ = ["IC13"]CODE
LOWdoctr/datasets/ocr.py15__all__ = ["OCRDataset"]CODE
LOWdoctr/datasets/ic03.py16__all__ = ["IC03"]CODE
LOWdoctr/datasets/utils.py22__all__ = [CODE
LOWdoctr/datasets/vocabs.py9__all__ = ["VOCABS"]CODE
LOWdoctr/datasets/funsd.py17__all__ = ["FUNSD"]CODE
LOWdoctr/datasets/sroie.py17__all__ = ["SROIE"]CODE
LOWdoctr/datasets/iiithws.py14__all__ = ["IIITHWS"]CODE
LOWdoctr/datasets/svt.py16__all__ = ["SVT"]CODE
LOWdoctr/datasets/datasets/pytorch.py18__all__ = ["AbstractDataset", "VisionDataset"]CODE
LOWdoctr/datasets/datasets/base.py15__all__ = ["_AbstractDataset", "_VisionDataset"]CODE
LOWdoctr/datasets/generator/pytorch.py8__all__ = ["CharacterGenerator", "WordGenerator"]CODE
LOWdoctr/io/elements.py22__all__ = [CODE
LOWdoctr/io/html.py8__all__ = ["read_html"]CODE
LOWdoctr/io/pdf.py13__all__ = ["read_pdf"]CODE
LOWdoctr/io/reader.py18__all__ = ["DocumentFile"]CODE
LOWdoctr/io/figures.py22__all__ = [CODE
LOWdoctr/io/exporters.py22__all__ = [CODE
LOWdoctr/io/image/pytorch.py15__all__ = ["tensor_from_pil", "read_img_as_tensor", "decode_img_as_tensor", "tensor_from_numpy", "get_img_shape"]CODE
LOWdoctr/io/image/base.py13__all__ = ["read_img_as_numpy"]CODE
LOWdoctr/utils/metrics.py12__all__ = [CODE
LOWdoctr/utils/common_types.py12__all__ = ["Point2D", "BoundingBox", "Polygon4P", "Polygon", "Bbox", "Sample"]CODE
LOWdoctr/utils/visualization.py17__all__ = ["visualize_page", "visualize_kie_page", "draw_boxes"]CODE
LOWdoctr/utils/repr.py9__all__ = ["NestedObject"]CODE
LOWdoctr/utils/geometry.py13__all__ = [CODE
LOWdoctr/utils/reconstitution.py16__all__ = ["synthesize_page", "synthesize_kie_page"]CODE
LOWdoctr/utils/reconstitution.py18logger = logging.getLogger(__name__)CODE
LOWdoctr/utils/fonts.py12__all__ = ["get_font", "get_font_candidates"]CODE
LOWdoctr/utils/fonts.py14logger = logging.getLogger(__name__)CODE
LOWdoctr/utils/data.py18__all__ = ["download_from_url"]CODE
LOWdoctr/utils/data.py20logger = logging.getLogger(__name__)CODE
LOWdoctr/utils/multithreading.py15__all__ = ["multithread_exec"]CODE
LOWdoctr/models/zoo.py16__all__ = ["ocr_predictor", "kie_predictor"]CODE
LOWdoctr/models/core.py11__all__ = ["BaseModel"]CODE
LOWdoctr/models/builder.py35__all__ = ["DocumentBuilder"]CODE
LOWdoctr/models/_utils.py18__all__ = [CODE
LOWdoctr/models/classification/zoo.py14__all__ = ["crop_orientation_predictor", "page_orientation_predictor"]CODE
LOWdoctr/models/classification/magc_resnet/pytorch.py19__all__ = ["magc_resnet31"]CODE
LOWdoctr/models/classification/mobilenet/pytorch.py19__all__ = [CODE
LOWdoctr/models/classification/vip/pytorch.py26__all__ = ["VIPNet", "vip_tiny", "vip_base"]CODE
61 more matches not shown…
Deep Nesting58 hits · 58 pts
SeverityFileLineSnippetContext
LOWdemo/app.py20CODE
LOWreferences/layout/utils.py46CODE
LOWreferences/recognition/train.py223CODE
LOWreferences/recognition/evaluate.py34CODE
LOWreferences/detection/utils.py19CODE
LOWreferences/detection/train.py199CODE
LOWreferences/detection/train.py246CODE
LOWtests/common/test_models_detection_utils.py29CODE
LOWtests/common/test_headers.py7CODE
LOWtests/common/test_io_elements.py576CODE
LOWtests/common/test_io_elements.py620CODE
LOWdoctr/datasets/synthtext.py51CODE
LOWdoctr/datasets/coco_text.py47CODE
LOWdoctr/datasets/cord.py52CODE
LOWdoctr/datasets/wildreceipt.py50CODE
LOWdoctr/datasets/svhn.py51CODE
LOWdoctr/datasets/iiit5k.py45CODE
LOWdoctr/datasets/imgur5k.py54CODE
LOWdoctr/datasets/ic13.py46CODE
LOWdoctr/datasets/ic03.py50CODE
LOWdoctr/datasets/funsd.py44CODE
LOWdoctr/datasets/sroie.py51CODE
LOWdoctr/datasets/svt.py42CODE
LOWdoctr/io/exporters.py134CODE
LOWdoctr/utils/metrics.py731CODE
LOWdoctr/utils/visualization.py155CODE
LOWdoctr/utils/visualization.py308CODE
LOWdoctr/utils/repr.py32CODE
LOWdoctr/utils/reconstitution.py571CODE
LOWdoctr/utils/data.py28CODE
LOWdoctr/models/builder.py424CODE
LOWdoctr/models/builder.py831CODE
LOWdoctr/models/_utils.py123CODE
LOWdoctr/models/classification/vit_det/pytorch.py231CODE
LOWdoctr/models/layout/lw_detr/pytorch.py269CODE
LOWdoctr/models/layout/lw_detr/base.py89CODE
LOWdoctr/models/layout/lw_detr/base.py216CODE
LOWdoctr/models/reading_order/base.py85CODE
LOWdoctr/models/reading_order/base.py182CODE
LOWdoctr/models/table_structure/tablecenternet/base.py295CODE
LOWdoctr/models/table_structure/tablecenternet/base.py112CODE
LOWdoctr/models/recognition/sar/pytorch.py114CODE
LOWdoctr/models/recognition/parseq/pytorch.py127CODE
LOWdoctr/models/recognition/parseq/pytorch.py326CODE
LOWdoctr/models/predictor/base.py260CODE
LOWdoctr/models/detection/_utils/base.py12CODE
LOW…r/models/detection/differentiable_binarization/base.py270CODE
LOWdoctr/models/detection/linknet/base.py159CODE
LOWdoctr/models/detection/fast/base.py156CODE
LOWdoctr/models/factory/hub.py192CODE
LOWdoctr/cli/main.py98CODE
LOWdoctr/cli/main.py318CODE
LOWdoctr/contrib/artefacts.py68CODE
LOWdoctr/transforms/modules/pytorch.py100CODE
LOWscripts/evaluate_kie.py23CODE
LOWscripts/collect_env.py167CODE
LOWscripts/evaluate.py23CODE
LOWapi/tests/routes/test_ocr.py7CODE
Fake / Example Data32 hits · 36 pts
SeverityFileLineSnippetContext
LOW⚡tests/common/test_io_figures.py121 encoder = FigureEncoder("placeholder")CODE
LOW⚡tests/common/test_io_figures.py123 assert "placeholder" in repr(encoder)CODE
LOW⚡tests/common/test_io_figures.py132 assert FigureEncoder("placeholder").source(page, region, 1) is NoneCODE
LOW⚡tests/common/test_io_figures.py133 assert FigureEncoder("placeholder").enabled and not FigureEncoder("placeholder").materializesCODE
LOWtests/common/test_models_recognition_utils.py68 ("lorem ipsum dolorX", "Xipsvm dolor sit", 0.7, "lorem ipsum dolor sit"),CODE
LOW⚡tests/common/test_io_exporters.py1307 placeholder = page.export_as_markdown(images="placeholder")CODE
LOW⚡tests/common/test_io_exporters.py1310 for images in ("none", "placeholder", "embedded"):CODE
LOW⚡tests/common/test_io_exporters.py1315 assert page.export_as_markdown(images="placeholder", include_furniture=False).count("<!-- image -->") == 1CODE
LOW⚡tests/common/test_io_exporters.py1415 placeholder = page.export_as_markdown(images="placeholder", escape=escape)CODE
LOW⚡tests/common/test_io_exporters.py1442 assert page.export_as_markdown(images="placeholder").count("<!-- image -->") == 2CODE
LOW⚡tests/common/test_io_exporters.py1444 for images in ("none", "placeholder", "embedded"):CODE
LOW⚡tests/common/test_io_exporters.py1469 for images, markers in (("placeholder", "<!-- image -->"), ("embedded", "![")):CODE
LOW⚡tests/common/test_io_exporters.py1472 assert ("tick" in exported) is (images == "placeholder")CODE
LOW⚡tests/common/test_io_exporters.py1476 assert ("tick" in exported) is (images == "placeholder" and not in_furniture)CODE
LOWtests/common/test_io_exporters.py1352 markdown = page.export_as_markdown(images="placeholder")CODE
LOWtests/common/test_cli.py117 assert args.images == "placeholder"CODE
LOWtests/common/test_cli.py299 assert cli._export_kwargs("html", _args())["images"].mode == "placeholder"CODE
LOWtests/pytorch/test_models_zoo_pt.py413 exports = {images: page.export_as_markdown(images=images) for images in ("none", "placeholder", "embedded")}CODE
LOWtests/pytorch/test_models_zoo_pt.py430 assert exports["placeholder"].count("<!-- image -->") == 1CODE
LOWtests/pytorch/test_models_zoo_pt.py431 assert exports["placeholder"].replace("<!-- image -->\n\n", "") == exports["none"]CODE
LOWdoctr/io/figures.py33IMAGE_MODES = ("none", "placeholder", "embedded", "referenced")CODE
LOWdoctr/io/figures.py196 mode: one of 'none', 'placeholder', 'embedded' or 'referenced'STRING
LOWdoctr/io/figures.py206 mode: str = "placeholder",CODE
LOWdoctr/io/exporters.py589 images: "str | FigureEncoder | None" = "placeholder",CODE
LOWdoctr/io/exporters.py599 images: how to render the figures: 'none', 'placeholder', 'embedded', or aSTRING
LOWdoctr/io/exporters.py1359 images: "str | FigureEncoder | None" = "placeholder",CODE
LOWdoctr/io/exporters.py1367 images: how to render the figures: 'none', 'placeholder', 'embedded', or aSTRING
LOWdoctr/io/exporters.py1386 images: "str | FigureEncoder | None" = "placeholder",CODE
LOWdoctr/io/exporters.py1395 images: how to render the figures: 'none', 'placeholder', 'embedded', or aSTRING
LOWdoctr/io/exporters.py1413 images: "str | FigureEncoder | None" = "placeholder",CODE
LOWdoctr/io/exporters.py1420 images: how to render the figures: 'none', 'placeholder', 'embedded', or aSTRING
LOWdoctr/cli/main.py543 default="placeholder",CODE
AI Structural Patterns22 hits · 22 pts
SeverityFileLineSnippetContext
LOWdoctr/models/zoo.py19CODE
LOWdoctr/models/zoo.py107CODE
LOWdoctr/models/zoo.py198CODE
LOWdoctr/models/zoo.py270CODE
LOWdoctr/models/classification/starnet/pytorch.py95CODE
LOWdoctr/models/classification/vit_det/pytorch.py164CODE
LOWdoctr/models/kie_predictor/pytorch.py45CODE
LOWdoctr/models/layout/lw_detr/pytorch.py269CODE
LOWdoctr/models/layout/lw_detr/layers/pytorch.py372CODE
LOWdoctr/models/layout/lw_detr/layers/pytorch.py500CODE
LOWdoctr/models/reading_order/base.py547CODE
LOWdoctr/models/reading_order/base.py647CODE
LOWdoctr/models/table_structure/tablecenternet/pytorch.py157CODE
LOWdoctr/models/recognition/master/pytorch.py57CODE
LOWdoctr/models/recognition/sar/pytorch.py182CODE
LOWdoctr/models/recognition/parseq/pytorch.py127CODE
LOWdoctr/models/predictor/pytorch.py50CODE
LOW…odels/detection/differentiable_binarization/pytorch.py113CODE
LOWdoctr/models/detection/linknet/pytorch.py85CODE
LOWdoctr/models/detection/linknet/pytorch.py105CODE
LOWdoctr/models/detection/fast/pytorch.py119CODE
LOWdoctr/transforms/functional/pytorch.py50CODE
Excessive Try-Catch Wrapping16 hits · 16 pts
SeverityFileLineSnippetContext
LOWreferences/classification/utils.py195 except Exception:CODE
LOWreferences/layout/utils.py286 except Exception:CODE
LOWreferences/table/utils.py257 except Exception:CODE
LOWreferences/recognition/utils.py195 except Exception:CODE
LOWreferences/detection/utils.py206 except Exception:CODE
LOWdoctr/utils/reconstitution.py37 except Exception: # pragma: no coverCODE
LOWdoctr/utils/reconstitution.py168 except Exception: # pragma: no coverCODE
LOWdoctr/utils/reconstitution.py172 except Exception:CODE
LOWdoctr/utils/reconstitution.py250 except Exception: # pragma: no cover - a bitmap font may not measure a spaceCODE
LOWdoctr/utils/reconstitution.py562 except Exception as exc:CODE
LOWdoctr/utils/reconstitution.py603 except Exception as exc:CODE
LOWdoctr/utils/reconstitution.py667 except Exception as exc:CODE
LOWdoctr/models/table_structure/tablecenternet/base.py270 except Exception:CODE
LOWdoctr/cli/main.py125 except Exception as e:CODE
LOWdoctr/cli/main.py329 except Exception as e:CODE
LOWdoctr/cli/main.py353 except Exception as e:CODE
Cross-Language Confusion2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHtests/common/test_io_exporters.py833 doc.render(page_break=" || ") == "left col\n\nright col\n\nPage 1 of 2 || left col\n\nright col\n\nPage 1 of 2"CODE
HIGHdocs/source/conf.py133 function gtag(){{dataLayer.push(arguments);}}CODE
Self-Referential Comments6 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMtests/pytorch/test_models_zoo_pt.py27# Create a dummy callbackCOMMENT
MEDIUMdoctr/models/builder.py168 # Define a mean y-center for the lineCOMMENT
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py116 """This module implements the self-attention mechanism used in LW-DETR.STRING
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py196 """This module implements MultiScaleDeformableAttention from Deformable DETR.STRING
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py358 """This module implements a single decoder layer of LW-DETR,STRING
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py485 """This module implements the decoder of LW-DETR,STRING
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHdoctr/datasets/generator/base.py96Generate a synthetic text image Args: text: the text to render as an image font_size: the size of tSTRING
HIGHdoctr/utils/multithreading.py19Execute a given function in parallel for each element of a given sequence >>> from doctr.utils.multithreading imporSTRING
Empty Error Handlers2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHdoctr/io/elements.py19except ModuleNotFoundError: # pragma: no coverCODE
HIGHdoctr/io/exporters.py130except AttributeError: # pragma: no coverCODE
Decorative Section Separators2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMtests/pytorch/test_transforms_pt.py737# ----------------------------------------------------------------------------COMMENT
MEDIUMtests/pytorch/test_transforms_pt.py739# ----------------------------------------------------------------------------COMMENT
Slop Phrases4 hits · 6 pts
SeverityFileLineSnippetContext
LOWdoctr/models/recognition/vitstr/pytorch.py156 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
LOWdoctr/models/recognition/vitstr/pytorch.py156 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
LOWdoctr/models/recognition/master/pytorch.py148 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
LOWdoctr/models/recognition/master/pytorch.py148 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
Over-Commented Block2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py341 # labels: label is also asciiCOMMENT
LOWdocs/source/conf.py1# Copyright (C) 2021-2026, Mindee.COMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWdoctr/utils/geometry.py623 # Add the crop to the list of cropsCOMMENT
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWdoctr/models/factory/hub.py126### Example usage:COMMENT