OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
This report presents the forensic synthetic code analysis of ocrmypdf/OCRmyPDF, a Python project with 34,604 GitHub stars. SynthScan v2.0 examined 55,396 lines of code across 247 source files, recording 1094 pattern matches distributed across 17 syntactic categories. The overall adjusted score of 22.5 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 1094 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/watcher.py | 88 | def sanitize_filename_component(name: str) -> str: | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 65 | def test_missing_font_directory(): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 75 | def test_select_font_for_arabic_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 83 | def test_select_font_for_persian_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 91 | def test_select_font_for_urdu_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 111 | def test_select_font_for_hindi_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 119 | def test_select_font_for_sanskrit_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 127 | def test_select_font_for_marathi_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 135 | def test_select_font_for_nepali_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 147 | def test_select_font_for_chinese_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 157 | def test_select_font_for_chinese_generic(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 167 | def test_select_font_for_chinese_simplified(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 177 | def test_select_font_for_chinese_traditional(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 187 | def test_select_font_for_japanese_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 197 | def test_select_font_for_korean_language(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 210 | def test_select_font_for_english_text(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 216 | def test_select_font_without_language_hint(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 225 | def test_select_font_arabic_text_without_language_hint(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 234 | def test_devanagari_text_without_language_hint(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 242 | def test_cjk_text_without_language_hint(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 252 | def test_fallback_to_occulta_font(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 260 | def test_fallback_fonts_constant(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 275 | def test_has_all_glyphs_for_english(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 281 | def test_has_all_glyphs_for_arabic(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 288 | def test_has_all_glyphs_for_devanagari(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 295 | def test_has_all_glyphs_for_cjk(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 302 | def test_empty_text_has_all_glyphs(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 307 | def test_has_all_glyphs_missing_font(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 315 | def test_font_selection_caching(multi_font_manager): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 535 | def test_cjk_falls_back_to_pan_cjk_super_font(): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 544 | def test_missing_cjk_font_warning_names_language_font(font_dir, caplog): | CODE |
| LOW⚡ | tests/test_multi_font_manager.py | 552 | def test_missing_font_warning_explains_consequences(font_dir, caplog): | CODE |
| LOW | tests/test_multi_font_manager.py | 53 | def test_init_loads_builtin_fonts(multi_font_manager): | CODE |
| LOW | tests/test_multi_font_manager.py | 329 | def test_language_font_map_coverage(): | CODE |
| LOW | tests/test_multi_font_manager.py | 374 | def test_custom_font_provider(font_dir): | CODE |
| LOW | tests/test_multi_font_manager.py | 390 | def test_missing_font_uses_fallback(font_dir): | CODE |
| LOW | tests/test_multi_font_manager.py | 405 | def test_builtin_font_provider_loads_expected_fonts(font_dir): | CODE |
| LOW | tests/test_multi_font_manager.py | 418 | def test_builtin_font_provider_get_font(font_dir): | CODE |
| LOW | tests/test_multi_font_manager.py | 430 | def test_builtin_font_provider_get_fallback(font_dir): | CODE |
| LOW | tests/test_multi_font_manager.py | 439 | def test_builtin_font_provider_missing_font_logs_warning(tmp_path, font_dir, caplog): | CODE |
| LOW | tests/test_multi_font_manager.py | 455 | def test_builtin_font_provider_missing_occulta_raises(tmp_path): | CODE |
| LOW | tests/test_multi_font_manager.py | 499 | def test_japanese_prefers_jp_family_over_other_cjk(): | CODE |
| LOW | tests/test_multi_font_manager.py | 511 | def test_chinese_simplified_prefers_sc_family(): | CODE |
| LOW | tests/test_multi_font_manager.py | 522 | def test_cjk_fails_over_when_preferred_subset_lacks_glyph(): | CODE |
| LOW | tests/test_multi_font_manager.py | 595 | def test_unlisted_font_found_by_coverage_search(): | CODE |
| LOW | tests/test_multi_font_manager.py | 607 | def test_coverage_search_result_is_cached(): | CODE |
| LOW | tests/test_multi_font_manager.py | 619 | def test_named_fonts_take_precedence_over_coverage_search(): | CODE |
| LOW | tests/test_multi_font_manager.py | 632 | def test_provider_without_coverage_search_still_falls_back(): | CODE |
| LOW | tests/test_multi_font_manager.py | 639 | def test_missing_font_warning_names_the_missing_characters(font_dir, caplog): | CODE |
| LOW | tests/test_multi_font_manager.py | 656 | def test_missing_character_warning_ignores_covered_characters(font_dir, caplog): | CODE |
| LOW | tests/test_multi_font_manager.py | 668 | def test_mixed_script_word_warning_does_not_advise_installing_fonts(caplog): | CODE |
| LOW | tests/test_ocr_engine_selection.py | 18 | def test_ocr_engine_option_exists(self): | CODE |
| LOW⚡ | tests/test_ocr_engine_selection.py | 30 | def test_ocr_engine_accepts_tesseract(self): | CODE |
| LOW⚡ | tests/test_ocr_engine_selection.py | 39 | def test_ocr_engine_accepts_auto(self): | CODE |
| LOW⚡ | tests/test_ocr_engine_selection.py | 48 | def test_ocr_engine_accepts_none(self): | CODE |
| LOW⚡ | tests/test_ocr_engine_selection.py | 57 | def test_ocr_engine_default_is_auto(self): | CODE |
| LOW⚡ | tests/test_ocr_engine_selection.py | 66 | def test_ocr_engine_rejects_invalid(self): | CODE |
| LOW | tests/test_ocr_engine_selection.py | 79 | def test_ocr_options_has_ocr_engine_field(self): | CODE |
| LOW | tests/test_ocr_engine_selection.py | 90 | def test_tesseract_selected_when_auto(self): | CODE |
| LOW | tests/test_ocr_engine_selection.py | 103 | def test_tesseract_selected_when_tesseract(self): | CODE |
| 624 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/synology.py | 7 | CODE | |
| LOW | misc/pdf_text_diff.py | 6 | CODE | |
| LOW | misc/batch.py | 15 | CODE | |
| LOW | misc/example_plugin.py | 22 | CODE | |
| LOW | misc/webservice.py | 7 | CODE | |
| LOW | misc/webservice.py | 13 | CODE | |
| LOW | misc/pdf_compare.py | 6 | CODE | |
| LOW | misc/watcher.py | 8 | CODE | |
| LOW | misc/bisect_pdf.py | 7 | CODE | |
| LOW | misc/_webservice.py | 13 | CODE | |
| LOW | misc/ocrmypdf_compare.py | 6 | CODE | |
| LOW | bin/bump_version.py | 7 | CODE | |
| LOW | tests/test_multi_font_manager.py | 6 | CODE | |
| LOW | tests/test_ocr_engine_selection.py | 10 | CODE | |
| LOW | tests/test_pipeline_generate_ocr.py | 10 | CODE | |
| LOW | tests/test_compression.py | 6 | CODE | |
| LOW | tests/test_system_font_provider.py | 6 | CODE | |
| LOW | tests/test_sidecar.py | 6 | CODE | |
| LOW | tests/test_concurrency.py | 4 | CODE | |
| LOW | tests/conftest.py | 4 | CODE | |
| LOW | tests/test_rasterizer.py | 6 | CODE | |
| LOW | tests/test_rasterizer.py | 25 | CODE | |
| LOW | tests/test_validation.py | 4 | CODE | |
| LOW | tests/test_logging.py | 4 | CODE | |
| LOW | tests/test_hocr_parser.py | 6 | CODE | |
| LOW | tests/test_thumbnails.py | 4 | CODE | |
| LOW | tests/test_check_pdf.py | 4 | CODE | |
| LOW | tests/test_pypdfium.py | 6 | CODE | |
| LOW | tests/test_null_ocr_engine.py | 10 | CODE | |
| LOW | tests/test_tagged.py | 4 | CODE | |
| LOW | tests/test_optimize.py | 4 | CODE | |
| LOW | tests/test_strip.py | 6 | CODE | |
| LOW | tests/test_stdio.py | 4 | CODE | |
| LOW | tests/test_watcher_security.py | 6 | CODE | |
| LOW | tests/test_languages.py | 6 | CODE | |
| LOW | tests/test_pdf_features.py | 10 | CODE | |
| LOW | tests/test_output_types.py | 6 | CODE | |
| LOW | tests/test_image_input.py | 4 | CODE | |
| LOW | tests/test_metadata.py | 4 | CODE | |
| LOW | tests/__init__.py | 6 | CODE | |
| LOW | tests/test_smoke.py | 6 | CODE | |
| LOW | tests/test_pdf_renderer.py | 6 | CODE | |
| LOW | tests/test_ocr_modes.py | 6 | CODE | |
| LOW | tests/test_semfree.py | 4 | CODE | |
| LOW | tests/test_font_manager.py | 6 | CODE | |
| LOW | tests/test_decompression_bomb.py | 6 | CODE | |
| LOW | tests/test_subprocess.py | 6 | CODE | |
| LOW | tests/test_preprocessing.py | 4 | CODE | |
| LOW | tests/test_input_validation.py | 6 | CODE | |
| LOW | tests/test_rotation.py | 4 | CODE | |
| LOW | tests/test_ocr_element.py | 6 | CODE | |
| LOW | tests/test_rwlock.py | 4 | CODE | |
| LOW | tests/test_page_boxes.py | 4 | CODE | |
| LOW | tests/test_search_index.py | 4 | CODE | |
| LOW | tests/test_ocr_engine_interface.py | 10 | CODE | |
| LOW | tests/test_pdfinfo.py | 4 | CODE | |
| LOW | tests/test_json_serialization.py | 3 | CODE | |
| LOW | tests/test_acroform.py | 4 | CODE | |
| LOW | tests/test_hocrtransform.py | 4 | CODE | |
| LOW | tests/test_subprocess_check.py | 6 | CODE | |
| 182 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_rasterizer.py | 343 | # Create an image with gradients to detect rasterization errors | COMMENT |
| MEDIUM | tests/test_rasterizer.py | 377 | # Create an image with gradients to detect rasterization errors | COMMENT |
| MEDIUM⚡ | tests/test_ocr_engine_interface.py | 35 | # Create a minimal concrete implementation | COMMENT |
| MEDIUM | tests/test_pdfinfo.py | 142 | # Create an RGB image and save as JPEG | COMMENT |
| MEDIUM | tests/test_pdfinfo.py | 151 | # Create a PDF with the flate+jpeg image | COMMENT |
| MEDIUM | tests/test_ghostscript.py | 577 | # Create an invalid image object that has both ColorSpace and ImageMask set | COMMENT |
| MEDIUM⚡ | tests/test_annots.py | 20 | # Create a broken named destination | COMMENT |
| MEDIUM⚡ | tests/test_annots.py | 22 | # Create a valid named destination | COMMENT |
| MEDIUM | tests/test_graft.py | 53 | # Create a PDF with a non-zero mediabox origin | COMMENT |
| MEDIUM | tests/test_watcher.py | 329 | # Create the subtree before the watch goes live: the watch is recursive, but | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 107 | # Create a non-page element | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 138 | # Create a simple page with one word | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 412 | # Create a page with multiple words on one line | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 480 | # Create a page with CJK words (Chinese characters) | COMMENT |
| MEDIUM | docs/conf.py | 10 | # This file is execfile()d with the current directory set to its | COMMENT |
| MEDIUM | src/ocrmypdf/_options.py | 487 | # Create a copy of the model data for serialization | COMMENT |
| MEDIUM | src/ocrmypdf/_pipeline.py | 834 | # Create a new single page PDF to hold | COMMENT |
| MEDIUM | src/ocrmypdf/_annots.py | 41 | # Create a set of all named destinations | COMMENT |
| MEDIUM | src/ocrmypdf/fpdf_renderer/renderer.py | 964 | # Create a renderer for this page | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | tests/test_multilingual_direct.py | 70 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_multilingual_direct.py | 72 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_multilingual_direct.py | 538 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_multilingual_direct.py | 540 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 142 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 144 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 217 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 219 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 315 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 317 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 382 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 384 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 512 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_multilingual_direct.py | 514 | # ============================================================================= | COMMENT |
| MEDIUM | src/ocrmypdf/_plugin_manager.py | 120 | # ========================================================================= | COMMENT |
| MEDIUM | src/ocrmypdf/_plugin_manager.py | 122 | # ========================================================================= | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/pdf_compare.py | 33 | CODE | |
| LOW | misc/watcher.py | 192 | CODE | |
| LOW | misc/watcher.py | 301 | CODE | |
| LOW | misc/ocrmypdf_compare.py | 50 | CODE | |
| LOW | bin/bump_version.py | 101 | CODE | |
| LOW | tests/test_pdf_renderer.py | 692 | CODE | |
| LOW | tests/test_ghostscript.py | 642 | CODE | |
| LOW | tests/test_ghostscript.py | 676 | CODE | |
| LOW | tests/test_ghostscript.py | 645 | CODE | |
| LOW | tests/plugins/tesseract_cache.py | 140 | CODE | |
| LOW | tests/plugins/tesseract_cache.py | 141 | CODE | |
| LOW | src/ocrmypdf/optimize.py | 169 | CODE | |
| LOW | src/ocrmypdf/optimize.py | 326 | CODE | |
| LOW | src/ocrmypdf/_options.py | 92 | CODE | |
| LOW | src/ocrmypdf/_options.py | 485 | CODE | |
| LOW | src/ocrmypdf/_options.py | 587 | CODE | |
| LOW | src/ocrmypdf/_options.py | 491 | CODE | |
| LOW | src/ocrmypdf/_graft.py | 263 | CODE | |
| LOW | src/ocrmypdf/_graft.py | 749 | CODE | |
| LOW | src/ocrmypdf/api.py | 182 | CODE | |
| LOW | src/ocrmypdf/api.py | 423 | CODE | |
| LOW | src/ocrmypdf/imageops.py | 29 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 73 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 170 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 337 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 530 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 1330 | CODE | |
| LOW | src/ocrmypdf/_validation.py | 89 | CODE | |
| LOW | src/ocrmypdf/_validation.py | 198 | CODE | |
| LOW | src/ocrmypdf/pdfa.py | 153 | CODE | |
| LOW | src/ocrmypdf/pdfa.py | 176 | CODE | |
| LOW | src/ocrmypdf/helpers.py | 256 | CODE | |
| LOW | src/ocrmypdf/pdfinfo/layout.py | 293 | CODE | |
| LOW | src/ocrmypdf/pdfinfo/_contentstream.py | 137 | CODE | |
| LOW | src/ocrmypdf/pdfinfo/info.py | 140 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/pypdfium.py | 122 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 278 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 343 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 299 | CODE | |
| LOW | src/ocrmypdf/subprocess/_windows.py | 101 | CODE | |
| LOW | src/ocrmypdf/subprocess/_run.py | 79 | CODE | |
| LOW | src/ocrmypdf/_pipelines/_common.py | 514 | CODE | |
| LOW | src/ocrmypdf/extra_plugins/semfree.py | 120 | CODE | |
| LOW | src/ocrmypdf/_exec/tesseract.py | 281 | CODE | |
| LOW | src/ocrmypdf/_exec/ghostscript.py | 128 | CODE | |
| LOW | src/ocrmypdf/font/system_font_provider.py | 261 | CODE | |
| LOW | src/ocrmypdf/font/system_font_provider.py | 321 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/ocrmypdf/api.py | 91 | Set up plugin infrastructure with proper initialization. This function handles: 1. Creating or validating the p | STRING |
| HIGH | src/ocrmypdf/api.py | 471 | Construct an options object from the input/output files and keyword arguments. Args: input_file: Input file | STRING |
| HIGH | src/ocrmypdf/api.py | 672 | Run OCRmyPDF on one PDF or image. This function supports two calling conventions: **New style (recommended):** | STRING |
| HIGH | src/ocrmypdf/pdfa.py | 296 | Attempt to convert a PDF to PDF/A by adding required structures. This function creates a copy of the input PDF and | STRING |
| HIGH | src/ocrmypdf/builtin_plugins/tesseract_ocr.py | 30 | Convert string argument to ThresholdingMethod enum. Args: value: String name of thresholding method (auto, | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/batch.py | 85 | except Exception: | CODE |
| LOW | misc/watcher.py | 519 | except Exception: # noqa: BLE001 | CODE |
| LOW | tests/conftest.py | 73 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | tests/conftest.py | 220 | except Exception: # pylint: disable=broad-except | CODE |
| MEDIUM | tests/conftest.py | 70 | def have_unpaper(): | CODE |
| MEDIUM | tests/conftest.py | 215 | def _installed_tesseract_version() -> str | None: | CODE |
| LOW | tests/test_metadata.py | 244 | except Exception: # pylint: disable=broad-except | CODE |
| MEDIUM | tests/test_metadata.py | 232 | def libxmp_file_to_dict(): | CODE |
| LOW | src/ocrmypdf/optimize.py | 480 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | src/ocrmypdf/api.py | 530 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/api.py | 980 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/api.py | 1089 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/_pipeline.py | 1079 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/_watcher_security.py | 95 | except Exception: # noqa: BLE001 - defensive; layouts vary | CODE |
| LOW | src/ocrmypdf/builtin_plugins/concurrency.py | 59 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | src/ocrmypdf/builtin_plugins/concurrency.py | 178 | except Exception: | CODE |
| LOW | src/ocrmypdf/_pipelines/_common.py | 317 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | src/ocrmypdf/extra_plugins/semfree.py | 106 | except Exception as e: # pylint: disable=broad-except | CODE |
| LOW | src/ocrmypdf/font/font_provider.py | 127 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/font/system_font_provider.py | 481 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/font/system_font_provider.py | 529 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | prek.toml | 1 | # prek pre-commit configuration — https://prek.j178.dev | COMMENT |
| LOW | tests/test_optimize.py | 461 | image.Width = 10 | COMMENT |
| LOW | docs/conf.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | docs/conf.py | 121 | # non-false value, then it is used: | COMMENT |
| LOW | docs/conf.py | 141 | # add_function_parentheses = True | COMMENT |
| LOW | docs/conf.py | 181 | # ReadTheDocs used to inject the "Edit on GitHub" context automatically, but | COMMENT |
| LOW | docs/conf.py | 201 | # html_title = 'ocrmypdf v4.2' | COMMENT |
| LOW | docs/conf.py | 221 | # html_static_path = ['_static'] | COMMENT |
| LOW | docs/conf.py | 241 | # | COMMENT |
| LOW | docs/conf.py | 261 | # If true, links to the reST sources are added to the pages. | COMMENT |
| LOW | docs/conf.py | 281 | COMMENT | |
| LOW | docs/conf.py | 301 | htmlhelp_basename = 'ocrmypdfdoc' | COMMENT |
| LOW | docs/conf.py | 321 | # (source start file, target name, title, | COMMENT |
| LOW | docs/conf.py | 341 | # If true, show URL addresses after external links. | COMMENT |
| LOW | docs/conf.py | 401 | # | COMMENT |
| LOW | src/ocrmypdf/_jobcontext.py | 121 | # Otherwise, we have a fallback Namespace (shouldn't happen in normal operation) | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/concurrency.py | 201 | COMMENT | |
| LOW | src/ocrmypdf/_exec/ghostscript.py | 361 | # Windows has lots of fatal "permission denied" errors | COMMENT |
| LOW | src/ocrmypdf/_exec/ghostscript.py | 441 | if _gs_error_reported(stderr): | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_rasterizer.py | 23 | # Check if pypdfium2 is available | COMMENT |
| LOW | tests/plugins/tesseract_cache.py | 222 | # Check if cache has all required files | COMMENT |
| LOW | src/ocrmypdf/_options.py | 669 | # Check if this is a plugin namespace | COMMENT |
| LOW | src/ocrmypdf/_annots.py | 30 | # Check if there are any named destinations | COMMENT |
| LOW | src/ocrmypdf/pdfa.py | 282 | # Check if sRGB OutputIntent already exists | COMMENT |
| LOW | src/ocrmypdf/fpdf_renderer/renderer.py | 836 | # Check if character is in CJK ranges | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/pypdfium.py | 252 | # Check if user explicitly requested a different rasterizer | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 256 | # Check if user explicitly requested a different rasterizer | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 310 | # Check if it's an image with DCTDecode | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 378 | # Check if output is 1-15 bytes shorter | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 383 | # Check if the bytes are identical up to the truncation point | COMMENT |
| LOW | src/ocrmypdf/font/multi_font_manager.py | 306 | # Check if text contains non-ASCII characters | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/ocrmypdf/_pipelines/hocr_to_ocr_pdf.py | 0 | implements the concurrent and page synchronous parts of the pipeline. | STRING |
| HIGH | src/ocrmypdf/_pipelines/ocr.py | 0 | implements the concurrent and page synchronous parts of the pipeline. | STRING |
| HIGH | src/ocrmypdf/_pipelines/pdf_to_hocr.py | 0 | implements the concurrent and page synchronous parts of the pipeline. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_fpdf_renderer.py | 326 | """Test rendering comprehensive multilingual 'Hello!' hOCR file. | STRING |
| MEDIUM⚡ | src/ocrmypdf/_validation_coordinator.py | 26 | """Run comprehensive validation on all options. | STRING |
| MEDIUM | src/ocrmypdf/_validation.py | 178 | # Finally, run comprehensive validation using the coordinator | COMMENT |
| MEDIUM | src/ocrmypdf/_stdoutprotect.py | 55 | # a test harness or replaced with an in-memory stream). | COMMENT |
| LOW | src/ocrmypdf/_exec/unpaper.py | 62 | # No changes, PNG input, just use the file we already have | COMMENT |
| LOW | src/ocrmypdf/_exec/unpaper.py | 65 | # adds a few seconds to test suite - so just use pnm | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/plugins/tesseract_cache.py | 190 | def update_cache_info() -> None: | CODE |
| LOW | src/ocrmypdf/__init__.py | 50 | __all__ = [ | CODE |
| LOW | src/ocrmypdf/api.py | 1099 | __all__ = [ | CODE |
| LOW | src/ocrmypdf/_plugin_manager.py | 302 | __all__ = ['OcrmypdfPluginManager', 'get_plugin_manager', 'plugin_lock'] | CODE |
| LOW | src/ocrmypdf/fpdf_renderer/__init__.py | 18 | __all__ = [ | CODE |
| LOW | src/ocrmypdf/pdfinfo/__init__.py | 12 | __all__ = ["Colorspace", "Encoding", "FloatRect", "Ink", "PageInfo", "PdfInfo"] | CODE |
| LOW | src/ocrmypdf/subprocess/__init__.py | 24 | __all__ = [ | CODE |
| LOW | src/ocrmypdf/font/__init__.py | 26 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/watcher.py | 301 | CODE | |
| LOW | src/ocrmypdf/api.py | 546 | CODE | |
| LOW | src/ocrmypdf/api.py | 610 | CODE | |
| LOW | src/ocrmypdf/api.py | 856 | CODE | |
| LOW | src/ocrmypdf/api.py | 988 | CODE | |
| LOW | src/ocrmypdf/__main__.py | 102 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_api.py | 228 | '"textpdf": {"Path": "c"}, "orientation_correction": 180, "ocr_tree": null}' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/ocrmypdf/_validation_coordinator.py | 36 | # Step 1: Plugin context validation | COMMENT |
| LOW⚡ | src/ocrmypdf/_validation_coordinator.py | 39 | # Step 2: Cross-cutting validation | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/ocrmypdf/_validation_coordinator.py | 36 | # Step 1: Plugin context validation | COMMENT |
| LOW⚡ | src/ocrmypdf/_validation_coordinator.py | 39 | # Step 2: Cross-cutting validation | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_watcher.py | 28 | # common case because every wait below is event-driven. | COMMENT |