Repository Analysis

py-pdf/pypdf

A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files

14.5 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of py-pdf/pypdf, a Python project with 10,115 GitHub stars. SynthScan v2.0 examined 77,724 lines of code across 181 source files, recording 1059 pattern matches distributed across 20 syntactic categories. The overall adjusted score of 14.5 places this repository in the Low 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).

14.5
Adjusted Score
14.5
Raw Score
100%
Time Factor
2026-06-30
Last Push
10.1K
Stars
Python
Language
77.7K
Lines of Code
181
Files
1.1K
Pattern Hits
2026-07-14
Scan Date
0.14
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 25MEDIUM 36LOW 998

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 1059 distinct pattern matches across 20 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.

Hyper-Verbose Identifiers631 hits · 542 pts
SeverityFileLineSnippetContext
LOWmake_release.py305def get_git_commits_since_tag(git_tag: str) -> list[Change]:CODE
LOWtests/test_forms.py12def test_form_button__v_value_should_be_name_object():CODE
LOWtests/test_workflows.py116def test_pdfreader_jpeg_image():CODE
LOWtests/test_workflows.py154def test_text_extraction_encrypted():CODE
LOWtests/test_workflows.py267def test_transform_compress_identical_objects():CODE
LOWtests/test_workflows.py572def test_get_fields_no_warning(tmp_path, url, name):CODE
LOWtests/test_workflows.py583def test_scale_rectangle_indirect_object():CODE
LOWtests/test_workflows.py694def test_image_extraction_strict():CODE
LOWtests/test_workflows.py887def test_tounicode_is_identity():CODE
LOWtests/test_workflows.py951def test_fields_returning_stream():CODE
LOWtests/test_workflows.py1070def test_cr_with_cm_operation():CODE
LOWtests/test_workflows.py1087def remove_trailing_whitespace(text: str) -> str:CODE
LOWtests/test_workflows.py1106def test_text_extraction_layout_mode(pdf_path, expected_path):CODE
LOWtests/test_workflows.py1115def test_layout_mode_space_vertically():CODE
LOWtests/test_workflows.py1130def test_layout_mode_rotations(rotation, strip_rotated):CODE
LOWtests/test_workflows.py1148def test_text_extraction_invalid_mode():CODE
LOWtests/test_workflows.py1156def test_get_page_showing_field():CODE
LOWtests/test_reader.py1469def test_outline_with_missing_named_destination():CODE
LOWtests/test_reader.py1478def test_outline_with_empty_action():CODE
LOWtests/test_reader.py1487def test_outline_with_invalid_destinations():CODE
LOWtests/test_reader.py1495def test_pdfreader_multiple_definitions(caplog):CODE
LOWtests/test_reader.py1506def test_wrong_password_error():CODE
LOWtests/test_reader.py1515def test_get_page_number_by_indirect():CODE
LOWtests/test_reader.py1521def test_corrupted_xref_table():CODE
LOWtests/test_reader.py377def test_startxref_corrupt_trailing_pointer(caplog):CODE
LOWtests/test_reader.py431def test_find_previous_startxref_pos_recovery_variants():CODE
LOWtests/test_reader.py468def test_get_page_of_encrypted_file(pdffile, password, should_fail):CODE
LOWtests/test_reader.py536def test_reading_choice_field_without_opt_key():CODE
LOWtests/test_reader.py594def test_read_malformed_header(caplog):CODE
LOWtests/test_reader.py651def test_circular_xref_prev_reference(caplog):CODE
LOWtests/test_reader.py985def test_user_access_permissions():CODE
LOWtests/test_reader.py1050def test_convert_to_int_error():CODE
LOWtests/test_reader.py1076def test_extract_text_hello_world():CODE
LOWtests/test_reader.py1101def test_read_not_binary_mode(caplog):CODE
LOWtests/test_reader.py1123def test_form_topname_with_and_without_acroform(caplog):CODE
LOWtests/test_reader.py1211def test_get_full_qualified_fields():CODE
LOWtests/test_reader.py1232def test_get_fields_read_else_block():CODE
LOWtests/test_reader.py1265def test_get_fields_read_write_report(txt_file_path):CODE
LOWtests/test_reader.py1433def test_outline_missing_title(caplog):CODE
LOWtests/test_reader.py1740def test_xyz_with_missing_param():CODE
LOWtests/test_reader.py1808def test_context_manager_with_stream():CODE
LOWtests/test_reader.py1905def test_space_in_names_to_continue_processing(caplog):CODE
LOWtests/test_reader.py1951def test_unbalanced_brackets_in_dictionary_object(caplog):CODE
LOWtests/test_reader.py2062def test_infinite_loop_for_length_value():CODE
LOWtests/test_reader.py2075def test_trailer_cannot_be_read():CODE
LOWtests/test_reader.py2099def test_read_standard_xref_table__two_whitespace_characters_between_offset_and_generation():CODE
LOWtests/test_reader.py2109def test_read_standard_xref_table__entry_invalid_but_object_found(caplog):CODE
LOWtests/test_reader.py2136def test_root_object_recovery_limit(caplog):CODE
LOWtests/test_reader.py2179def test_rebuild_xref_table__speed():CODE
LOWtests/test_reader.py2222def test_cache_indirect_object_strict_overwrite_error():CODE
LOWtests/test_reader.py2230def test_objstm_batch_parse_caches_all_objects():CODE
LOWtests/test_reader.py2244def test_objstm_cache_hit_returns_target():CODE
LOWtests/test_reader.py2259def test_objstm_skips_cache_for_overridden_objects():CODE
LOWtests/test_reader.py2278def test_objstm_does_not_cache_stale_objects_from_non_authoritative_stream():CODE
LOWtests/test_reader.py2367def test_xref_table_with_comments_before_trailer():CODE
LOWtests/test_reader.py2457def test_get_object_from_stream__size_limit(caplog):CODE
LOWtests/test_reader.py2507def test_named_destinations_cache():CODE
LOWtests/test_reader.py2518def test_read_standard_xref_table__malformed__speed():CODE
LOWtests/test_reader.py856def test_read_encrypted_without_decryption():STRING
LOWtests/test_reader.py864def test_get_destination_page_number():STRING
571 more matches not shown…
Unused Imports105 hits · 91 pts
SeverityFileLineSnippetContext
LOWpypdf/__init__.py11CODE
LOWpypdf/__init__.py12CODE
LOWpypdf/__init__.py13CODE
LOWpypdf/__init__.py13CODE
LOWpypdf/__init__.py14CODE
LOWpypdf/__init__.py15CODE
LOWpypdf/__init__.py17CODE
LOWpypdf/__init__.py17CODE
LOWpypdf/__init__.py18CODE
LOWpypdf/__init__.py19CODE
LOWpypdf/__init__.py19CODE
LOWpypdf/__init__.py20CODE
LOWpypdf/_font.py1CODE
LOWpypdf/_crypt_providers/__init__.py28CODE
LOWpypdf/_crypt_providers/__init__.py28CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py31CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py44CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/_crypt_providers/__init__.py56CODE
LOWpypdf/annotations/__init__.py14CODE
LOWpypdf/annotations/__init__.py14CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py15CODE
LOWpypdf/annotations/__init__.py26CODE
LOWpypdf/annotations/__init__.py26CODE
LOWpypdf/_text_extraction/_layout_mode/__init__.py2CODE
LOWpypdf/_text_extraction/_layout_mode/__init__.py3CODE
LOWpypdf/_text_extraction/_layout_mode/__init__.py3CODE
LOWpypdf/_text_extraction/_layout_mode/__init__.py3CODE
LOWpypdf/_text_extraction/_layout_mode/__init__.py3CODE
45 more matches not shown…
Deep Nesting87 hits · 74 pts
SeverityFileLineSnippetContext
LOWresources/afm_to_dataclass.py23CODE
LOWresources/afm_to_dataclass.py50CODE
LOWtests/test_workflows.py668CODE
LOWtests/test_reader.py171CODE
LOWtests/test_reader.py188CODE
LOWtests/test_font.py105CODE
LOWtests/utils.py111CODE
LOWpypdf/_page_labels.py188CODE
LOWpypdf/_encryption.py73CODE
LOWpypdf/_encryption.py96CODE
LOWpypdf/_encryption.py1045CODE
LOWpypdf/_writer.py754CODE
LOWpypdf/_writer.py942CODE
LOWpypdf/_writer.py1440CODE
LOWpypdf/_writer.py1828CODE
LOWpypdf/_writer.py1981CODE
LOWpypdf/_writer.py2107CODE
LOWpypdf/_writer.py2214CODE
LOWpypdf/_writer.py2553CODE
LOWpypdf/_writer.py2684CODE
LOWpypdf/_writer.py2840CODE
LOWpypdf/_writer.py3001CODE
LOWpypdf/_writer.py3198CODE
LOWpypdf/_reader.py456CODE
LOWpypdf/_reader.py675CODE
LOWpypdf/_reader.py892CODE
LOWpypdf/_reader.py1026CODE
LOWpypdf/_reader.py1158CODE
LOWpypdf/_reader.py1349CODE
LOWpypdf/_reader.py1409CODE
LOWpypdf/xmp.py271CODE
LOWpypdf/xmp.py355CODE
LOWpypdf/xmp.py629CODE
LOWpypdf/_page.py814CODE
LOWpypdf/_page.py960CODE
LOWpypdf/_page.py1042CODE
LOWpypdf/_page.py1634CODE
LOWpypdf/_page.py1791CODE
LOWpypdf/_page.py2060CODE
LOWpypdf/_doc_common.py449CODE
LOWpypdf/_doc_common.py612CODE
LOWpypdf/_doc_common.py675CODE
LOWpypdf/_doc_common.py750CODE
LOWpypdf/_doc_common.py995CODE
LOWpypdf/_doc_common.py1162CODE
LOWpypdf/_doc_common.py1379CODE
LOWpypdf/_doc_common.py1437CODE
LOWpypdf/_font.py313CODE
LOWpypdf/_font.py459CODE
LOWpypdf/_font.py556CODE
LOWpypdf/_cmap.py63CODE
LOWpypdf/_cmap.py198CODE
LOWpypdf/_cmap.py239CODE
LOWpypdf/_cmap.py336CODE
LOWpypdf/filters.py100CODE
LOWpypdf/filters.py803CODE
LOWpypdf/filters.py173CODE
LOWpypdf/filters.py259CODE
LOWpypdf/filters.py411CODE
LOWpypdf/filters.py637CODE
27 more matches not shown…
Docstring Block Structure14 hits · 70 pts
SeverityFileLineSnippetContext
HIGHmake_release.py337 Parse the first line of a git commit message. Args: line: The first line of a git commit message. STRING
HIGHdocs/dev/documentation.md48 Example function with PEP 484 type annotations. Args: param1: The first parameter. param2: The secSTRING
HIGHpypdf/_encryption.py788 Apply the SASLprep profile (RFC 4013) of stringprep (RFC 3454). This normalizes Unicode passwords for PDF 2.0 STRING
HIGHpypdf/_writer.py685 Append a blank page to this PDF file and return it. If no page size is specified, use the size of the STRING
HIGHpypdf/_writer.py713 Insert a blank page to this PDF file and return it. If no page size is specified for a dimension, use STRING
HIGHpypdf/_page.py578 Return a new blank page. If ``width`` or ``height`` is ``None``, try to get the page size fromSTRING
HIGHpypdf/filters.py178 Decode data which is flate-encoded. Args: data: Flate-encoded data. decode_parms: STRING
HIGHpypdf/filters.py350 Decode an ASCII-Hex encoded data stream. Args: data: a str sequence of hexadecimal-encoded vSTRING
HIGHpypdf/filters.py416 Decode a run length encoded data stream. Args: data: a bytes sequence of length/data STRING
HIGHpypdf/filters.py804 Decode the stream data based on the specified filters. This function decodes the stream data using the filtersSTRING
HIGH…f/_text_extraction/_layout_mode/_text_state_manager.py79 Create a TextStateParams instance to display a text string. Type[bytes] values will be decoded implicitSTRING
HIGHpypdf/generic/_image_xobject.py447 Users need to have the pillow package installed. It's unclear if pypdf will keep this function here, hence it'STRING
HIGHpypdf/generic/_data_structures.py1107 Try to decode the stream object as an image Args: pillow_parameters: parameters provided tSTRING
HIGHpypdf/generic/_utils.py134 Create a ByteStringObject or a TextStringObject from a string to represent the string. Args: string: TSTRING
Self-Referential Comments19 hits · 56 pts
SeverityFileLineSnippetContext
MEDIUMresources/afm_to_dataclass.py39 "# This file is based upon the 14 core AFM files provided by Adobe/Macromedia at\n# " +CODE
MEDIUMtests/test_generic.py990 # Create a weak reference to the underlying object to test laterCOMMENT
MEDIUMtests/test_generic.py1018 # Create a weak reference to the underlying object to test laterCOMMENT
MEDIUMtests/generic/test_data_structures.py100 # Create a single child A as the /First (and /Last)COMMENT
MEDIUM.github/workflows/release.yaml30 contents: write # Create the actual release.CODE
MEDIUMpypdf/_writer.py883 # Create a new StreamObject for the new_content_dataCOMMENT
MEDIUMpypdf/_writer.py896 # Create a new StreamObject in a new /Contents entry.COMMENT
MEDIUMpypdf/_writer.py2726 # Create a new PdfReader instance using the streamCOMMENT
MEDIUMpypdf/_font.py661 # Create the descendant font objectCOMMENT
MEDIUMpypdf/_font.py677 # Create the Type 0 font objectCOMMENT
MEDIUMpypdf/filters.py622# Create an alias for the old class nameCOMMENT
MEDIUMpypdf/_utils.py516# The following class has been copied from Django:COMMENT
MEDIUMpypdf/generic/_files.py73 # Create the file entry (the actual embedded file stream)COMMENT
MEDIUMpypdf/generic/_files.py82 # Create the filespec dictionaryCOMMENT
MEDIUMpypdf/generic/_appearance_stream.py574 # Create a default appearance if none was found in the annotationCOMMENT
MEDIUMpypdf/generic/_appearance_stream.py649 # Create the TextStreamAppearance instanceCOMMENT
MEDIUMpypdf/generic/_link.py28# This module contains code used by _writer.py to track links in pagesCOMMENT
MEDIUMpypdf/_codecs/core_font_metrics.py1# This file is based upon the 14 core AFM files provided by Adobe/Macromedia atCOMMENT
MEDIUMpypdf/_codecs/_codecs.py180 # The following method has been converted to Python from PDFsharp:COMMENT
Excessive Try-Catch Wrapping56 hits · 54 pts
SeverityFileLineSnippetContext
LOWmake_release.py104 except Exception:CODE
LOWtests/test_reader.py601 except Exception:CODE
LOWtests/test_page.py67 except Exception:CODE
LOWdocs/user/suppress-warnings.md45except Exception as exc:CODE
LOWdocs/user/extract-images.md64 except Exception as exception:CODE
LOW.github/scripts/check_urls.py52 except Exception as exception:CODE
LOW.github/scripts/check_gh_pages_updates.py66 except Exception as e:CODE
LOW.github/scripts/check_gh_pages_updates.py82 except Exception as e:CODE
LOWpypdf/_encryption.py1068 except Exception:CODE
MEDIUMpypdf/_writer.py2348def _get_page_layout(self) -> Optional[LayoutType]:CODE
LOWpypdf/_writer.py522 except Exception:CODE
LOWpypdf/_writer.py590 except Exception as exc: # pragma: no coverCODE
LOWpypdf/_writer.py2998 except Exception:CODE
LOWpypdf/_writer.py3216 except Exception:CODE
LOWpypdf/_writer.py3221 except Exception:CODE
LOWpypdf/_reader.py245 except Exception: # to be sure to capture all errorsCODE
LOWpypdf/_reader.py488 except Exception:CODE
LOWpypdf/_reader.py956 except Exception:CODE
LOWpypdf/_reader.py1000 except Exception:CODE
LOWpypdf/_reader.py1004 except Exception:CODE
LOWpypdf/_reader.py1056 except Exception:CODE
LOWpypdf/_reader.py1061 except Exception as e:CODE
LOWpypdf/_reader.py1106 except Exception:CODE
LOWpypdf/_reader.py1154 except Exception:CODE
LOWpypdf/_reader.py1398 except Exception: # could be multiple causesCODE
LOWpypdf/_page.py1773 except Exception:CODE
LOWpypdf/_page.py1784 except Exception:CODE
LOWpypdf/_page.py1945 except Exception as exception:CODE
LOWpypdf/_page.py2417 except Exception: # pragma: no coverCODE
LOWpypdf/_doc_common.py775 except Exception as exc:CODE
LOWpypdf/_doc_common.py835 except Exception as exc:CODE
LOWpypdf/_cmap.py90 except Exception:CODE
LOWpypdf/_cmap.py96 except Exception:CODE
LOWpypdf/_cmap.py114 except Exception:CODE
LOWpypdf/_text_extraction/__init__.py148 except Exception:CODE
LOWpypdf/_text_extraction/__init__.py180 except Exception:CODE
LOWpypdf/_text_extraction/_text_extractor.py250 except Exception:CODE
LOWpypdf/_text_extraction/_text_extractor.py261 except Exception:CODE
LOWpypdf/_text_extraction/_text_extractor.py305 except Exception:CODE
LOWpypdf/generic/_base.py162 except Exception:CODE
LOWpypdf/generic/_base.py496 except Exception as e:CODE
LOWpypdf/generic/_base.py921 except Exception:CODE
LOWpypdf/generic/_image_xobject.py620 except Exception as exception:CODE
LOWpypdf/generic/_data_structures.py1762 except Exception:CODE
LOWpypdf/generic/_data_structures.py1767 except Exception:CODE
LOWpypdf/generic/_data_structures.py127 except Exception:CODE
LOWpypdf/generic/_data_structures.py300 except Exception:CODE
LOWpypdf/generic/_data_structures.py405 except Exception:CODE
LOWpypdf/generic/_data_structures.py625 except Exception as exc:CODE
LOWpypdf/generic/_data_structures.py836 except Exception: # it means we are inserting in first positionCODE
LOWpypdf/generic/_data_structures.py982 except Exception:CODE
LOWpypdf/generic/_data_structures.py1018 except Exception:CODE
LOWpypdf/generic/_data_structures.py1284 except Exception:CODE
LOWpypdf/generic/_data_structures.py1318 except Exception:CODE
LOWpypdf/generic/_utils.py156 except Exception:CODE
LOWpypdf/_codecs/__init__.py13 except Exception:CODE
Fake / Example Data31 hits · 44 pts
SeverityFileLineSnippetContext
LOWresources/multicolumn-lorem-ipsum.txt1 Two-Column Document with Lorem IpsumCODE
LOWresources/multicolumn-lorem-ipsum.txt9with Lorem Ipsum text. nas lacinia. Nam ipsum ligula, eleifend at, accumsanCODE
LOWresources/multicolumn-lorem-ipsum.txt10 Lorem ipsum dolor sit amet, consectetuer adip- nec, suscipit a, ipsum. Morbi blandit ligula feugiatCODE
LOWresources/multicolumn-lorem-ipsum.txt10 Lorem ipsum dolor sit amet, consectetuer adip- nec, suscipit a, ipsum. Morbi blandit ligula feugiatCODE
LOWresources/multicolumn-lorem-ipsum.txt20placerat. Integer sapien est, iaculis in, pretium quis, ipsum dolor sit amet, consectetuer adipiscing elit. InCODE
LOWtests/test_workflows.py163 .startswith("Lorem ipsum dolor sit amet")CODE
LOWtests/test_workflows.py163 .startswith("Lorem ipsum dolor sit amet")CODE
LOWtests/test_cmap.py296 assert "Lorem ipsum dolor sit amet" in reader.pages[0].extract_text()CODE
LOWtests/test_cmap.py296 assert "Lorem ipsum dolor sit amet" in reader.pages[0].extract_text()CODE
LOWtests/test_cmap.py322 assert page.extract_text() == "Lorem ipsum"CODE
LOWtests/test_writer.py459 assert "Lorem ipsum dolor sit amet" in extracted_textCODE
LOWtests/test_writer.py459 assert "Lorem ipsum dolor sit amet" in extracted_textCODE
LOWtests/test_xmp.py29 assert xmp.dc_creator == ["John Doe"]CODE
LOWtests/test_xmp.py47 assert xmp.dc_creator == ["John Doe"]CODE
LOWtests/generic/test_data_structures.py170 assert ContentStream(stream=array2, pdf=None).get_data() == b"Lorem ipsum!\nShared stream 0\nShared stream 2\n"CODE
LOWtests/generic/test_data_structures.py177 b"Lorem ipsum!\nShared stream 0\nShared stream 1\nShared stream 2\n"CODE
LOWtests/generic/test_data_structures.py143 stream2.set_data(b"Lorem ipsum!")CODE
LOWtests/generic/test_files.py114 assert attachment.content.startswith(b"Hello World!\n\nLorem ipsum dolor sit amet, ")CODE
LOWtests/generic/test_files.py114 assert attachment.content.startswith(b"Hello World!\n\nLorem ipsum dolor sit amet, ")CODE
LOWtests/generic/test_files.py115 assert attachment.content.endswith(b"\ntakimata sanctus est Lorem ipsum dolor sit amet.\n")CODE
LOWtests/generic/test_files.py115 assert attachment.content.endswith(b"\ntakimata sanctus est Lorem ipsum dolor sit amet.\n")CODE
LOWtests/generic/test_files.py294 embedded_file.content = "Lorem ipsum dolor sit amet"CODE
LOWtests/generic/test_files.py294 embedded_file.content = "Lorem ipsum dolor sit amet"CODE
LOWtests/generic/test_files.py295 assert embedded_file.content == b"Lorem ipsum dolor sit amet"CODE
LOWtests/generic/test_files.py295 assert embedded_file.content == b"Lorem ipsum dolor sit amet"CODE
LOWtests/generic/test_files.py478 b"Hello World!\n\nLorem ipsum dolor sit amet, consetetur sad"CODE
LOWtests/generic/test_files.py478 b"Hello World!\n\nLorem ipsum dolor sit amet, consetetur sad"CODE
LOWtests/generic/test_files.py483 b"t Lorem\nipsum dolor sit amet. Lorem ipsum dolor sit amet"CODE
LOWtests/generic/test_files.py483 b"t Lorem\nipsum dolor sit amet. Lorem ipsum dolor sit amet"CODE
LOWtests/generic/test_files.py488 b"imata sanctus est Lorem ipsum dolor sit amet.\n"CODE
LOWtests/generic/test_files.py488 b"imata sanctus est Lorem ipsum dolor sit amet.\n"CODE
Over-Commented Block44 hits · 43 pts
SeverityFileLineSnippetContext
LOWtests/test_encryption.py41 # qpdf --encrypt "asdfzxcv" "" 128 -- unencrypted.pdf r3-user-password.pdfCOMMENT
LOWrequirements/dev.txt1#COMMENT
LOWrequirements/dev.txt41packaging==24.1COMMENT
LOWrequirements/dev.txt61 # via pytest-covCOMMENT
LOWrequirements/dev.txt81 # via pre-commitCOMMENT
LOWrequirements/ci.txt1#COMMENT
LOWrequirements/ci.txt21fonttools==4.60.2COMMENT
LOWrequirements/ci.txt41pycparser==2.22COMMENT
LOWrequirements/ci.txt61pytest-xdist==3.6.1COMMENT
LOWrequirements/ci-3.11.txt1#COMMENT
LOWrequirements/ci-3.11.txt21execnet==2.1.1COMMENT
LOWrequirements/ci-3.11.txt41pluggy==1.5.0COMMENT
LOWrequirements/ci-3.11.txt61pytest-socket==0.7.0COMMENT
LOWrequirements/ci-3.11.txt81 # via -r requirements/ci.inCOMMENT
LOWrequirements/docs.txt1#COMMENT
LOWrequirements/docs.txt21 # via requestsCOMMENT
LOWrequirements/docs.txt41 # via sphinxCOMMENT
LOWdocs/conf.py141# To execute these examples real files need to be read and written.COMMENT
LOWpypdf/_encryption.py1# Copyright (c) 2022, exiledkingccCOMMENT
LOWpypdf/_writer.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/_reader.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/xmp.py41# It's documented here: https://github.com/adobe/xmp-docs/raw/master/XMPSpecifications/XMPSpecificationPart3.pdfCOMMENT
LOWpypdf/_page.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/_doc_common.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/filters.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/filters.py121 try:COMMENT
LOWpypdf/_utils.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/_utils.py521#COMMENT
LOWpypdf/_crypt_providers/_base.py1# Copyright (c) 2023, exiledkingccCOMMENT
LOWpypdf/_crypt_providers/_cryptography.py1# Copyright (c) 2023, exiledkingccCOMMENT
LOWpypdf/_crypt_providers/__init__.py1# Copyright (c) 2023, exiledkingccCOMMENT
LOWpypdf/_crypt_providers/_pycryptodome.py1# Copyright (c) 2023, exiledkingccCOMMENT
LOWpypdf/_crypt_providers/_fallback.py1# Copyright (c) 2023, exiledkingccCOMMENT
LOWpypdf/_text_extraction/_text_extractor.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/generic/_base.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/generic/_viewerpref.py1# Copyright (c) 2023, Pubpub-ZZCOMMENT
LOWpypdf/generic/__init__.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/generic/_image_inline.py1# Copyright (c) 2024, pypdf contributorsCOMMENT
LOWpypdf/generic/_data_structures.py1# Copyright (c) 2006, Mathieu FenniakCOMMENT
LOWpypdf/generic/_link.py1# All rights reserved.COMMENT
LOWpypdf/_codecs/adobe_glyphs.py1# https://raw.githubusercontent.com/adobe-type-tools/agl-aglfn/master/glyphlist.txtCOMMENT
LOWpypdf/_codecs/adobe_glyphs.py21# provided with the distribution.COMMENT
LOWpypdf/_codecs/core_font_metrics.py1# This file is based upon the 14 core AFM files provided by Adobe/Macromedia atCOMMENT
LOWpypdf/_codecs/_codecs.py181 # https://github.com/empira/PDFsharp/blob/5fbf6ed14740bc4e16786816882d32e43af3ff5d/src/foundation/src/PDFsharp/src/PCOMMENT
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHpypdf/_writer.py0read-only boolean property showing whether this pdf file is encrypted. note that this property, if true, will remain truSTRING
HIGHpypdf/_reader.py0read-only boolean property showing whether this pdf file is encrypted. note that this property, if true, will remain truSTRING
HIGHpypdf/_doc_common.py0read-only boolean property showing whether this pdf file is encrypted. note that this property, if true, will remain truSTRING
HIGHpypdf/_writer.py0integration into jupyter notebooks. this method returns a dictionary that maps a mime-type to its representation. .. seeSTRING
HIGHpypdf/_reader.py0integration into jupyter notebooks. this method returns a dictionary that maps a mime-type to its representation. .. seeSTRING
HIGHpypdf/_doc_common.py0integration into jupyter notebooks. this method returns a dictionary that maps a mime-type to its representation. .. seeSTRING
Decorative Section Separators8 hits · 27 pts
SeverityFileLineSnippetContext
MEDIUMpypdf/_utils.py522# ---------------------------------------------------------------------------------COMMENT
MEDIUMpypdf/_utils.py550# ---------------------------------------------------------------------------------COMMENT
MEDIUMpypdf/_codecs/adobe_glyphs.py7# -----------------------------------------------------------COMMENT
MEDIUMpypdf/_codecs/adobe_glyphs.py40# -----------------------------------------------------------COMMENT
MEDIUMpypdf/_codecs/core_font_metrics.py5# -----------------------------------------------------------------------------------------------COMMENT
MEDIUMpypdf/_codecs/core_font_metrics.py14# -----------------------------------------------------------------------------------------------COMMENT
MEDIUMpypdf/_codecs/_codecs.py185 # -------------------------------------------------------------------------COMMENT
MEDIUMpypdf/_codecs/_codecs.py210 # --------------------------------------------------------------------------COMMENT
Modern Structural Boilerplate27 hits · 26 pts
SeverityFileLineSnippetContext
LOWpypdf/_writer.py562 def set_need_appearances_writer(self, state: bool = True) -> None:CODE
LOWpypdf/_writer.py2354 def _set_page_layout(self, layout: Union[NameObject, LayoutType]) -> None:CODE
LOWpypdf/_writer.py2390 def set_page_layout(self, layout: LayoutType) -> None:CODE
LOWpypdf/__init__.py33__all__ = [CODE
LOWpypdf/xmp.py683 def _set_single_value(self, namespace: str, name: str, value: Optional[str]) -> None:CODE
LOWpypdf/xmp.py707 def _set_bag_values(self, namespace: str, name: str, values: Optional[list[str]]) -> None:CODE
LOWpypdf/xmp.py735 def _set_seq_values(self, namespace: str, name: str, values: Optional[list[str]]) -> None:CODE
LOWpypdf/xmp.py763 def _set_langalt_values(self, namespace: str, name: str, values: Optional[dict[str, str]]) -> None:CODE
LOWpypdf/xmp.py796 def _update_stream(self) -> None:CODE
LOWpypdf/_page.py132def _set_rectangle(self: Any, name: str, value: Union[RectangleObject, float]) -> None:CODE
LOWpypdf/_crypt_providers/__init__.py68__all__ = [CODE
LOWpypdf/annotations/__init__.py28__all__ = [CODE
LOWpypdf/_text_extraction/_layout_mode/__init__.py10__all__ = [CODE
LOW…f/_text_extraction/_layout_mode/_text_state_manager.py51 def set_state_param(self, op: bytes, value: Union[float, list[Any]]) -> None:CODE
LOW…f/_text_extraction/_layout_mode/_text_state_manager.py66 def set_font(self, font: Font, size: float) -> None:CODE
LOWpypdf/actions/__init__.py13__all__ = [CODE
LOWpypdf/generic/_viewerpref.py54 def _set_bool(self, key: str, v: bool) -> None:CODE
LOWpypdf/generic/_viewerpref.py60 def _set_name(self, key: str, lst: list[str], v: NameObject) -> None:CODE
LOWpypdf/generic/_viewerpref.py70 def _set_arr(self, key: str, v: Optional[ArrayObject]) -> None:CODE
LOWpypdf/generic/_viewerpref.py84 def _set_int(self, key: str, v: int) -> None:CODE
LOWpypdf/generic/__init__.py75__all__ = [CODE
LOWpypdf/generic/_image_inline.py42logger = logging.getLogger(__name__)CODE
LOWpypdf/generic/_data_structures.py96logger = logging.getLogger(__name__)CODE
LOWpypdf/generic/_data_structures.py1036 def set_data(self, data: bytes) -> None:CODE
LOWpypdf/generic/_data_structures.py1169 def set_data(self, data: bytes) -> None:CODE
LOWpypdf/generic/_data_structures.py1510 def set_data(self, data: bytes) -> None:CODE
LOWpypdf/_codecs/__init__.py45__all__ = [CODE
Cross-Language Confusion5 hits · 20 pts
SeverityFileLineSnippetContext
HIGHmake_release.py114 git commit -eF RELEASE_COMMIT_MSG.md && git pushSTRING
HIGHmake_release.py130 git tag -eF RELEASE_TAG_MSG.md && git pushSTRING
HIGHtests/test_writer.py1750 # "I DO NOT Agree": null,COMMENT
HIGHtests/test_filters.py713 b"/DecodeParms [ null ]"CODE
HIGHpypdf/_page.py2459 that is called 'FontFilex' (where x is null, 2, or 3), then that fontname isSTRING
AI Slop Vocabulary4 hits · 12 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_reader.py1482 # outline items (entitled Tables and Figures) utilize an empty action (/A)COMMENT
LOWpypdf/generic/_image_inline.py136 # Ideally, we could just use plain run-length decoding here, where 80_16 = 128_10COMMENT
MEDIUMpypdf/generic/_data_structures.py1760 try: # Prefer to be more robust not only to null parametersCODE
MEDIUMpypdf/generic/_data_structures.py1765 try: # Prefer to be more robust not only to null parametersCODE
Redundant / Tautological Comments7 hits · 10 pts
SeverityFileLineSnippetContext
LOWtests/test_images.py61 # Check if the images have the same dimensionsCOMMENT
LOWtests/test_images.py65 # Check if the color modes are the sameCOMMENT
LOWtests/test_writer.py586 # Check if the title was setCOMMENT
LOWtests/test_merger.py129 # Check if outline is correctCOMMENT
LOWtests/bench.py100 # Check if outline is correctCOMMENT
LOWpypdf/_page.py713 # Check if displayed (in content stream)COMMENT
LOWpypdf/generic/_data_structures.py345 # Check if this is a chain list, we need to loop to prevent recurCOMMENT
Dead Code5 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMpypdf/generic/_data_structures.py1291CODE
MEDIUMpypdf/generic/_data_structures.py1292CODE
MEDIUMpypdf/generic/_data_structures.py1293CODE
MEDIUMpypdf/generic/_data_structures.py1294CODE
MEDIUMpypdf/generic/_data_structures.py1295CODE
Verbosity Indicators3 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/utils.py127 # Step 1: Count number of x- and y-coordinates of rectangles.COMMENT
LOWtests/utils.py150 # Step 2: Look for texts in rectangles.COMMENT
LOWtests/utils.py164 # Step 3: Build the list of rows containing list of cell-texts.COMMENT
Structural Annotation Overuse3 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/utils.py127 # Step 1: Count number of x- and y-coordinates of rectangles.COMMENT
LOWtests/utils.py150 # Step 2: Look for texts in rectangles.COMMENT
LOWtests/utils.py164 # Step 3: Build the list of rows containing list of cell-texts.COMMENT
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOW…f/_text_extraction/_layout_mode/_text_state_manager.py122CODE
LOWpypdf/generic/_appearance_stream.py342CODE
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWpypdf/_page_labels.py236 # When there are no kids, make sure to exit the `while` loop directlyCOMMENT
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWpypdf/generic/_image_xobject.py478 # TODO: implement maskCOMMENT