OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
This report summarizes scanner evidence for ocrmypdf/OCRmyPDF, a Python project with 34,982 GitHub stars. SynthScan examined 63,612 lines of code across 266 source files, recording 1356 pattern matches distributed across 18 syntactic categories. The legacy adjusted pattern signal is 24.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.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 1043 finding(s).
Are imports declared and package/API names verified? 260 finding(s).
Are wrappers, guards, and repeated structures necessary? 973 finding(s).
Which changes need focused human review? 1356 finding(s).
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.
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.
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.
The scanner identified 1356 distinct pattern matches across 18 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.
| 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 |
| 854 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 | 14 | 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_plugin_manager.py | 6 | CODE | |
| LOW | tests/test_validation.py | 4 | CODE | |
| LOW | tests/test_logging.py | 4 | CODE | |
| LOW | tests/test_ocr_image_budget.py | 6 | 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_webservice.py | 4 | CODE | |
| LOW | tests/test_output_types.py | 6 | CODE | |
| LOW | tests/test_image_input.py | 4 | CODE | |
| LOW | tests/test_create_ocr_image.py | 6 | CODE | |
| LOW | tests/test_metadata.py | 4 | CODE | |
| LOW | tests/test_occulta_font.py | 6 | CODE | |
| LOW | tests/test_fpdf2_patches.py | 6 | 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 | |
| 199 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 | 684 | # 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 | 56 | # Create a PDF with a non-zero mediabox origin | COMMENT |
| MEDIUM | tests/test_watcher.py | 358 | # Create the subtree before the watch goes live: the watch is recursive, but | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 120 | # Create a non-page element | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 151 | # Create a simple page with one word | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 425 | # Create a page with multiple words on one line | COMMENT |
| MEDIUM | tests/test_fpdf_renderer.py | 493 | # 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 | 490 | # Create a copy of the model data for serialization | COMMENT |
| MEDIUM | src/ocrmypdf/_pipeline.py | 944 | # Create a new single page PDF to hold | COMMENT |
| MEDIUM | src/ocrmypdf/_annots.py | 45 | # Create a set of all named destinations | COMMENT |
| MEDIUM | src/ocrmypdf/fpdf_renderer/renderer.py | 1116 | # 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 | 157 | # ========================================================================= | COMMENT |
| MEDIUM | src/ocrmypdf/_plugin_manager.py | 159 | # ========================================================================= | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/pdf_compare.py | 33 | CODE | |
| LOW | misc/watcher.py | 192 | CODE | |
| LOW | misc/watcher.py | 312 | 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 | 749 | CODE | |
| LOW | tests/test_ghostscript.py | 783 | CODE | |
| LOW | tests/test_ghostscript.py | 752 | CODE | |
| LOW | tests/test_graft.py | 96 | CODE | |
| LOW | tests/plugins/tesseract_cache.py | 140 | CODE | |
| LOW | tests/plugins/tesseract_cache.py | 141 | CODE | |
| LOW | src/ocrmypdf/optimize.py | 210 | CODE | |
| LOW | src/ocrmypdf/optimize.py | 368 | CODE | |
| LOW | src/ocrmypdf/_options.py | 107 | CODE | |
| LOW | src/ocrmypdf/_options.py | 488 | CODE | |
| LOW | src/ocrmypdf/_options.py | 620 | CODE | |
| LOW | src/ocrmypdf/_options.py | 494 | CODE | |
| LOW | src/ocrmypdf/_graft.py | 275 | CODE | |
| LOW | src/ocrmypdf/_graft.py | 420 | CODE | |
| LOW | src/ocrmypdf/_graft.py | 791 | CODE | |
| LOW | src/ocrmypdf/api.py | 182 | CODE | |
| LOW | src/ocrmypdf/api.py | 423 | CODE | |
| LOW | src/ocrmypdf/imageops.py | 46 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 89 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 212 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 399 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 609 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 757 | CODE | |
| LOW | src/ocrmypdf/_pipeline.py | 1567 | CODE | |
| LOW | src/ocrmypdf/_validation.py | 116 | CODE | |
| LOW | src/ocrmypdf/_validation.py | 227 | CODE | |
| LOW | src/ocrmypdf/_stream_check.py | 108 | CODE | |
| LOW | src/ocrmypdf/_stream_check.py | 128 | CODE | |
| LOW | src/ocrmypdf/_annots.py | 115 | CODE | |
| LOW | src/ocrmypdf/pdfa.py | 190 | CODE | |
| LOW | src/ocrmypdf/pdfa.py | 299 | CODE | |
| LOW | src/ocrmypdf/pdfa.py | 208 | CODE | |
| LOW | src/ocrmypdf/helpers.py | 271 | CODE | |
| LOW | src/ocrmypdf/fpdf_renderer/renderer.py | 751 | CODE | |
| LOW | src/ocrmypdf/pdfinfo/layout.py | 293 | CODE | |
| LOW | src/ocrmypdf/pdfinfo/_contentstream.py | 214 | CODE | |
| LOW | src/ocrmypdf/pdfinfo/info.py | 128 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/pypdfium.py | 208 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 305 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 362 | CODE | |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 326 | CODE | |
| LOW | src/ocrmypdf/subprocess/_windows.py | 101 | CODE | |
| LOW | src/ocrmypdf/subprocess/_run.py | 79 | CODE | |
| LOW | src/ocrmypdf/_pipelines/_common.py | 497 | CODE | |
| LOW | src/ocrmypdf/extra_plugins/semfree.py | 120 | CODE | |
| LOW | src/ocrmypdf/_exec/tesseract.py | 281 | CODE | |
| LOW | src/ocrmypdf/_exec/ghostscript.py | 217 | 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 | 676 | Run OCRmyPDF on one PDF or image. This function supports two calling conventions: **New style (recommended):** | STRING |
| HIGH | src/ocrmypdf/_pipeline.py | 1167 | Try PDF/A conversion without Ghostscript, validated by pikepdf. This repairs and declares the PDF/A structures dire | STRING |
| HIGH | src/ocrmypdf/pdfa.py | 589 | Attempt to convert a PDF to PDF/A by adding and repairing structures. `pikepdf.pdfa.save` replaces the output inten | 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 |
|---|---|---|---|---|
| HIGH | misc/watcher.py | 535 | except KeyboardInterrupt: | CODE |
| HIGH | src/ocrmypdf/_graft.py | 890 | except (FileNotFoundError, PdfError): | CODE |
| HIGH | src/ocrmypdf/helpers.py | 218 | except NotImplementedError: | CODE |
| HIGH | src/ocrmypdf/helpers.py | 316 | except (RuntimeError, pikepdf.ForeignObjectError): | CODE |
| HIGH | src/ocrmypdf/subprocess/_windows.py | 133 | except InvalidVersion: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/batch.py | 85 | except Exception: | CODE |
| LOW | misc/watcher.py | 531 | except Exception: # noqa: BLE001 | CODE |
| LOW | tests/conftest.py | 74 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | tests/conftest.py | 280 | except Exception: # pylint: disable=broad-except | CODE |
| MEDIUM | tests/conftest.py | 71 | def have_unpaper(): | CODE |
| MEDIUM | tests/conftest.py | 275 | def _installed_tesseract_version() -> str | None: | CODE |
| LOW | tests/test_metadata.py | 264 | except Exception: # pylint: disable=broad-except | CODE |
| MEDIUM | tests/test_metadata.py | 252 | def libxmp_file_to_dict(): | CODE |
| LOW | src/ocrmypdf/optimize.py | 518 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | src/ocrmypdf/api.py | 530 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/api.py | 985 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/api.py | 1095 | except Exception as e: | CODE |
| LOW | src/ocrmypdf/_pipeline.py | 1208 | except Exception as e: # pylint: disable=broad-except | 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 | 312 | 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 | .github/scripts/smoke-test-snap.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | src/ocrmypdf/_jobcontext.py | 121 | # Otherwise, we have a fallback Namespace (shouldn't happen in normal operation) | COMMENT |
| LOW | src/ocrmypdf/fpdf_renderer/renderer.py | 561 | ) | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/concurrency.py | 201 | COMMENT | |
| LOW | src/ocrmypdf/_exec/ghostscript.py | 481 | ] | COMMENT |
| LOW | src/ocrmypdf/_exec/ghostscript.py | 541 | # If there is an error we log the whole stderr, except for filtering | 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 | 702 | # Check if this is a plugin namespace | COMMENT |
| LOW | src/ocrmypdf/_annots.py | 37 | # Check if there are any named destinations. A NamePath lookup returns None | COMMENT |
| LOW | src/ocrmypdf/fpdf_renderer/renderer.py | 988 | # Check if character is in CJK ranges | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/pypdfium.py | 336 | # Check if user explicitly requested a different rasterizer | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 283 | # Check if user explicitly requested a different rasterizer | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 335 | # Check if it's an image with DCTDecode | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 399 | # Check if output is 1-15 bytes shorter | COMMENT |
| LOW | src/ocrmypdf/builtin_plugins/ghostscript.py | 404 | # 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 | 339 | """Test rendering comprehensive multilingual 'Hello!' hOCR file. | STRING |
| MEDIUM⚡ | src/ocrmypdf/_validation_coordinator.py | 28 | """Run comprehensive validation on all options. | STRING |
| MEDIUM | src/ocrmypdf/_validation.py | 207 | # 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 | 1105 | __all__ = [ | CODE |
| LOW | src/ocrmypdf/_plugin_manager.py | 339 | __all__ = ['OcrmypdfPluginManager', 'get_plugin_manager', 'plugin_lock'] | CODE |
| LOW | src/ocrmypdf/fpdf_renderer/__init__.py | 21 | __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 | 312 | CODE | |
| LOW | src/ocrmypdf/api.py | 546 | CODE | |
| LOW | src/ocrmypdf/api.py | 612 | CODE | |
| LOW | src/ocrmypdf/api.py | 860 | CODE | |
| LOW | src/ocrmypdf/api.py | 993 | CODE | |
| LOW | src/ocrmypdf/__main__.py | 120 | 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 | 38 | # Step 1: Plugin context validation | COMMENT |
| LOW⚡ | src/ocrmypdf/_validation_coordinator.py | 41 | # Step 2: Cross-cutting validation | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/ocrmypdf/_validation_coordinator.py | 38 | # Step 1: Plugin context validation | COMMENT |
| LOW⚡ | src/ocrmypdf/_validation_coordinator.py | 41 | # 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 |