Public report of docling-project/docling, published 25 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 25 October 2026, 01:33 UTC · Survey ID cd_39ea6c0063d248c98ecf5ae13e1fa9ef

docling-project/docling

Measured 25 October 2026, 01:27 UTC, at code version 53c11a2

No regression since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 61out of 100 At risk No change since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 91,349 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 1.2 person-years · Weakest lens: Production Readiness, 48

Findings by how serious they are

17 critical 745 serious 120 minor

14 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
25 October 2026, 01:27 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

56of 60 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
868of 882 findings point to an exact file and line, so you can open each one in the code. The other 14 concern the repository as a whole, such as missing documentation.
60dimensions across 6 lenses, read from 91,349 lines of product code in 3 projects.
Chapters

Executive summary

docling-project/docling scores 61 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged.

The weakest lens counts most in the score, and here that is Production Readiness, which scores 48 and is rated Weak. Its Security & performance tooling dimension scores 0 out of 10, and until that reaches 4, Production Readiness can't be rated higher than Adequate. The first actions are to add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing and to resolve the 1 No ADRs found finding(s) in ADR Quality, and if Production Readiness rose to 70, the score would rise from 61 to about 70.

17 findings are critical: 11 in Static Analysis (SAST), four in Dependency Vulnerabilities and two in IaC & Container Security.

Watchdog couldn't measure 13 dimensions in this code, among them Code Coverage, Test Reliability and Navigability, so they are left out of the score. The product code is 91,349 lines, which would take an estimated 1.2 person-years, around €180,000, to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 48 · counts for 46%Code Health 65 · counts for 25%Maturity 75 · counts for 14%Security and Compliance 78 · counts for 8%Architecture 86 · counts for 4%Performance 100 · counts for 2%

If Production Readiness rose from 48 to 70, the lowest score rated Strong, the score would rise from 61 to about 70.

Code composition: what the lines of code are
Product code 57%Tests 43%
New since the last survey: 107 findings

These 107 critical or serious findings weren't in the previous survey, on 11 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · candidates.candidates_for (cyclomatic 50) docling/models/stages/form_field/keying/candidates.py
  • Cyclomatic Complexity · tables.table_fields (cyclomatic 37) docling/models/stages/form_field/keying/tables.py
  • Cyclomatic Complexity · MacroHandlerMixin._macro_definition_spans (cyclomatic 36) docling/backend/latex/handlers/macros.py
  • Cyclomatic Complexity · solver._solve (cyclomatic 33) docling/models/stages/form_field/keying/solver.py
  • Cyclomatic Complexity · nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 (cyclomatic 27) docling/utils/nemotron_parse_v3_5_utils.py
  • Cyclomatic Complexity · symmetry.sequences (cyclomatic 22) docling/models/stages/form_field/keying/symmetry.py
  • Cyclomatic Complexity · MsWordDocumentBackend._add_heading (cyclomatic 21) docling/backend/msword_backend.py
  • Cyclomatic Complexity · MsWordDocumentBackend._get_level_element (cyclomatic 20) docling/backend/msword_backend.py
  • Cyclomatic Complexity · OdtDocumentBackend._used_master_pages (cyclomatic 20) docling/backend/opendocument_backend.py
  • Cyclomatic Complexity · rules.printed_cell (cyclomatic 20) docling/models/stages/form_field/keying/rules.py
  • Cyclomatic Complexity · ReadingOrderModel.__call__ (cyclomatic 19) docling/models/stages/reading_order/readingorder_model.py
  • Cyclomatic Complexity · macros._strip_latex_comments (cyclomatic 18) docling/backend/latex/handlers/macros.py
  • Cyclomatic Complexity · inputs.inputs (cyclomatic 18) docling/models/stages/form_field/keying/inputs.py
  • Cyclomatic Complexity · inputs.stacks (cyclomatic 18) docling/models/stages/form_field/keying/inputs.py
  • Cyclomatic Complexity · MsWordDocumentBackend._handle_tables (cyclomatic 17) docling/backend/msword_backend.py
  • Cyclomatic Complexity · reading_order_rb.build_page_separators (cyclomatic 17) docling/models/postprocessing/reading_order_rb.py
  • Cyclomatic Complexity · nemotron_parse_v3_5_utils._add_chart (cyclomatic 17) docling/utils/nemotron_parse_v3_5_utils.py
  • Cyclomatic Complexity · ai_pr_event.resolve (cyclomatic 16) .github/scripts/ai_pr_event.py
  • Cyclomatic Complexity · MsExcelDocumentBackend._chart_range (cyclomatic 16) docling/backend/msexcel_backend.py
  • Cyclomatic Complexity · MsWordDocumentBackend._iter_paragraph_content (cyclomatic 16) docling/backend/msword_backend.py
  • Cyclomatic Complexity · PageAssembleModel.__call__ (cyclomatic 16) docling/models/stages/page_assemble/page_assemble_model.py
  • Cyclomatic Complexity · chandra_utils.parse_chandra_html (cyclomatic 16) docling/utils/chandra_utils.py
  • Cyclomatic Complexity · nemotron_parse_v3_5_utils.latex_tabular_to_html (cyclomatic 16) docling/utils/nemotron_parse_v3_5_utils.py
  • Cognitive Complexity · candidates.candidates_for (cognitive 94) docling/models/stages/form_field/keying/candidates.py
  • Cognitive Complexity · tables.table_fields (cognitive 79) docling/models/stages/form_field/keying/tables.py
  • Cognitive Complexity · MacroHandlerMixin._macro_definition_spans (cognitive 75) docling/backend/latex/handlers/macros.py
  • Cognitive Complexity · solver._solve (cognitive 54) docling/models/stages/form_field/keying/solver.py
  • Cognitive Complexity · nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 (cognitive 46) docling/utils/nemotron_parse_v3_5_utils.py
  • Cognitive Complexity · macros._strip_latex_comments (cognitive 42) docling/backend/latex/handlers/macros.py
  • Cognitive Complexity · symmetry.sequences (cognitive 38) docling/models/stages/form_field/keying/symmetry.py
  • Cognitive Complexity · rules.printed_cell (cognitive 35) docling/models/stages/form_field/keying/rules.py
  • Cognitive Complexity · inputs.inputs (cognitive 34) docling/models/stages/form_field/keying/inputs.py
  • Cognitive Complexity · EnvironmentHandlerMixin._process_environment (cognitive 32) docling/backend/latex/handlers/environments.py
  • Cognitive Complexity · nemotron_parse_v3_5_utils.latex_tabular_to_html (cognitive 31) docling/utils/nemotron_parse_v3_5_utils.py
  • Cognitive Complexity · MsWordDocumentBackend._get_level_element (cognitive 29) docling/backend/msword_backend.py
  • Cognitive Complexity · OdtDocumentBackend._used_master_pages (cognitive 29) docling/backend/opendocument_backend.py
  • Cognitive Complexity · solver.in_checkbox_blocks (cognitive 25) docling/models/stages/form_field/keying/solver.py
  • Cognitive Complexity · TextHelperMixin._contains_math (cognitive 24) docling/backend/latex/utils/text.py
  • Cognitive Complexity · ai_pr_event.resolve (cognitive 23) .github/scripts/ai_pr_event.py
  • Cognitive Complexity · solver.penalized_pairs (cognitive 23) docling/models/stages/form_field/keying/solver.py
  • Cognitive Complexity · nemotron_parse_v3_5_utils._add_chart (cognitive 23) docling/utils/nemotron_parse_v3_5_utils.py
  • Cognitive Complexity · MsPowerpointDocumentBackend._to_slide_coordinates (cognitive 22) docling/backend/mspowerpoint_backend.py
  • Cognitive Complexity · inputs.stacks (cognitive 22) docling/models/stages/form_field/keying/inputs.py
  • Cognitive Complexity · reading_order_rb.build_page_separators (cognitive 21) docling/models/postprocessing/reading_order_rb.py
  • Cognitive Complexity · ReadingOrderModel._add_rich_table_fields (cognitive 21) docling/models/stages/reading_order/readingorder_model.py
  • Cognitive Complexity · ai_pr_triage.code_segments (cognitive 20) .github/scripts/ai_pr_triage.py
  • Cognitive Complexity · _PageChars.text_in_rect (cognitive 20) docling/backend/pypdfium2_backend.py
  • Cognitive Complexity · MsExcelDocumentBackend._title_text (cognitive 19) docling/backend/msexcel_backend.py
  • Cognitive Complexity · MsExcelDocumentBackend._chart_range (cognitive 19) docling/backend/msexcel_backend.py
  • Cognitive Complexity · inputs.lines (cognitive 19) docling/models/stages/form_field/keying/inputs.py
  • Cognitive Complexity · afp_backend._extract_ptoca_text (cognitive 18) docling/backend/afp_backend.py
  • Cognitive Complexity · LatexDocumentBackend._process_nodes (cognitive 18) docling/backend/latex/backend.py
  • Cognitive Complexity · validate_asr_models.run_models (cognitive 18) scripts/validate_asr_models.py
  • Cognitive Complexity · ai_pr_triage.publish (cognitive 16) .github/scripts/ai_pr_triage.py
  • Cognitive Complexity · macros._simple_declaration_end (cognitive 16) docling/backend/latex/handlers/macros.py
  • Cognitive Complexity · LatexMetadataHandler._unwrap_parboxes (cognitive 16) docling/backend/latex/handlers/metadata.py
  • Cognitive Complexity · ReadingOrderModel._readingorder_elements_to_docling_doc (cognitive 16) docling/models/stages/reading_order/readingorder_model.py
  • Cognitive Complexity · ReadingOrderModel._handle_text_element (cognitive 16) docling/models/stages/reading_order/readingorder_model.py
  • Cognitive Complexity · BasePipeline._enrich_document (cognitive 16) docling/pipeline/base_pipeline.py
  • God Classes · FileTooLong: cli/main.py docling/cli/main.py
  • God Classes · FileTooLong: backend/pypdfium2_backend.py docling/backend/pypdfium2_backend.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) docling/backend/msexcel_backend.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) docling/models/base_ocr_model.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) docling/models/vlm_pipeline_models/api_vlm_model.py
  • Code Duplication · Duplicated block (37 lines × 2) docling/backend/msword_backend.py
  • Code Duplication · Duplicated block (29–33 lines × 2) REDACTED
  • Code Duplication · Duplicated block (23–24 lines × 2) docling/backend/latex/backend.py
  • Code Duplication · Duplicated block (19–21 lines × 2) docling/backend/msword_backend.py
  • Code Duplication · Duplicated block (15 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py
  • Code Duplication · Duplicated block (14 lines × 2) docling/document_converter.py
  • Code Duplication · Duplicated block (12–13 lines × 3) docling/utils/mineru_utils.py
  • Code Duplication · Duplicated block (13 lines × 2) docling/backend/msword_backend.py
  • Code Duplication · Duplicated block (13 lines × 2) docling/backend/msword_backend.py
  • Code Duplication · Duplicated block (12 lines × 2) docling/pipeline/vlm_pipeline.py
  • Code Duplication · Duplicated block (10 lines × 2) docling/backend/msword_backend.py
  • Code Duplication · Duplicated block (8 lines × 2) docling/service_client/client.py
  • Churn × Complexity Hotspots · Hotspot: docling/backend/msexcel_backend.py docling/backend/msexcel_backend.py
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: docling/backend/latex/utils/text.py docling/backend/latex/utils/text.py
  • Churn × Complexity Hotspots · Hotspot: docling/backend/latex/handlers/environments.py docling/backend/latex/handlers/environments.py
  • Churn × Complexity Hotspots · Hotspot: docling/models/stages/reading_order/readingorder_model.py docling/models/stages/reading_order/readingorder_model.py
  • Churn × Complexity Hotspots · Hotspot: docling/backend/epub_backend.py docling/backend/epub_backend.py
  • Churn × Complexity Hotspots · Hotspot: docling/experimental/pipeline/threaded_layout_vlm_pipeline.py docling/experimental/pipeline/threaded_layout_vlm_pipeline.py
  • Churn × Complexity Hotspots · Hotspot: docling/models/vlm_pipeline_models/mlx_model.py docling/models/vlm_pipeline_models/mlx_model.py
  • Churn × Complexity Hotspots · Hotspot: .github/scripts/ai_pr_triage.py .github/scripts/ai_pr_triage.py
  • Churn × Complexity Hotspots · Hotspot: docling/models/stages/page_assemble/page_assemble_model.py docling/models/stages/page_assemble/page_assemble_model.py
  • Churn × Complexity Hotspots · Hotspot: docling/models/inference_engines/vlm/vllm_engine.py docling/models/inference_engines/vlm/vllm_engine.py
  • Churn × Complexity Hotspots · Hotspot: docling/utils/nemotron_parse_utils.py docling/utils/nemotron_parse_utils.py
  • Churn × Complexity Hotspots · Hotspot: docling/backend/afp_backend.py docling/backend/afp_backend.py
  • Churn × Complexity Hotspots · Repeated repair: docling/utils/vlm_utils.py docling/utils/vlm_utils.py
  • Churn × Complexity Hotspots · Repeated repair: docling/backend/pypdfium2_backend.py docling/backend/pypdfium2_backend.py
  • Churn × Complexity Hotspots · Repeated repair: docling/backend/latex/backend.py docling/backend/latex/backend.py
  • Churn × Complexity Hotspots · Repeated repair: docling/backend/json/docling_json_backend.py docling/backend/json/docling_json_backend.py
  • Churn × Complexity Hotspots · Repeated repair: docling/models/inference_engines/vlm/api_openai_compatible_engine.py docling/models/inference_engines/vlm/api_openai_compatible_engine.py
  • Churn × Complexity Hotspots · Repeated repair: docling/models/stages/ocr/tesseract_ocr_cli_model.py docling/models/stages/ocr/tesseract_ocr_cli_model.py
  • Churn × Complexity Hotspots · Repeated repair: REDACTED REDACTED
  • Churn × Complexity Hotspots · Repeated repair: docling/backend/latex/engines/tectonic.py docling/backend/latex/engines/tectonic.py
  • Churn × Complexity Hotspots · Repeated repair: docling/backend/ebcdic_backend.py docling/backend/ebcdic_backend.py
  • Churn × Complexity Hotspots · Repeated repair: docling/models/extraction/transformers_extraction_model.py docling/models/extraction/transformers_extraction_model.py
  • Churn × Complexity Hotspots · Repeated repair: docling/models/vlm_pipeline_models/api_vlm_model.py docling/models/vlm_pipeline_models/api_vlm_model.py

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 32 findings

These 32 critical or serious findings were in the previous survey, on 11 October 2026, and are gone from this one.

  • Cyclomatic Complexity · MsExcelDocumentBackend._chart_to_table_data (cyclomatic 18) docling/backend/msexcel_backend.py
  • Cognitive Complexity · ai_pr_review.code_segments (cognitive 20) .github/scripts/ai_pr_review.py
  • Cognitive Complexity · ai_pr_review.parse_review_result (cognitive 20) .github/scripts/ai_pr_review.py
  • Cognitive Complexity · MacroHandlerMixin._extract_preamble_metadata (cognitive 19) docling/backend/latex/handlers/macros.py
  • Cognitive Complexity · MsExcelDocumentBackend._copy_reference_into (cognitive 19) docling/backend/msexcel_backend.py
  • Cognitive Complexity · pr_approval_reminder.build_message (cognitive 16) .github/scripts/pr_approval_reminder.py
  • Cognitive Complexity · MsPowerpointDocumentBackend._chart_to_table_data (cognitive 16) docling/backend/mspowerpoint_backend.py
  • God Classes · FileTooLong: scripts/ai_pr_review.py .github/scripts/ai_pr_review.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) docling/backend/msexcel_backend.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) docling/models/base_ocr_model.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) docling/models/vlm_pipeline_models/api_vlm_model.py
  • Code Duplication · Duplicated block (40 lines × 3) docling/backend/msexcel_backend.py
  • Code Duplication · Duplicated block (26–28 lines × 2) docling/backend/msword_backend.py
  • Code Duplication · Duplicated block (17 lines × 2) docling/pipeline/vlm_pipeline.py
  • Code Duplication · Duplicated block (14 lines × 2) docling/document_converter.py
  • Code Duplication · Duplicated block (10 lines × 2) docling/service_client/client.py
  • Churn × Complexity Hotspots · Hotspot: docling/models/stages/ocr/auto_ocr_model.py docling/models/stages/ocr/auto_ocr_model.py
  • Churn × Complexity Hotspots · Repeated repair: docling/models/stages/picture_description/picture_description_vlm_engine_model.py docling/models/stages/picture_description/picture_description_vlm_engine_model.py
  • Explicit Debt · TodoComment docling/backend/xml/jats_backend.py
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Change Coupling · Change coupling: docling_parse_backend.py ↔ pypdfium2_backend.py docling/backend/docling_parse_backend.py
  • Change Coupling · Change coupling: granite_vision.py ↔ model_downloader.py docling/models/stages/chart_extraction/granite_vision.py
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Exception handling · Swallowed exception (empty catch) docling/backend/latex/handlers/macros.py
  • Exception handling · Swallowed exception (caught, then discarded) docling/service_client/client.py
Rebuild cost: about €180,000 · Estimate
Cost to rebuild€59,000 to €290,000, for 977 to 3,100 hours of work, about 1.2 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 61. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 91,349 lines of product code

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Raises the score by about 8 points · Medium effort · Security & performance tooling
2
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 2 points · Low effort · ADR Quality
3
Interpolated log message defeats structured logging
Raises the score by about 3 points · Medium effort · Structured logging

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €180,000 to build again, about 1.2 person-years of work. Its weakest lens is Production Readiness, at 48 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 156,428 lines over the last 90 days, which is about 634,402 lines a year. At that pace, the extra work comes to an estimated 66.2 to 397.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch docling docling docling-slim docling-slim docling->docling-slim docling-client docling-client docling-client->docling-slim

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

261 modules, with 509 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 221 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 .github.scripts2 docling.backend.abstract_backend3 docling.backend.iwork.content4 docling.datamodel.accelerator_options5 docling.datamodel.base_models6 docling.datamodel.pipeline_options_vlm_model7 docling.models.inference_engines.object_detection.base8 docling.models.inference_engines.vlm.base9 docling.models.utils.hf_model_download10 docling.utils.ocr_language11 docling.backend.iwork.archives12 docling.datamodel.document13 docling.datamodel.service.responses14 docling.datamodel.stage_model_specs15 docling.datamodel.vlm_engine_options16 docling.models.inference_engines.image_classification.hf_base17 docling.models.inference_engines.object_detection.hf_base18 docling.backend.iwork19 docling.backend.iwork_backend20 docling.backend.latex.backend21 docling.backend.pdf_backend22 docling.datamodel.pipeline_options23 docling.service_client.client24 docling.backend25 docling.models.base_model26 docling.models.stages.layout.layout_object_detection_model27 docling.pipeline.base_pipeline28 docling.service_client._async_client29 docling.utils30 docling.models.base_ocr_model31 docling.models.picture_description_base_model32 docling.pipeline.native_pdf_pipeline33 docling.pipeline.simple_pipeline34 docling.pipeline.standard_pdf_pipeline35 docling.pipeline.vlm_pipeline36 docs.examples37 docling.experimental.pipeline.threaded_layout_vlm_pipeline38 docling.models.stages.ocr._nemotron_ocr_model39 docling.models.stages.ocr.nemotron_ocr_model40 docling.models.stages.ocr.rapid_ocr_model
1 .github.scripts
2 docling.backend.abstract_backend
3 docling.backend.iwork.content
4 docling.datamodel.accelerator_options
5 docling.datamodel.base_models
6 docling.datamodel.pipeline_options_vlm_model
7 docling.models.inference_engines.object_detection.base
8 docling.models.inference_engines.vlm.base
9 docling.models.utils.hf_model_download
10 docling.utils.ocr_language
11 docling.backend.iwork.archives1
12 docling.datamodel.document25
13 docling.datamodel.service.responses8
14 docling.datamodel.stage_model_specs122
15 docling.datamodel.vlm_engine_options6
16 docling.models.inference_engines.image_classification.hf_base1
17 docling.models.inference_engines.object_detection.hf_base14
18 docling.backend.iwork61
19 docling.backend.iwork_backend513
20 docling.backend.latex.backend11
21 docling.backend.pdf_backend11
22 docling.datamodel.pipeline_options138
23 docling.service_client.client4381
24 docling.backend511
25 docling.models.base_model1151
26 docling.models.stages.layout.layout_object_detection_model11111
27 docling.pipeline.base_pipeline1433
28 docling.service_client._async_client165
29 docling.utils61
30 docling.models.base_ocr_model112112
31 docling.models.picture_description_base_model112
32 docling.pipeline.native_pdf_pipeline111211
33 docling.pipeline.simple_pipeline11111
34 docling.pipeline.standard_pdf_pipeline11311
35 docling.pipeline.vlm_pipeline131111
36 docs.examples1111
37 docling.experimental.pipeline.threaded_layout_vlm_pipeline12112
38 docling.models.stages.ocr._nemotron_ocr_model112111
39 docling.models.stages.ocr.nemotron_ocr_model112111
40 docling.models.stages.ocr.rapid_ocr_model12111
Uses a module listed above itPart of a loopThe module itself
1 .github.scripts2 docling.backend.abstract_backend3 docling.backend.iwork.content4 docling.datamodel.accelerator_options5 docling.datamodel.base_models6 docling.datamodel.pipeline_options_vlm_model7 docling.models.inference_engines.object_detection.base8 docling.models.inference_engines.vlm.base9 docling.models.utils.hf_model_download10 docling.utils.ocr_language11 docling.backend.iwork.archives12 docling.datamodel.document13 docling.datamodel.service.responses14 docling.datamodel.stage_model_specs15 docling.datamodel.vlm_engine_options16 docling.models.inference_engines.image_classification.hf_base17 docling.models.inference_engines.object_detection.hf_base18 docling.backend.iwork19 docling.backend.iwork_backend20 docling.backend.latex.backend21 docling.backend.pdf_backend22 docling.datamodel.pipeline_options23 docling.service_client.client24 docling.backend25 docling.models.base_model26 docling.models.stages.layout.layout_object_detection_model27 docling.pipeline.base_pipeline28 docling.service_client._async_client29 docling.utils30 docling.models.base_ocr_model31 docling.models.picture_description_base_model32 docling.pipeline.native_pdf_pipeline33 docling.pipeline.simple_pipeline34 docling.pipeline.standard_pdf_pipeline35 docling.pipeline.vlm_pipeline36 docs.examples37 docling.experimental.pipeline.threaded_layout_vlm_pipeline38 docling.models.stages.ocr._nemotron_ocr_model39 docling.models.stages.ocr.nemotron_ocr_model40 docling.models.stages.ocr.rapid_ocr_model.github.scripts1docling.backend.abstract_backend2docling.backend.iwork.content3docling.datamodel.accelerator_options4docling.datamodel.base_models5docling.datamodel.pipeline_options_vlm_model6docling.models.inference_engines.object_detection.base7docling.models.inference_engines.vlm.base8docling.models.utils.hf_model_download9docling.utils.ocr_language10docling.backend.iwork.archives11docling.datamodel.document12docling.datamodel.service.responses13docling.datamodel.stage_model_specs14docling.datamodel.vlm_engine_options15docling.models.inference_engines.image_classification.hf_base16docling.models.inference_engines.object_detection.hf_base17docling.backend.iwork18docling.backend.iwork_backend19docling.backend.latex.backend20docling.backend.pdf_backend21docling.datamodel.pipeline_options22docling.service_client.client23docling.backend24docling.models.base_model25docling.models.stages.layout.layout_object_detection_model26docling.pipeline.base_pipeline27docling.service_client._async_client28docling.utils29docling.models.base_ocr_model30docling.models.picture_description_base_model31docling.pipeline.native_pdf_pipeline32docling.pipeline.simple_pipeline33docling.pipeline.standard_pdf_pipeline34docling.pipeline.vlm_pipeline35docs.examples36docling.experimental.pipeline.threaded_layout_vlm_pipeline37docling.models.stages.ocr._nemotron_ocr_model38docling.models.stages.ocr.nemotron_ocr_model39docling.models.stages.ocr.rapid_ocr_model40125812261146151311111384381511115111111143316561112112112111211111111131113111111111211211211111211112111+221 more modules (most-connected shown)

At a glance — Code Health · 65% · Adequate · gated by D2, X4 ·

At a glance — Architecture · 86% · Adequate · gated by D26 ·

At a glance — Maturity · 75% · Strong ·

At a glance — Readiness · 48% · Weak · gated by D12, P3 ·

At a glance — Security · 78% · Adequate · gated by D29 ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection21High / Critical
A03:2025 — Software Supply Chain Failures15High / Critical
A02:2025 — Security Misconfiguration8High / Critical

Roadmap

First, integrate static analysis into the CI pipeline to automatically block security regressions. Next, refactor the codebase to implement structured logging and properly handle exceptions instead of discarding them. Finally, establish a dedicated folder for Architecture Decision Records to document significant design choices and their consequences.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.+8.3 ptsMediumSecurity & performance tooling
Resolve the 1 No ADRs found finding(s) in ADR Quality.+1.6 ptsLowADR Quality
Interpolated log message defeats structured logging+3.1 ptsMediumStructured logging
Swallowed exception (caught, then discarded)+1.4 ptsMediumException handling
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.+0.6 ptsLowProject Cohesion
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+1.1 ptsMediumArchitecture documentation
Resolve the 2 Documentation finding(s) in Documentation Quality — start with README.md (2).+0.5 ptsLowDocumentation Quality
Resolve the 32 FileTooLong finding(s) in God Classes — start with html_backend.py, msword_backend.py, opendocument_backend.py.+0.9 ptsHighGod Classes

File quality

Per-file score 0–10 — a quality signature. Of 149 files carrying findings, judged against the Production bar: 1% slop · 74% mixed · 25% near-clean.

FileScoreBandWorst signal
REDACTED0.9SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
docling/service_client/client.py5.5MixedGod Classes: FileTooLong: service_client/client.py
docling/models/vlm_pipeline_models/api_vlm_model.py5.6MixedCognitive Complexity: ApiVlmModel.__call__ (cognitive 16)
REDACTED5.6MixedIaC & Container Security: Medium IaC: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
docling/backend/html_backend.py6.0MixedExplicit Debt: HackComment
docling/cli/main.py6.0MixedExplicit Debt: FixmeComment
docling/backend/xml/xbrl_backend.py6.0MixedExplicit Debt: TodoComment
docling/backend/xml/jats_backend.py6.0MixedExplicit Debt: TodoComment
docling/backend/mets_gbs_backend.py6.0MixedExplicit Debt: TodoComment
docling/backend/epub_backend.py6.0MixedExplicit Debt: TodoComment
docling/models/stages/reading_order/readingorder_model.py6.0MixedExplicit Debt: TodoComment
docling/models/extraction/nuextract_transformers_model.py6.0MixedExplicit Debt: TodoComment

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 17

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 745

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 120

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 14

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 56 of 60 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 60 dimensions across the health lenses
D1D2D3D4D5D6D9D12D13D14D15D16D17D19D20D21D22D26D28D29D30D31D34D35D36D37D43D44AX10AX3AX4M1M2M3M4P1P10P2P3P4P6PF3X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X3X30X4

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 868 of 882 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a170ab-44d8-73e1-9871-0a9b1dc7aa81.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a Codecov configuration (.github/codecov.yml, target 80%) and a coverage step in CI (`pytest -v --durations=0 --cov=docling --cov-branch --cov-rep…`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.py), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py) and this repository declares a Python test suite (repository root, 214 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/bui…; runtime evidence skipped.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 247 further occurrence(s) are not listed individually; the score already reflects all 287.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (4): D19, D21, D22, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity4.1 / 10Weak✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 4.1 / 10 · rule-coverage 100% · ceiling Prevented

142 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was HTMLDocumentBackend._extract_form_region at 97. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being _DocumentConversionInput._mime_from_extension at 26 — they are counted neither in the figure above nor in this dimension's score.

PatentHandler._add_property (cyclomatic 23) · ×2REDACTED:484
HTMLDocumentBackend._extract_form_region (cyclomatic 97)docling/backend/html_backend.py:4609
main.convert (cyclomatic 82)docling/cli/main.py:912
MacroHandlerMixin._process_macro (cyclomatic 72)docling/backend/latex/handlers/macros.py:520
MarkdownDocumentBackend._iterate_elements (cyclomatic 64)docling/backend/md_backend.py:701

+ 136 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 4 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with HTMLDocumentBackend._extract_form_region (cyclomatic 97), main.convert (cyclomatic 82), MacroHandlerMixin._process_macro (cyclomatic 72). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cyclomatic Complexity from 4.1 to about 5.1/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

281 method(s) exceeded the cognitive complexity threshold of 15; the worst was HTMLDocumentBackend._extract_form_region at 235.

PatentHandler.skippedEntity (cognitive 18) · ×3REDACTED:383
HTMLDocumentBackend._extract_form_region (cognitive 235)docling/backend/html_backend.py:4609
HTMLDocumentBackend._handle_list (cognitive 149)docling/backend/html_backend.py:3067
MacroHandlerMixin._process_macro (cognitive 132)docling/backend/latex/handlers/macros.py:520
XmlTable._parse_table (cognitive 131)REDACTED:1659

+ 274 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 20 bodies over 60 down to 60 or less in Cognitive Complexity — start with HTMLDocumentBackend._extract_form_region (cognitive 235), HTMLDocumentBackend._handle_list (cognitive 149), MacroHandlerMixin._process_macro (cognitive 132). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 20 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.3 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Prevented

41 god class(es) detected.

FileTooLong: backend/html_backend.py · ×32docling/backend/html_backend.py
TooManyMethods: HTMLDocumentBackend · ×9docling/backend/html_backend.py:514

What to do

  1. Resolve the 32 FileTooLong finding(s) in God Classes — start with html_backend.py, msword_backend.py, opendocument_backend.py. — One of this dimension's main actionable groups (32 warning-level).
  2. Resolve the 9 TooManyMethods finding(s) in God Classes — start with client.py (2), html_backend.py, msword_backend.py. — One of this dimension's main actionable groups (9 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.3 / 10Stronggated by 140 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Verified

134 duplicated block group(s) detected. A further 6 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (10 lines × 2) · ×9docling/backend/html_backend.py:1944
Duplicated block (14 lines × 2) · ×7docling/backend/mets_gbs_backend.py:485
Duplicated block (16 lines × 2) · ×6docling/backend/latex/utils/table.py:77
Duplicated block (13 lines × 2) · ×6docling/backend/msword_backend.py:2945
Duplicated block (12 lines × 2) · ×6docling/backend/html_backend.py:2145

+ 77 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 9 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with html_backend.py (3), transformers_engine.py (2), archives.py. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 7 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with asr_transcriber.py (2), mets_gbs_backend.py, document_converter.py. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 6 Duplicated block (16 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), table.py, msexcel_backend.py. — One of this dimension's main actionable groups (6 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling7.3 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 7.3 / 10 · rule-coverage 100% · ceiling Prevented

3 production modules (Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence, with abstractness counted on 1 of the 3 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: docling-slim

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

1 of 163 classes have LCOM4 above 3.

Low cohesion: _BaseDoclingServiceClient (LCOM4 11)docling/service_client/client.py:312

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with client.py. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

2676 test methods: 2656 unit, 13 integration, 0 BDD, 7 e2e. The Python suite contributes 2676 test function(s) across 214 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D12 · Dependency Hygiene10.0 1.0 / 10Critical✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 1.0 / 10 · rule-coverage 10% · ceiling Verified

0 outdated, 0 yanked pinned Python distributions. 1 of 10 shipped distributions were graded against pypi.org (0 not published there, 9 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.

What to do

  1. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d12_recommendation.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 44 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 10 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (34 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 1 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.2 / 10Stronggated by 59 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: docling/cli/main.py (33×82=2706); docling/backend/msword_backend.py (46×41=1886); docling/backend/html_backend.py (31×56=1736) Repeated repair below the complexity floor: docling/backend/csv_backend.py (10 of 11 changes were fixes); docling/backend/image_backend.py (5 of 6 changes were fixes); docling/utils/vlm_utils.py (5 of 6 changes were fixes)

Hotspot: docling/cli/main.py · ×43docling/cli/main.py:912
Repeated repair: docling/backend/csv_backend.py · ×16docling/backend/csv_backend.py:160

What to do

  1. Resolve the 43 Hotspot finding(s) in Churn × Complexity Hotspots — start with main.py, msword_backend.py, html_backend.py. — One of this dimension's main actionable groups (43 warning-level).
  2. Resolve the 16 Repeated repair finding(s) in Churn × Complexity Hotspots — start with csv_backend.py, image_backend.py, vlm_utils.py. — One of this dimension's main actionable groups (16 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.5 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

11 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is docling/backend/iwork/archives.py. Counted over 214 of the 306 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.9 / 10Stronggated by 36 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Prevented

36 deducted task-comment markers across 91349 LoC (0.0/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×29docling/document_converter.py:634
FixmeComment · ×5docling/cli/main.py:1826
HackComment · ×2docling/backend/html_backend.py:5225

What to do

  1. Resolve the 29 TodoComment finding(s) in Explicit Debt — start with jats_backend.py (8), readingorder_model.py (4), test_backend_vtt.py (3). — One of this dimension's main actionable groups (29 warning-level).
  2. Resolve the 5 FixmeComment finding(s) in Explicit Debt — start with main.py, picture_description_base_model.py, document_picture_classifier.py. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 2 HackComment finding(s) in Explicit Debt — start with html_backend.py, tesseract_ocr_cli_model.py. — One of this dimension's main actionable groups (2 warning-level).
  4. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation QualityStrong◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

The repository's root README and the actor/README are both excellent at describing what Docling is (the project name, its purpose, a live badge, an arXiv reference), plus the full list of features, usage examples, and installation steps. The actor/README also contains a detailed architecture decision guide for Pydantic AI tools registration, output modes, multi-agent patterns, and comparison tables, which is a strong internal design document. All visible documents are well-structured with headings; none is missing an overview or the standard 'how to run it' section. The architecture decision guide is excellent: a single header with an explicit Contents outline (Task-Family References / Decision Trees / Comparison Tables / Architecture Overview), and each section in the outline is named and present. The document is a deep, well-organized reference for Pydantic AI tool registration, output modes, multi-agent patterns, and capability selection, written by an internal team with no external audience. It is internally focused but otherwise complete.

Documentation: no project overview · ×2README.md

What to do

  1. Resolve the 2 Documentation finding(s) in Documentation Quality — start with README.md (2). — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 API inconsistencies across a 400-member sample of 867 exposed types.

✓ On the Gold path — maintain.

Detailed fixes: d22_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 build units (Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)1.8 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 1.8 / 10 · rule-coverage 100% · ceiling Documented

21 finding(s): 0 critical, 11 high, 9 medium, 1 low. 4 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 2 file(s) — `.github/scripts/release.sh` (lines 30–40), `docs/overrides/main.html` (lines 1–4, lines 6–7) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  3. No action in Static Analysis (SAST) — all 4 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (4 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities6.5 / 10Adequate✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 6.5 / 10 · rule-coverage 100% · ceiling Documented

7 finding(s): 1 critical, 3 high, 2 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security8.8 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Documented

8 finding(s): 0 critical, 2 high, 5 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 5 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

2 of 214 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is docling/utils/speaker_diarization.py. Counted over 214 of the 306 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×2docling/utils/speaker_diarization.py:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling9.9 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: api_vlm_model.py↔mlx_model.py 54%; layout_model.py↔standard_pdf_pipeline.py 50%

Change coupling: api_vlm_model.py ↔ mlx_model.py · ×2docling/models/vlm_pipeline_models/api_vlm_model.py:1

What to do

  1. Resolve the 2 Change coupling finding(s) in Change Coupling — start with api_vlm_model.py, layout_model.py. — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

2/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (.github/SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 10 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

  • Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.

What to do

  • Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
M4 · Documentation accuracy9.4 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • .actor/README.md documents the environment variable `DOCLING_LOG`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — .actor/README.md:119
  • docs/integrations/apify.md documents the environment variable `OUTPUT_RESULT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/integrations/apify.md:19
  • docs/integrations/apify.md documents the environment variable `DOCLING_LOG`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/integrations/apify.md:20
  • docs/usage/mcp.md documents the environment variable `DOCLING_CONVERSION_MODE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/mcp.md:38
  • docs/usage/processing_audio_media.md documents the environment variable `TURBOCTC_NC`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/processing_audio_media.md:470
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_KIND`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:12
  • docs/usage/api_server/deployment.md documents the environment variable `UVICORN_HOST`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:30
  • docs/usage/api_server/deployment.md documents the environment variable `UVICORN_PORT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:30
  • docs/usage/api_server/deployment.md documents the environment variable `UVICORN_WORKERS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:31
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_API_KEY`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:32
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENABLE_UI`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:33
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ARTIFACTS_PATH`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:34
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_MAX_NUM_PAGES`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:35
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_MAX_FILE_SIZE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:35
  • docs/usage/api_server/deployment.md documents the setting `kfp`, but no code or configuration file names `kfp`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:36
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_PERF_ELEMENTS_BATCH_SIZE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:49
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_DEBUG_PROFILE_PIPELINE_TIMINGS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:50
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_LOC_NUM_WORKERS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:58
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_LOC_SHARE_MODELS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:58
  • docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_RQ_REDIS_URL`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/deployment.md:118
  • docs/usage/api_server/index.md documents the environment variable `DOCLING_SERVE_API_KEY`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/index.md:23
  • docs/usage/api_server/rest_api.md documents the environment variable `DOCLING_SERVE_API_KEY`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/usage/api_server/rest_api.md:24

What to do

  • Reconcile the README with reality: .actor/README.md documents the environment variable `DOCLING_LOG`, but no code, script or configuration file names it; docs/integrations/apify.md documents the environment variable `OUTPUT_RESULT`, but no code, script or configuration file names it; docs/integrations/apify.md documents the environment variable `DOCLING_LOG`, but no code, script or configuration file names it; docs/usage/mcp.md documents the environment variable `DOCLING_CONVERSION_MODE`, but no code, script or configuration file names it; docs/usage/processing_audio_media.md documents the environment variable `TURBOCTC_NC`, but no code, script or configuration file names it.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 85471 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation7.8 / 10Strong✓ Tool-verified

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

  • `debug` at line 1293 is called with an argument built by `sorted(missing_page_nos)` (line 1296), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — docling/pipeline/standard_pdf_pipeline.py:1293
  • `debug` at line 358 is called with an argument built by `json.dumps(payload, indent = 2)` (line 359), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — REDACTED:358

What to do

  • In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling7.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×10) — docling/backend/opendocument_backend.py:1043, docling/backend/msword_backend.py:569, docling/backend/mspowerpoint_backend.py:834, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×5) — docling/backend/msword_backend.py:1488, docling/backend/msword_backend.py:2310, docling/backend/docx/drawingml/utils.py:163, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. (×4) — docling/models/inference_engines/common/kserve_v2_grpc.py:234, docling/models/inference_engines/image_classification/api_kserve_v2_engine.py:198, docling/models/inference_engines/object_detection/api_kserve_v2_engine.py:259, …

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `info` at line 237 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docling/document_extractor.py:237
  • `info` at line 308 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docling/document_extractor.py:308
  • `debug` at line 315 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/document_extractor.py:315
  • `info` at line 916 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docling/document_converter.py:916
  • `info` at line 937 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docling/document_converter.py:937
  • `debug` at line 944 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/document_converter.py:944
  • `info` at line 390 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/pypdfium2_backend.py:390
  • `debug` at line 2353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/opendocument_backend.py:2353
  • `info` at line 2360 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/opendocument_backend.py:2360
  • `debug` at line 2611 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/opendocument_backend.py:2611
  • `debug` at line 2613 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/opendocument_backend.py:2613
  • `debug` at line 25 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/noop_backend.py:25
  • `debug` at line 32 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/noop_backend.py:32
  • `debug` at line 38 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/noop_backend.py:38
  • `error` at line 42 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/noop_backend.py:42
  • `warning` at line 1166 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:1166
  • `debug` at line 1307 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:1307
  • `debug` at line 1340 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:1340
  • `debug` at line 1433 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:1433
  • `debug` at line 1658 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:1658
  • `debug` at line 1909 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:1909
  • `debug` at line 3942 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:3942
  • `debug` at line 4016 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:4016
  • `debug` at line 4284 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:4284
  • `warning` at line 4325 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:4325
  • `debug` at line 4396 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:4396
  • `warning` at line 4894 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:4894
  • `debug` at line 4982 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:4982
  • `debug` at line 5007 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:5007
  • `debug` at line 5049 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:5049
  • `debug` at line 5054 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msword_backend.py:5054
  • `debug` at line 2094 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/mspowerpoint_backend.py:2094
  • `debug` at line 2117 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/mspowerpoint_backend.py:2117
  • `debug` at line 2161 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/mspowerpoint_backend.py:2161
  • `debug` at line 2165 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/mspowerpoint_backend.py:2165
  • `debug` at line 720 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msexcel_backend.py:720
  • `debug` at line 771 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msexcel_backend.py:771
  • `debug` at line 784 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msexcel_backend.py:784
  • `debug` at line 787 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msexcel_backend.py:787
  • `debug` at line 796 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — docling/backend/msexcel_backend.py:796

What to do

  • Interpolated log message defeats structured logging

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health65%Adequate — gated by D2, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture86%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity75%StrongSolid.
Readiness48%Weak — gated by D12, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security78%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100%ExemplaryStrongest area.
Unscored — 4 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 55 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/bui…; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~69912 lines of test source are present (.py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .py suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Aggregate roots were found in only one source directory (docling), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.py), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 197 value object(s)
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 17 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
Serious — 745 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×43
  • Hotspot: docling/cli/main.py docling/cli/main.py:912 — docling/cli/main.py changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in main.convert at line 912. 12 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/cli/main.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/msword_backend.py docling/backend/msword_backend.py:1224 — docling/backend/msword_backend.py changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in MsWordDocumentBackend._walk_linear at line 1224. 40 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/msword_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/html_backend.py docling/backend/html_backend.py:3067 — docling/backend/html_backend.py changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in HTMLDocumentBackend._handle_list at line 3067. 28 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/html_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/md_backend.py docling/backend/md_backend.py:701 — docling/backend/md_backend.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in MarkdownDocumentBackend._iterate_elements at line 701. 16 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/md_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/asciidoc_backend.py docling/backend/asciidoc_backend.py:195 — docling/backend/asciidoc_backend.py changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in AsciiDocBackend._parse at line 195. 20 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/asciidoc_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/datamodel/document.py docling/datamodel/document.py:815 — docling/datamodel/document.py changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in _DocumentConversionInput._guess_format at line 815. 11 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/datamodel/document.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/latex/handlers/macros.py docling/backend/latex/handlers/macros.py:520 — docling/backend/latex/handlers/macros.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in MacroHandlerMixin._process_macro at line 520. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/latex/handlers/macros.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/mspowerpoint_backend.py docling/backend/mspowerpoint_backend.py:985 — docling/backend/mspowerpoint_backend.py changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in MsPowerpointDocumentBackend._handle_text_elements at line 985. 21 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/mspowerpoint_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/opendocument_backend.py docling/backend/opendocument_backend.py:1918 — docling/backend/opendocument_backend.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in OdtDocumentBackend._detach_annotations at line 1918. 18 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/opendocument_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/xml/jats_backend.py docling/backend/xml/jats_backend.py:1305 — docling/backend/xml/jats_backend.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in JatsDocumentBackend._walk_linear at line 1305. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/xml/jats_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/utils/chandra_utils.py docling/utils/chandra_utils.py:387 — docling/utils/chandra_utils.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in _ChandraDocumentBuilder._emit_runs at line 387. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/utils/chandra_utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/pipeline/standard_pdf_pipeline.py docling/pipeline/standard_pdf_pipeline.py:890 — docling/pipeline/standard_pdf_pipeline.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in StandardPdfPipeline._build_document at line 890. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/pipeline/standard_pdf_pipeline.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/utils/model_downloader.py docling/utils/model_downloader.py:149 — docling/utils/model_downloader.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in model_downloader.download_models at line 149. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/utils/model_downloader.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/models/inference_engines/vlm/transformers_engine.py docling/models/inference_engines/vlm/transformers_engine.py:382 — docling/models/inference_engines/vlm/transformers_engine.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in TransformersVlmEngine.predict_batch at line 382. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/models/inference_engines/vlm/transformers_engine.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/pipeline/vlm_pipeline.py docling/pipeline/vlm_pipeline.py:520 — docling/pipeline/vlm_pipeline.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in VlmPipeline._finalize_page_document at line 520. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/pipeline/vlm_pipeline.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/xml/xbrl_backend.py docling/backend/xml/xbrl_backend.py:266 — docling/backend/xml/xbrl_backend.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in XBRLDocumentBackend.convert at line 266. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/xml/xbrl_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/models/stages/ocr/rapid_ocr_model.py docling/models/stages/ocr/rapid_ocr_model.py:470 — docling/models/stages/ocr/rapid_ocr_model.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in RapidOcrModel.__init__ at line 470. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/models/stages/ocr/rapid_ocr_model.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/msexcel_backend.py docling/backend/msexcel_backend.py:670 — docling/backend/msexcel_backend.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in MsExcelDocumentBackend._parse_threaded_comments at line 670. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/msexcel_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/cli/models.py docling/cli/models.py:127 — docling/cli/models.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in models.download at line 127. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/cli/models.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:304 — REDACTED changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in api_image_request.api_image_request_streaming at line 304. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/models/base_ocr_model.py docling/models/base_ocr_model.py:372 — docling/models/base_ocr_model.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in BaseOcrModel._find_pdf_aware_layout_ocr_rects at line 372. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/models/base_ocr_model.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/email_backend.py docling/backend/email_backend.py:155 — docling/backend/email_backend.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in EmailDocumentBackend._msg_to_rfc822_bytes at line 155. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/email_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/utils/dots_utils.py docling/utils/dots_utils.py:216 — docling/utils/dots_utils.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in dots_utils.parse_dots_json at line 216. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/utils/dots_utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/latex/utils/text.py docling/backend/latex/utils/text.py:313 — docling/backend/latex/utils/text.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in TextHelperMixin._macro_node_to_text at line 313. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/latex/utils/text.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docling/backend/latex/handlers/environments.py docling/backend/latex/handlers/environments.py:85 — docling/backend/latex/handlers/environments.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in EnvironmentHandlerMixin._process_environment at line 85. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/latex/handlers/environments.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 18 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×32
  • FileTooLong: backend/html_backend.py docling/backend/html_backend.py — FileTooLong — 4215 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3715 over it, 8.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/msword_backend.py docling/backend/msword_backend.py — FileTooLong — 3131 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2631 over it, 6.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/opendocument_backend.py docling/backend/opendocument_backend.py — FileTooLong — 1986 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1486 over it, 3.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: service_client/client.py docling/service_client/client.py — FileTooLong — 1922 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1422 over it, 3.84× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/msexcel_backend.py docling/backend/msexcel_backend.py — FileTooLong — 1383 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 883 over it, 2.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1350 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 850 over it, 2.70× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: datamodel/pipeline_options.py docling/datamodel/pipeline_options.py — FileTooLong — 1277 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 777 over it, 2.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/mspowerpoint_backend.py docling/backend/mspowerpoint_backend.py — FileTooLong — 1246 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 746 over it, 2.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: xml/jats_backend.py docling/backend/xml/jats_backend.py — FileTooLong — 1066 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 566 over it, 2.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: pipeline/standard_pdf_pipeline.py docling/pipeline/standard_pdf_pipeline.py — FileTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 465 over it, 1.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: reading_order/readingorder_model.py docling/models/stages/reading_order/readingorder_model.py — FileTooLong — 956 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 456 over it, 1.91× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: service_client/_async_client.py docling/service_client/_async_client.py — FileTooLong — 910 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 410 over it, 1.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: datamodel/document.py docling/datamodel/document.py — FileTooLong — 877 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 377 over it, 1.75× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: service/options.py docling/datamodel/service/options.py — FileTooLong — 872 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 372 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/md_backend.py docling/backend/md_backend.py — FileTooLong — 871 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 371 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: scripts/ai_pr_triage.py .github/scripts/ai_pr_triage.py — FileTooLong — 848 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 348 over it, 1.70× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: handlers/macros.py docling/backend/latex/handlers/macros.py — FileTooLong — 791 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 291 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/iwork_backend.py docling/backend/iwork_backend.py — FileTooLong — 763 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 263 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: pipeline/asr_transcriber.py docling/pipeline/asr_transcriber.py — FileTooLong — 763 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 263 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/asciidoc_backend.py docling/backend/asciidoc_backend.py — FileTooLong — 757 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 257 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: perfs/iterate_pdf_pages.py perfs/iterate_pdf_pages.py — FileTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 227 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: utils/chandra_utils.py docling/utils/chandra_utils.py — FileTooLong — 722 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 222 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: pipeline/vlm_pipeline.py docling/pipeline/vlm_pipeline.py — FileTooLong — 678 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 178 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: iwork/archives.py docling/backend/iwork/archives.py — FileTooLong — 660 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 160 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: datamodel/backend_options.py docling/datamodel/backend_options.py — FileTooLong — 656 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 156 over it, 1.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 7 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×29
  • TodoComment docling/document_converter.py:634 — # TODO review naming — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/document_converter.py:707 — # TODO review naming — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/mets_gbs_backend.py:534 — # TODO: is this thread-safe? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/epub_backend.py:433 — # TODO: leverage `self.metadata` once DoclingDocument supports file metadata — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/xbrl_backend.py:174 — # TODO: parametrize the timeout? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/xbrl_backend.py:176 — # TODO: custom set cntlr.webCache.cacheDir? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:1173 — # TODO: parse tables — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:329 — # TODO: apply styling according to child.tag when supported by docling-core — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:485 — # TODO: once superscript is supported, add label with formatting — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:588 — # TODO: once docling supports text formatting, add affiliation reference to — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:947 — # TODO: format label vs caption once styling is supported — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:1165 — # TODO: format label vs caption once styling is supported — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:1049 — # TODO, see how to implement proper support for rich tables from HTML backend — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:1122 — # TODO: extract content correctly from table-cells with lists — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/backend/xml/jats_backend.py:1354 — # TODO: address non-paragraph, non-list content inside list-item — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/datamodel/pipeline_options.py:823 — # TODO: default should become False in a future release, and this field — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/datamodel/picture_classification_options.py:31 — # TODO: default should become False in a future release, and this field — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/models/extraction/nuextract_transformers_model.py:299 — # Todo: confirm num tokens is actually from first item, code was already like this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/models/stages/picture_description/picture_description_vlm_engine_model.py:172 — # TODO: Consider using chunking here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/models/stages/reading_order/readingorder_model.py:130 — # TODO: Infer if this is a numbered or a bullet list item — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/models/stages/reading_order/readingorder_model.py:1007 — # TODO: Infer if this is a numbered or a bullet list item — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/models/stages/reading_order/readingorder_model.py:1078 — # TODO: This is incomplete, we don't have the `orig` field of the merged element. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/models/stages/reading_order/readingorder_model.py:1081 — # TODO: This is incomplete, we don't have the `orig` field of the merged element. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment docling/pipeline/base_pipeline.py:327 — # TODO this is a bad name. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment tests/verify_utils.py:417 — # TODO: check picture annotations — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 4 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×16
  • Repeated repair: docling/backend/csv_backend.py docling/backend/csv_backend.py:160 — docling/backend/csv_backend.py changed 11 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is CsvDocumentBackend.convert at line 160), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(csv): use following rows when the header holds two delimiters (#4896)”; “fix(csv): rewind content before repeated dialect detection (#4754)”; “fix(csv): sniff dialect after leading empty lines (#4467)”; “fix(csv): validate first-line dialect before accepting a sniff (#4453)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/csv_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/image_backend.py docling/backend/image_backend.py:36 — docling/backend/image_backend.py changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is image_backend._validate_dpi at line 36), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: decode image pages on demand and limit decoded image pixels (#4976)”; “fix: flatten transparent pictures onto white before enrichment models (#4776)”; “fix(image): flatten transparent images onto white instead of black (#4511)”; “fix(image): apply the EXIF orientation when loading image frames (#4247)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/image_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/utils/vlm_utils.py docling/utils/vlm_utils.py:23 — docling/utils/vlm_utils.py changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is vlm_utils.link_adjacent_captions at line 23), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(vlm): keep every markup heading depth distinct across VLM mappers”; “fix(vlm): share the Nemotron 3.5 formula delimiter normalizer”; “fix: normalize Nemotron formula delimiters before export”; “fix: preserve fidelity when mapping external VLM output (Chandra, dots, MinerU) (#4470)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/utils/vlm_utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/pypdfium2_backend.py docling/backend/pypdfium2_backend.py:317 — docling/backend/pypdfium2_backend.py changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is _PageChars.text_in_rect at line 317), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(pypdfium2): keep letters of adjacent lines out of text cells (#4802)”; “fix(pypdfium2): place cells relative to the visible page box (#4538)”; “fix(pypdfium2): build the page object index once to avoid quadratic scans (#4226)”; “fix(pypdfium2): apply page rotation to text-cell coordinates (#4008)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/pypdfium2_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/latex/backend.py docling/backend/latex/backend.py:274 — docling/backend/latex/backend.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is LatexDocumentBackend._process_nodes at line 274), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(latex): require trusted input for Tectonic TikZ rendering (#4970)”; “fix(latex): backend updates for better parsing of arxiv papers (#4817)”; “fix(latex): resolve \input and \includegraphics for str sources (#4697)”; “fix(latex): parse tabular*, tabularx and longtable as tables (#4325)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/latex/backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/json/docling_json_backend.py docling/backend/json/docling_json_backend.py:28 — docling/backend/json/docling_json_backend.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is docling_json_backend._clear_local_image_refs at line 28), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: adapt to docling-core 2.103.1 image and HTML changes”; “fix(json): don't load local image files referenced by Docling JSON input (#4417)”; “fix: drop the UTF-8 BOM when decoding webvtt, markdown and asciidoc (#4109)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/json/docling_json_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/models/inference_engines/vlm/api_openai_compatible_engine.py docling/models/inference_engines/vlm/api_openai_compatible_engine.py:47 — docling/models/inference_engines/vlm/api_openai_compatible_engine.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ApiVlmEngine.__init__ at line 47), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(vlm): report the stop reason of streaming requests (#4778)”; “fix(vlm): report streaming request failures as per-page inference errors (#4561)”; “fix(vlm): report failed remote API calls as INFERENCE_ERROR instead of empty success (#4332)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/models/inference_engines/vlm/api_openai_compatible_engine.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/models/stages/ocr/tesseract_ocr_cli_model.py docling/models/stages/ocr/tesseract_ocr_cli_model.py:322 — docling/models/stages/ocr/tesseract_ocr_cli_model.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is TesseractOcrCliModel.__call__ at line 322), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ocr): keep tesseract CLI words like "N/A" and numbers verbatim (#4536)”; “fix(tesseract): normalize the script pack separator from --list-langs (#4022) (#4033)”; “fix(ocr): make the OCR render scale configurable instead of hardcoded (#3877)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/models/stages/ocr/tesseract_ocr_cli_model.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:156 — REDACTED changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is image_resource_loader._open_direct at line 156), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: decode image pages on demand and limit decoded image pixels (#4976)”; “fix(html): validate every resolved address and scope fetch headers to the source origin (#4420)”; “fix(odf): resolve 'draw:image' 'xlink:href' through ImageResourceLoader (#4015)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/latex/engines/tectonic.py docling/backend/latex/engines/tectonic.py:206 — docling/backend/latex/engines/tectonic.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is TectonicEngine._collect_local_dependencies at line 206), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(latex): require trusted input for Tectonic TikZ rendering (#4970)”; “fix(latex): decode Windows-1252 sources and 8-bit TikZ dependencies (#4475)”; “fix(latex): run Tectonic without shell escape and skip TikZ that references outside files (#4419)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/latex/engines/tectonic.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/ebcdic_backend.py docling/backend/ebcdic_backend.py:287 — docling/backend/ebcdic_backend.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is EbcdicDocumentBackend.convert at line 287), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ebcdic): report a record length shorter than its layout (#4961)”; “fix(ebcdic): preserve scaled numbers without context rounding (#4759)”; “fix(ebcdic): keep fixed-point notation for scaled numbers (#4296)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/ebcdic_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/models/extraction/transformers_extraction_model.py docling/models/extraction/transformers_extraction_model.py:41 — docling/models/extraction/transformers_extraction_model.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is TransformersExtractionModel.__init__ at line 41), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(models): warn on unpinned revisions for trust_remote_code model specs (#4227)”; “fix: load granite-vision-4.1-4b natively on transformers>=5.8 (#4208)”; “fix: silence transformers generation-config deprecation warning and add max_new_tokens CLI overrides (#4115)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/models/extraction/transformers_extraction_model.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/models/vlm_pipeline_models/api_vlm_model.py docling/models/vlm_pipeline_models/api_vlm_model.py:51 — docling/models/vlm_pipeline_models/api_vlm_model.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ApiVlmModel.__call__ at line 51), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(vlm): report the stop reason of streaming requests (#4778)”; “fix(vlm): report streaming request failures as per-page inference errors (#4561)”; “fix(vlm): report failed remote API calls as INFERENCE_ERROR instead of empty success (#4332)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/models/vlm_pipeline_models/api_vlm_model.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/boxnote_backend.py docling/backend/boxnote_backend.py:419 — docling/backend/boxnote_backend.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is BoxNoteDocumentBackend._marks at line 419), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(html,jats,boxnote): count the columns a rowspan shifts cells into (#4527)”; “fix: clamp oversized table rowspan/colspan to the table size (#4414)”; “fix: drop the UTF-8 BOM when decoding webvtt, markdown and asciidoc (#4109)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/boxnote_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/docx/drawingml/utils.py docling/backend/docx/drawingml/utils.py:145 — docling/backend/docx/drawingml/utils.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is utils._kill_soffice_process_group at line 145), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(office): harden the LibreOffice profile, flags, and timeout kill (#4228)”; “fix(backend): defer pypdfium2 import in office and LaTeX backends (#4285)”; “fix(docx): add timeout and isolated profile to LibreOffice conversions (#3820)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/docx/drawingml/utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: docling/backend/webvtt_backend.py docling/backend/webvtt_backend.py:109 — docling/backend/webvtt_backend.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is WebVTTDocumentBackend.convert at line 109), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webvtt): accept CRLF and CR line terminators from a stream (#4157)”; “fix(webvtt): keep cue text in order after a multi-line span (#4105)”; “fix: drop the UTF-8 BOM when decoding webvtt, markdown and asciidoc (#4109)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 17:00:16 +02:00' --until='2026-10-23 17:00:16 +02:00' --full-history --no-merges -- docling/backend/webvtt_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×10
  • Swallowed exception (caught, then discarded) docling/backend/opendocument_backend.py:1043 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/backend/msword_backend.py:569 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/backend/mspowerpoint_backend.py:834 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/backend/mets_gbs_backend.py:224 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/backend/mets_gbs_backend.py:236 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/backend/email_backend.py:134 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/datamodel/document.py:549 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/models/vlm_pipeline_models/vllm_model.py:336 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/service_client/client.py:831 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) docling/utils/pipeline_cache.py:25 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D3 · God Classes · TooManyMethods · ×9
  • TooManyMethods: HTMLDocumentBackend docling/backend/html_backend.py:514 — TooManyMethods — 145 methods. The bar is 30 methods; this is 115 over it, 4.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MsWordDocumentBackend docling/backend/msword_backend.py:674 — TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DoclingServiceClient docling/service_client/client.py:891 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MsPowerpointDocumentBackend docling/backend/mspowerpoint_backend.py:301 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: JatsDocumentBackend docling/backend/xml/jats_backend.py:176 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AsciiDocBackend docling/backend/asciidoc_backend.py:93 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MsExcelDocumentBackend docling/backend/msexcel_backend.py:551 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _BaseDoclingServiceClient docling/service_client/client.py:312 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AsyncDoclingServiceClient docling/service_client/_async_client.py:109 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×9
  • Duplicated block (10 lines × 2) docling/backend/html_backend.py:1944 — docling/backend/html_backend.py:1944-1953 | docling/backend/msword_backend.py:3876-3885 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/backend/html_backend.py:1944` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) docling/backend/html_backend.py:2266 — docling/backend/html_backend.py:2266-2275 | docling/backend/html_backend.py:3443-3452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/backend/html_backend.py:2266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) docling/backend/html_backend.py:3357 — docling/backend/html_backend.py:3357-3366 | docling/backend/xml/jats_backend.py:1064-1073 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) docling/backend/iwork/archives.py:578 — docling/backend/iwork/archives.py:578-587 | docling/backend/iwork/archives.py:1261-1270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) docling/backend/latex/handlers/macros.py:832 — docling/backend/latex/handlers/macros.py:832-841 | docling/backend/latex/utils/text.py:350-359 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) docling/backend/msword_backend.py:1005 — docling/backend/msword_backend.py:1005-1014 | docling/backend/msword_backend.py:1017-1026 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) docling/models/inference_engines/vlm/transformers_engine.py:555 — docling/models/inference_engines/vlm/transformers_engine.py:555-564 | docling/models/vlm_pipeline_models/hf_transformers_model.py:397-406 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) docling/models/inference_engines/image_classification/base.py:100 — docling/models/inference_engines/image_classification/base.py:100-109 | docling/models/inference_engines/object_detection/base.py:115-125 — `docling/models/inference_engines/image_classification/base.py` and `docling/models/inference_engines/object_detection/base.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) docling/models/inference_engines/image_classification/transformers_engine.py:50 — docling/models/inference_engines/image_classification/transformers_engine.py:50-59 | docling/models/inference_engines/object_detection/transformers_engine.py:54-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
X3 · Exception handling · Swallowed exception (empty catch) · ×9
  • Swallowed exception (empty catch) docling/backend/msword_backend.py:1488 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) docling/backend/msword_backend.py:2310 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) docling/backend/docx/drawingml/utils.py:163 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) docling/datamodel/document.py:463 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) docling/models/inference_engines/common/kserve_v2_grpc.py:234 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) docling/models/inference_engines/image_classification/api_kserve_v2_engine.py:198 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) docling/models/inference_engines/object_detection/api_kserve_v2_engine.py:259 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) docling/models/stages/ocr/kserve_v2_ocr_model.py:328 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) docling/pipeline/video_pipeline.py:356 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×7
  • Duplicated block (14 lines × 2) docling/backend/mets_gbs_backend.py:485 — docling/backend/mets_gbs_backend.py:485-498 | docling/backend/mets_gbs_backend.py:504-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) docling/document_converter.py:768 — docling/document_converter.py:768-785 | docling/document_extractor.py:173-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/document_converter.py:768` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:336 — docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:336-349 | docling/pipeline/standard_pdf_pipeline.py:973-986 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) docling/models/postprocessing/reading_order_rb.py:542 — docling/models/postprocessing/reading_order_rb.py:542-555 | docling/models/postprocessing/reading_order_rb.py:568-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) docling/pipeline/asr_transcriber.py:349 — docling/pipeline/asr_transcriber.py:349-362 | docling/pipeline/asr_transcriber.py:488-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) docling/pipeline/asr_transcriber.py:500 — docling/pipeline/asr_transcriber.py:500-513 | docling/pipeline/asr_transcriber.py:762-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) docling/service_client/watchers.py:206 — docling/service_client/watchers.py:206-219 | docling/service_client/watchers.py:397-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×6
  • Duplicated block (16 lines × 2) docling/backend/latex/utils/table.py:77 — docling/backend/latex/utils/table.py:77-92 | docling/backend/latex/utils/table.py:106-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) docling/backend/msexcel_backend.py:1526 — docling/backend/msexcel_backend.py:1526-1541 | docling/backend/mspowerpoint_backend.py:1148-1163 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) REDACTED:349 — REDACTED:349-364 | REDACTED:1274-1289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) REDACTED:499 — REDACTED:499-514 | REDACTED:1420-1435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) docling/models/vlm_pipeline_models/hf_transformers_model.py:198 — docling/models/vlm_pipeline_models/hf_transformers_model.py:198-213 | docling/models/vlm_pipeline_models/mlx_model.py:121-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) docling/service_client/_async_client.py:689 — docling/service_client/_async_client.py:689-704 | docling/service_client/client.py:2412-2427 — before extracting anything, compare `docling/service_client/_async_client.py` and `docling/service_client/client.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/service_client/_async_client.py:689` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×6
  • Duplicated block (13 lines × 2) docling/backend/msword_backend.py:2945 — docling/backend/msword_backend.py:2945-2957 | docling/backend/msword_backend.py:2958-2970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/backend/msword_backend.py:2945` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) docling/backend/msword_backend.py:3662 — docling/backend/msword_backend.py:3662-3674 | docling/backend/msword_backend.py:3728-3741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/backend/msword_backend.py:3662` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:451 — docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:451-463 | docling/pipeline/vlm_pipeline.py:867-879 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) docling/models/inference_engines/object_detection/api_kserve_v2_engine.py:237 — docling/models/inference_engines/object_detection/api_kserve_v2_engine.py:237-249 | docling/models/inference_engines/object_detection/onnxruntime_engine.py:202-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) docling/service_client/client.py:1764 — docling/service_client/client.py:1764-1776 | docling/service_client/client.py:1796-1808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `docling/service_client/client.py:1760` calls `convert_all` and `docling/service_client/client.py:1795` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:260 — docling/models/stages/ocr/_nemotron_ocr_model.py:260-272 | docling/models/stages/ocr/nemotron_ocr_model.py:291-303 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×6
  • Duplicated block (12 lines × 2) docling/backend/html_backend.py:2145 — docling/backend/html_backend.py:2145-2156 | docling/backend/html_backend.py:2162-2173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) docling/backend/html_backend.py:2679 — docling/backend/html_backend.py:2679-2690 | docling/backend/html_backend.py:2716-2727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) docling/backend/msexcel_backend.py:246 — docling/backend/msexcel_backend.py:246-257 | docling/backend/msexcel_backend.py:1205-1216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) docling/models/inference_engines/image_classification/onnxruntime_engine.py:113 — docling/models/inference_engines/image_classification/onnxruntime_engine.py:113-124 | docling/models/inference_engines/object_detection/onnxruntime_engine.py:121-132 — `docling/models/inference_engines/image_classification/onnxruntime_engine.py` and `docling/models/inference_engines/object_detection/onnxruntime_engine.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 58 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) docling/pipeline/vlm_pipeline.py:581 — docling/pipeline/vlm_pipeline.py:581-592 | docling/pipeline/vlm_pipeline.py:624-635 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/pipeline/vlm_pipeline.py:581` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) docling/pipeline/vlm_pipeline.py:704 — docling/pipeline/vlm_pipeline.py:704-715 | docling/pipeline/vlm_pipeline.py:745-756 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D17 · Explicit Debt · FixmeComment · ×5
  • FixmeComment docling/cli/main.py:1826 — # FIXME: to be deprecated in version 3 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment docling/models/picture_description_base_model.py:115 — # FIXME: annotations is deprecated, remove once all consumers use meta.classification — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment docling/models/stages/picture_classifier/document_picture_classifier.py:193 — # FIXME: annotations is deprecated, remove once all consumers use meta.classification — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment docling/models/stages/table_structure/table_structure_model_v2.py:117 — # FIXME: this method is here to test the quality and performance of the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment docling/models/stages/table_structure/table_structure_model.py:318 — # FIXME: this method is here to test the quality and performance of the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D31 · IaC & Container Security · Medium IaC · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×4
  • Duplicated block (19 lines × 2) docling/backend/mets_gbs_backend.py:419 — docling/backend/mets_gbs_backend.py:419-437 | docling/backend/mets_gbs_backend.py:442-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) REDACTED:523 — REDACTED:523-541 | REDACTED:871-889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) REDACTED:741 — REDACTED:741-759 | REDACTED:1315-1333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) docling/models/inference_engines/image_classification/onnxruntime_engine.py:137 — docling/models/inference_engines/image_classification/onnxruntime_engine.py:137-155 | docling/models/inference_engines/object_detection/onnxruntime_engine.py:140-158 — `docling/models/inference_engines/image_classification/onnxruntime_engine.py` and `docling/models/inference_engines/object_detection/onnxruntime_engine.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 58 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:422 — docling/models/stages/ocr/_nemotron_ocr_model.py:422-436 | docling/models/stages/ocr/nemotron_ocr_model.py:453-467 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/ocr/_nemotron_ocr_model.py:422` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) docling/models/stages/ocr/tesseract_ocr_cli_model.py:401 — docling/models/stages/ocr/tesseract_ocr_cli_model.py:401-415 | docling/models/stages/ocr/tesseract_ocr_model.py:264-278 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) docling/service_client/_async_client.py:828 — docling/service_client/_async_client.py:828-842 | docling/service_client/client.py:1397-1411 — before extracting anything, compare `docling/service_client/_async_client.py` and `docling/service_client/client.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) docling/utils/layout_postprocessor.py:344 — docling/utils/layout_postprocessor.py:344-358 | docling/utils/layout_postprocessor.py:367-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×4
  • Duplicated block (11 lines × 2) docling/backend/msword_backend.py:2808 — docling/backend/msword_backend.py:2808-2818 | docling/backend/msword_backend.py:2821-2831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) docling/pipeline/base_extraction_pipeline.py:27 — docling/pipeline/base_extraction_pipeline.py:27-37 | docling/pipeline/base_pipeline.py:69-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) docling/pipeline/standard_pdf_pipeline.py:502 — docling/pipeline/standard_pdf_pipeline.py:502-512 | docling/pipeline/standard_pdf_pipeline.py:514-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) docling/service_client/watchers.py:112 — docling/service_client/watchers.py:112-122 | docling/service_client/watchers.py:296-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `timeout` to `float | None = None` in one and `float` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D2 · Cognitive Complexity · PatentHandler.skippedEntity (cognitive 18) · ×3
  • PatentHandler.skippedEntity (cognitive 18) REDACTED:383 — PatentHandler.skippedEntity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (18 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (PatentHandler.skippedEntity, PatentHandler.skippedEntity) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • PatentHandler.skippedEntity (cognitive 18) REDACTED:731 — PatentHandler.skippedEntity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (18 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (PatentHandler.skippedEntity, PatentHandler.skippedEntity) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • PatentHandler.skippedEntity (cognitive 18) REDACTED:1305 — PatentHandler.skippedEntity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (18 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (PatentHandler.skippedEntity, PatentHandler.skippedEntity) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) docling/backend/msexcel_backend.py:1507 — docling/backend/msexcel_backend.py:1507-1545 | docling/backend/msexcel_backend.py:2013-2056 | docling/backend/mspowerpoint_backend.py:1126-1167 | docling/backend/mspowerpoint_backend.py:1782-1824 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) docling/models/base_ocr_model.py:741 — docling/models/base_ocr_model.py:741-788 | docling/models/stages/page_preprocessing/page_preprocessing_model.py:102-177 | docling/models/stages/table_structure/table_structure_model.py:121-179 | docling/models/stages/table_structure/table_structure_model_v2.py:357-398 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) docling/models/vlm_pipeline_models/api_vlm_model.py:54 — docling/models/vlm_pipeline_models/api_vlm_model.py:54-98 | docling/models/vlm_pipeline_models/hf_transformers_model.py:198-249 | docling/models/vlm_pipeline_models/mlx_model.py:121-172 | docling/models/vlm_pipeline_models/vllm_model.py:219-272 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) docling/backend/html_backend.py:2069 — docling/backend/html_backend.py:2069-2089 | docling/backend/xml/jats_backend.py:1093-1113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:286 — docling/models/stages/ocr/_nemotron_ocr_model.py:286-306 | docling/models/stages/ocr/nemotron_ocr_model.py:317-337 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) docling/models/stages/code_formula/code_formula_model.py:168 — docling/models/stages/code_formula/code_formula_model.py:168-195 | docling/models/stages/code_formula/code_formula_vlm_model.py:167-187 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) docling/models/inference_engines/vlm/transformers_engine.py:170 — docling/models/inference_engines/vlm/transformers_engine.py:170-187 | docling/models/inference_engines/vlm/vllm_engine.py:148-165 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/inference_engines/vlm/transformers_engine.py:170` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) docling/models/postprocessing/reading_order_rb.py:978 — docling/models/postprocessing/reading_order_rb.py:978-995 | docling/models/postprocessing/reading_order_rb.py:999-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) docling/service_client/_async_client.py:749 — docling/service_client/_async_client.py:749-766 | docling/service_client/client.py:1347-1364 — before extracting anything, compare `docling/service_client/_async_client.py` and `docling/service_client/client.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/service_client/_async_client.py:749` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×3
  • Duplicated block (8 lines × 2) docling/backend/msword_backend.py:2938 — docling/backend/msword_backend.py:2938-2945 | docling/backend/msword_backend.py:2972-2979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) docling/service_client/client.py:2066 — docling/service_client/client.py:2066-2073 | docling/service_client/client.py:2091-2098 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) docling/models/inference_engines/image_classification/hf_base.py:39 — docling/models/inference_engines/image_classification/hf_base.py:39-46 | docling/models/inference_engines/object_detection/hf_base.py:35-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×3
  • Duplicated block (7 lines × 2) docling/backend/html_backend.py:5136 — docling/backend/html_backend.py:5136-5142 | docling/backend/html_backend.py:5154-5161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) docling/models/inference_engines/image_classification/base.py:180 — docling/models/inference_engines/image_classification/base.py:180-186 | docling/models/inference_engines/object_detection/base.py:200-206 — `docling/models/inference_engines/image_classification/base.py` and `docling/models/inference_engines/object_detection/base.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `input_data` to `ImageClassificationEngineInput` in one and `ObjectDetectionEngineInput` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) docling/models/inference_engines/image_classification/base.py:193 — docling/models/inference_engines/image_classification/base.py:193-199 | docling/models/inference_engines/object_detection/base.py:212-218 — `docling/models/inference_engines/image_classification/base.py` and `docling/models/inference_engines/object_detection/base.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `input_data` to `ImageClassificationEngineInput | List[ImageClassificationEngineInput]` in one and `ObjectDetectionEngineInput | List[ObjectDetectionEngineInput]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×3
  • Duplicated block (6 lines × 2) docling/backend/docx/drawingml/utils.py:403 — docling/backend/docx/drawingml/utils.py:403-408 | docling/backend/latex/engines/tectonic.py:37-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) docling/models/inference_engines/image_classification/onnxruntime_engine.py:80 — docling/models/inference_engines/image_classification/onnxruntime_engine.py:80-85 | docling/models/inference_engines/object_detection/onnxruntime_engine.py:94-99 — `docling/models/inference_engines/image_classification/onnxruntime_engine.py` and `docling/models/inference_engines/object_detection/onnxruntime_engine.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 58 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) docling/models/base_layout_model.py:61 — docling/models/base_layout_model.py:61-66 | docling/models/base_layout_postprocessing_model.py:37-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D1 · Cyclomatic Complexity · PatentHandler._add_property (cyclomatic 23) · ×2
  • PatentHandler._add_property (cyclomatic 23) REDACTED:484 — PatentHandler._add_property has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PatentHandler._add_property (cyclomatic 23) REDACTED:1403 — PatentHandler._add_property has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · HackComment · ×2
  • HackComment docling/backend/html_backend.py:5225 — # check if the figure has a link - this is HACK: — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment docling/models/stages/ocr/tesseract_ocr_cli_model.py:185 — # HACK: Windows versions of Tesseract output the version to stdout, Linux versions — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: api_vlm_model.py ↔ mlx_model.py docling/models/vlm_pipeline_models/api_vlm_model.py:1 — `docling/models/vlm_pipeline_models/api_vlm_model.py` and `docling/models/vlm_pipeline_models/mlx_model.py` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4852d8b4` feat(experimental): Layout + VLM model with layout prompt (#2244) (at that commit the files were still `docling/models/api_vlm_model.py` and `docling/models/vlm_models_inline/mlx_model.py`); `6a04e273` feat(vlm): track generated tokens and stop reasons for VLM models (#2… (at that commit the files were still `docling/models/api_vlm_model.py` and `docling/models/vlm_models_inline/mlx_model.py`); `b6c892b5` feat(vlm): add num_tokens as attribtue for VlmPrediction (#2489) (at that commit the files were still `docling/models/api_vlm_model.py` and `docling/models/vlm_models_inline/mlx_model.py`) — run `git show` on any of them.
  • Change coupling: layout_model.py ↔ standard_pdf_pipeline.py docling/models/stages/layout/layout_model.py:1 — `docling/models/stages/layout/layout_model.py` and `docling/pipeline/standard_pdf_pipeline.py` change together 50% of the time (10 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `ad97e528` feat: Factory and plugin-capability for Layout and Table models (#2637) (at that commit the file was still `docling/models/layout_model.py`); `268d027c` feat: Use threading in the standard pipeline and move old behavior to… (at that commit the file was still `docling/models/layout_model.py`); `2b8616d6` feat: Layout model specification and multiple choices (#1910) (at that commit the file was still `docling/models/layout_model.py`) — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×2
  • Duplicated block (37 lines × 2) docling/backend/msword_backend.py:4642 — docling/backend/msword_backend.py:4642-4678 | docling/backend/utils/charts.py:108-144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (37 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:118 — docling/models/stages/ocr/_nemotron_ocr_model.py:118-154 | docling/models/stages/ocr/nemotron_ocr_model.py:137-173 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (29–33 lines × 2) · ×2
  • Duplicated block (29–33 lines × 2) docling/models/extraction/nuextract_transformers_model.py:282 — docling/models/extraction/nuextract_transformers_model.py:282-314 | docling/models/extraction/transformers_extraction_model.py:208-236 — before extracting anything, compare `docling/models/extraction/nuextract_transformers_model.py` and `docling/models/extraction/transformers_extraction_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (29–33 lines × 2) REDACTED:217 — REDACTED:217-249 | REDACTED:327-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) docling/pipeline/asr_transcriber.py:363 — docling/pipeline/asr_transcriber.py:363-378 | docling/pipeline/asr_transcriber.py:765-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15–16 lines × 2) docling/utils/mineru_utils.py:355 — docling/utils/mineru_utils.py:355-370 | docling/utils/nemotron_parse_utils.py:271-285 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/utils/mineru_utils.py:355` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) docling/service_client/client.py:515 — docling/service_client/client.py:515-527 | docling/service_client/client.py:1967-1980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/service_client/client.py:1967` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–14 lines × 2) docling/service_client/client.py:1306 — docling/service_client/client.py:1306-1318 | docling/service_client/client.py:1579-1592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/service_client/client.py:1306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×2
  • Duplicated block (12–13 lines × 3) REDACTED:499 — REDACTED:499-511 | REDACTED:893-904 | REDACTED:1420-1432 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 3) docling/utils/mineru_utils.py:357 — docling/utils/mineru_utils.py:357-368 | docling/utils/nemotron_parse_utils.py:272-283 | docling/utils/nemotron_parse_v3_5_utils.py:496-508 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/utils/nemotron_parse_v3_5_utils.py:496` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) docling/models/stages/table_structure/table_structure_model.py:166 — docling/models/stages/table_structure/table_structure_model.py:166-176 | docling/models/stages/table_structure/table_structure_model_v2.py:385-396 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/table_structure/table_structure_model.py:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) docling/utils/deepseekocr_utils.py:301 — docling/utils/deepseekocr_utils.py:301-312 | docling/utils/dots_utils.py:261-271 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×2
  • Duplicated block (9 lines × 2) REDACTED:458 — REDACTED:458-466 | REDACTED:1377-1385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) docling/backend/docling_parse_v2_backend.py:23 — docling/backend/docling_parse_v2_backend.py:23-31 | docling/backend/docling_parse_v4_backend.py:23-31 — before extracting anything, compare `docling/backend/docling_parse_v2_backend.py` and `docling/backend/docling_parse_v4_backend.py` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) docling/models/stages/ocr/easyocr_model.py:351 — docling/models/stages/ocr/easyocr_model.py:351-355 | docling/models/stages/ocr/rapid_ocr_model.py:797-803 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/ocr/easyocr_model.py:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) docling/models/stages/ocr/tesseract_ocr_cli_model.py:229 — docling/models/stages/ocr/tesseract_ocr_cli_model.py:229-244 | docling/models/stages/ocr/tesseract_ocr_cli_model.py:314-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/ocr/tesseract_ocr_cli_model.py:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._extract_form_region (cyclomatic 97) · ×1
  • HTMLDocumentBackend._extract_form_region (cyclomatic 97) docling/backend/html_backend.py:4609 — HTMLDocumentBackend._extract_form_region has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.convert (cyclomatic 82) · ×1
  • main.convert (cyclomatic 82) docling/cli/main.py:912 — main.convert has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MacroHandlerMixin._process_macro (cyclomatic 72) · ×1
  • MacroHandlerMixin._process_macro (cyclomatic 72) docling/backend/latex/handlers/macros.py:520 — MacroHandlerMixin._process_macro has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownDocumentBackend._iterate_elements (cyclomatic 64) · ×1
  • MarkdownDocumentBackend._iterate_elements (cyclomatic 64) docling/backend/md_backend.py:701 — MarkdownDocumentBackend._iterate_elements has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._handle_list (cyclomatic 56) · ×1
  • HTMLDocumentBackend._handle_list (cyclomatic 56) docling/backend/html_backend.py:3067 — HTMLDocumentBackend._handle_list has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · candidates.candidates_for (cyclomatic 50) · ×1
  • candidates.candidates_for (cyclomatic 50) docling/models/stages/form_field/keying/candidates.py:170 — candidates.candidates_for has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XBRLDocumentBackend.convert (cyclomatic 48) · ×1
  • XBRLDocumentBackend.convert (cyclomatic 48) docling/backend/xml/xbrl_backend.py:266 — XBRLDocumentBackend.convert has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.export_documents (cyclomatic 43) · ×1
  • main.export_documents (cyclomatic 43) docling/cli/main.py:587 — main.export_documents has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._walk_linear (cyclomatic 41) · ×1
  • MsWordDocumentBackend._walk_linear (cyclomatic 41) docling/backend/msword_backend.py:1224 — MsWordDocumentBackend._walk_linear has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._handle_text_elements (cyclomatic 41) · ×1
  • MsWordDocumentBackend._handle_text_elements (cyclomatic 41) docling/backend/msword_backend.py:3028 — MsWordDocumentBackend._handle_text_elements has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AsciiDocBackend._parse (cyclomatic 40) · ×1
  • AsciiDocBackend._parse (cyclomatic 40) docling/backend/asciidoc_backend.py:195 — AsciiDocBackend._parse has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChandraDocumentBuilder._emit_runs (cyclomatic 38) · ×1
  • _ChandraDocumentBuilder._emit_runs (cyclomatic 38) docling/utils/chandra_utils.py:387 — _ChandraDocumentBuilder._emit_runs has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JatsDocumentBackend._walk_linear (cyclomatic 37) · ×1
  • JatsDocumentBackend._walk_linear (cyclomatic 37) docling/backend/xml/jats_backend.py:1305 — JatsDocumentBackend._walk_linear has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DocumentConversionInput._guess_format (cyclomatic 37) · ×1
  • _DocumentConversionInput._guess_format (cyclomatic 37) docling/datamodel/document.py:815 — _DocumentConversionInput._guess_format has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tables.table_fields (cyclomatic 37) · ×1
  • tables.table_fields (cyclomatic 37) docling/models/stages/form_field/keying/tables.py:31 — tables.table_fields has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._handle_block (cyclomatic 36) · ×1
  • HTMLDocumentBackend._handle_block (cyclomatic 36) docling/backend/html_backend.py:3369 — HTMLDocumentBackend._handle_block has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MacroHandlerMixin._macro_definition_spans (cyclomatic 36) · ×1
  • MacroHandlerMixin._macro_definition_spans (cyclomatic 36) docling/backend/latex/handlers/macros.py:247 — MacroHandlerMixin._macro_definition_spans has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._walk_nodes (cyclomatic 35) · ×1
  • HTMLDocumentBackend._walk_nodes (cyclomatic 35) docling/backend/html_backend.py:2196 — HTMLDocumentBackend._walk_nodes has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._extract_checkbox_text_and_consumed_label_obj_ids (cyclomatic 34) · ×1
  • HTMLDocumentBackend._extract_checkbox_text_and_consumed_label_obj_ids (cyclomatic 34) docling/backend/html_backend.py:4035 — HTMLDocumentBackend._extract_checkbox_text_and_consumed_label_obj_ids has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MacroHandlerMixin._process_macro_node_inline (cyclomatic 34) · ×1
  • MacroHandlerMixin._process_macro_node_inline (cyclomatic 34) docling/backend/latex/handlers/macros.py:417 — MacroHandlerMixin._process_macro_node_inline has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HuggingFaceTransformersVlmModel.process_images (cyclomatic 34) · ×1
  • HuggingFaceTransformersVlmModel.process_images (cyclomatic 34) docling/models/vlm_pipeline_models/hf_transformers_model.py:251 — HuggingFaceTransformersVlmModel.process_images has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChandraDocumentBuilder._block (cyclomatic 34) · ×1
  • _ChandraDocumentBuilder._block (cyclomatic 34) docling/utils/chandra_utils.py:534 — _ChandraDocumentBuilder._block has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XmlTable._parse_table (cyclomatic 33) · ×1
  • XmlTable._parse_table (cyclomatic 33) REDACTED:1659 — XmlTable._parse_table has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · solver._solve (cyclomatic 33) · ×1
  • solver._solve (cyclomatic 33) docling/models/stages/form_field/keying/solver.py:367 — solver._solve has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mineru_utils.parse_mineru2 (cyclomatic 33) · ×1
  • mineru_utils.parse_mineru2 (cyclomatic 33) docling/utils/mineru_utils.py:330 — mineru_utils.parse_mineru2 has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransformersVlmEngine.predict_batch (cyclomatic 32) · ×1
  • TransformersVlmEngine.predict_batch (cyclomatic 32) docling/models/inference_engines/vlm/transformers_engine.py:382 — TransformersVlmEngine.predict_batch has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · accelerator_utils.decide_device (cyclomatic 32) · ×1
  • accelerator_utils.decide_device (cyclomatic 32) docling/utils/accelerator_utils.py:13 — accelerator_utils.decide_device has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · model_downloader.download_models (cyclomatic 32) · ×1
  • model_downloader.download_models (cyclomatic 32) docling/utils/model_downloader.py:149 — model_downloader.download_models has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HTMLDocumentBackend.parse_table_data (cyclomatic 30) · ×1
  • HTMLDocumentBackend.parse_table_data (cyclomatic 30) docling/backend/html_backend.py:2038 — HTMLDocumentBackend.parse_table_data has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JatsDocumentBackend._parse_element_citation (cyclomatic 30) · ×1
  • JatsDocumentBackend._parse_element_citation (cyclomatic 30) docling/backend/xml/jats_backend.py:621 — JatsDocumentBackend._parse_element_citation has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dots_utils.parse_dots_json (cyclomatic 30) · ×1
  • dots_utils.parse_dots_json (cyclomatic 30) docling/utils/dots_utils.py:216 — dots_utils.parse_dots_json has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EnvironmentHandlerMixin._process_environment (cyclomatic 29) · ×1
  • EnvironmentHandlerMixin._process_environment (cyclomatic 29) docling/backend/latex/handlers/environments.py:85 — EnvironmentHandlerMixin._process_environment has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._manage_list_structure (cyclomatic 29) · ×1
  • MsWordDocumentBackend._manage_list_structure (cyclomatic 29) docling/backend/msword_backend.py:3582 — MsWordDocumentBackend._manage_list_structure has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VideoPipeline._process_video (cyclomatic 29) · ×1
  • VideoPipeline._process_video (cyclomatic 29) docling/pipeline/video_pipeline.py:156 — VideoPipeline._process_video has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JatsDocumentBackend.parse_table_data (cyclomatic 28) · ×1
  • JatsDocumentBackend.parse_table_data (cyclomatic 28) docling/backend/xml/jats_backend.py:1048 — JatsDocumentBackend.parse_table_data has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PatentHandler._add_property (cyclomatic 28) · ×1
  • PatentHandler._add_property (cyclomatic 28) REDACTED:822 — PatentHandler._add_property has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · models.download (cyclomatic 27) · ×1
  • models.download (cyclomatic 27) docling/cli/models.py:127 — models.download has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 (cyclomatic 27) · ×1
  • nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 (cyclomatic 27) docling/utils/nemotron_parse_v3_5_utils.py:479 — nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OdtDocumentBackend._detach_annotations (cyclomatic 26) · ×1
  • OdtDocumentBackend._detach_annotations (cyclomatic 26) docling/backend/opendocument_backend.py:1918 — OdtDocumentBackend._detach_annotations has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opendocument_backend._add_odf_list (cyclomatic 26) · ×1
  • opendocument_backend._add_odf_list (cyclomatic 26) docling/backend/opendocument_backend.py:1385 — opendocument_backend._add_odf_list has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransformersVlmEngine._load_model_for_repo (cyclomatic 26) · ×1
  • TransformersVlmEngine._load_model_for_repo (cyclomatic 26) docling/models/inference_engines/vlm/transformers_engine.py:215 — TransformersVlmEngine._load_model_for_repo has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HuggingFaceMlxModel.process_images (cyclomatic 26) · ×1
  • HuggingFaceMlxModel.process_images (cyclomatic 26) docling/models/vlm_pipeline_models/mlx_model.py:174 — HuggingFaceMlxModel.process_images has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._extract_text_and_hyperlink_recursively (cyclomatic 25) · ×1
  • HTMLDocumentBackend._extract_text_and_hyperlink_recursively (cyclomatic 25) docling/backend/html_backend.py:2444 — HTMLDocumentBackend._extract_text_and_hyperlink_recursively has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TextHelperMixin._macro_node_to_text (cyclomatic 25) · ×1
  • TextHelperMixin._macro_node_to_text (cyclomatic 25) docling/backend/latex/utils/text.py:313 — TextHelperMixin._macro_node_to_text has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._get_label_and_level (cyclomatic 25) · ×1
  • MsWordDocumentBackend._get_label_and_level (cyclomatic 25) docling/backend/msword_backend.py:2132 — MsWordDocumentBackend._get_label_and_level has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._handle_equations_in_text (cyclomatic 25) · ×1
  • MsWordDocumentBackend._handle_equations_in_text (cyclomatic 25) docling/backend/msword_backend.py:2917 — MsWordDocumentBackend._handle_equations_in_text has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RapidOcrModel.__init__ (cyclomatic 25) · ×1
  • RapidOcrModel.__init__ (cyclomatic 25) docling/models/stages/ocr/rapid_ocr_model.py:470 — RapidOcrModel.__init__ has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StandardPdfPipeline._build_document (cyclomatic 25) · ×1
  • StandardPdfPipeline._build_document (cyclomatic 25) docling/pipeline/standard_pdf_pipeline.py:890 — StandardPdfPipeline._build_document has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api_image_request.api_image_request_streaming (cyclomatic 25) · ×1
  • api_image_request.api_image_request_streaming (cyclomatic 25) REDACTED:304 — api_image_request.api_image_request_streaming has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend.convert (cyclomatic 24) · ×1
  • HTMLDocumentBackend.convert (cyclomatic 24) docling/backend/html_backend.py:920 — HTMLDocumentBackend.convert has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · deepseekocr_utils.parse_deepseekocr_markdown (cyclomatic 24) · ×1
  • deepseekocr_utils.parse_deepseekocr_markdown (cyclomatic 24) docling/utils/deepseekocr_utils.py:229 — deepseekocr_utils.parse_deepseekocr_markdown has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsPowerpointDocumentBackend._handle_text_elements (cyclomatic 23) · ×1
  • MsPowerpointDocumentBackend._handle_text_elements (cyclomatic 23) docling/backend/mspowerpoint_backend.py:985 — MsPowerpointDocumentBackend._handle_text_elements has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._get_format_from_run (cyclomatic 23) · ×1
  • MsWordDocumentBackend._get_format_from_run (cyclomatic 23) docling/backend/msword_backend.py:2234 — MsWordDocumentBackend._get_format_from_run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KserveV2GrpcClient.infer (cyclomatic 23) · ×1
  • KserveV2GrpcClient.infer (cyclomatic 23) docling/models/inference_engines/common/kserve_v2_grpc.py:281 — KserveV2GrpcClient.infer has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingOrderPredictor._init_ud_maps (cyclomatic 23) · ×1
  • ReadingOrderPredictor._init_ud_maps (cyclomatic 23) docling/models/postprocessing/reading_order_rb.py:805 — ReadingOrderPredictor._init_ud_maps has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VlmPipeline._finalize_page_document (cyclomatic 23) · ×1
  • VlmPipeline._finalize_page_document (cyclomatic 23) docling/pipeline/vlm_pipeline.py:520 — VlmPipeline._finalize_page_document has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LayoutPostprocessor._process_special_clusters (cyclomatic 23) · ×1
  • LayoutPostprocessor._process_special_clusters (cyclomatic 23) docling/utils/layout_postprocessor.py:278 — LayoutPostprocessor._process_special_clusters has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AsciiDocBackend._iter_blocks (cyclomatic 22) · ×1
  • AsciiDocBackend._iter_blocks (cyclomatic 22) docling/backend/asciidoc_backend.py:499 — AsciiDocBackend._iter_blocks has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MetsGbsDocumentBackend.__init__ (cyclomatic 22) · ×1
  • MetsGbsDocumentBackend.__init__ (cyclomatic 22) docling/backend/mets_gbs_backend.py:242 — MetsGbsDocumentBackend.__init__ has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ThreadedLayoutVlmPipeline._build_document (cyclomatic 22) · ×1
  • ThreadedLayoutVlmPipeline._build_document (cyclomatic 22) docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:278 — ThreadedLayoutVlmPipeline._build_document has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · symmetry.sequences (cyclomatic 22) · ×1
  • symmetry.sequences (cyclomatic 22) docling/models/stages/form_field/keying/symmetry.py:199 — symmetry.sequences has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chandra_utils._table_cells (cyclomatic 22) · ×1
  • chandra_utils._table_cells (cyclomatic 22) docling/utils/chandra_utils.py:194 — chandra_utils._table_cells has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EmailDocumentBackend._msg_to_rfc822_bytes (cyclomatic 21) · ×1
  • EmailDocumentBackend._msg_to_rfc822_bytes (cyclomatic 21) docling/backend/email_backend.py:155 — EmailDocumentBackend._msg_to_rfc822_bytes has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EpubDocumentBackend.convert (cyclomatic 21) · ×1
  • EpubDocumentBackend.convert (cyclomatic 21) docling/backend/epub_backend.py:384 — EpubDocumentBackend.convert has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._handle_form_container (cyclomatic 21) · ×1
  • HTMLDocumentBackend._handle_form_container (cyclomatic 21) docling/backend/html_backend.py:5085 — HTMLDocumentBackend._handle_form_container has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._get_paragraph_position (cyclomatic 21) · ×1
  • MsWordDocumentBackend._get_paragraph_position (cyclomatic 21) docling/backend/msword_backend.py:2644 — MsWordDocumentBackend._get_paragraph_position has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._add_heading (cyclomatic 21) · ×1
  • MsWordDocumentBackend._add_heading (cyclomatic 21) docling/backend/msword_backend.py:3317 — MsWordDocumentBackend._add_heading has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · heading_hierarchy_model._infer_from_bookmarks (cyclomatic 21) · ×1
  • heading_hierarchy_model._infer_from_bookmarks (cyclomatic 21) docling/models/stages/heading_hierarchy/heading_hierarchy_model.py:462 — heading_hierarchy_model._infer_from_bookmarks has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreprocessThreadedStage._process_batch (cyclomatic 21) · ×1
  • PreprocessThreadedStage._process_batch (cyclomatic 21) docling/pipeline/standard_pdf_pipeline.py:464 — PreprocessThreadedStage._process_batch has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ai_pr_triage.render_comment (cyclomatic 20) · ×1
  • ai_pr_triage.render_comment (cyclomatic 20) .github/scripts/ai_pr_triage.py:908 — ai_pr_triage.render_comment has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MacroHandlerMixin._extract_custom_macros (cyclomatic 20) · ×1
  • MacroHandlerMixin._extract_custom_macros (cyclomatic 20) docling/backend/latex/handlers/macros.py:321 — MacroHandlerMixin._extract_custom_macros has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsExcelDocumentBackend._parse_threaded_comments (cyclomatic 20) · ×1
  • MsExcelDocumentBackend._parse_threaded_comments (cyclomatic 20) docling/backend/msexcel_backend.py:670 — MsExcelDocumentBackend._parse_threaded_comments has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._get_level_element (cyclomatic 20) · ×1
  • MsWordDocumentBackend._get_level_element (cyclomatic 20) docling/backend/msword_backend.py:1574 — MsWordDocumentBackend._get_level_element has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._add_comments (cyclomatic 20) · ×1
  • MsWordDocumentBackend._add_comments (cyclomatic 20) docling/backend/msword_backend.py:4918 — MsWordDocumentBackend._add_comments has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OdtDocumentBackend._used_master_pages (cyclomatic 20) · ×1
  • OdtDocumentBackend._used_master_pages (cyclomatic 20) docling/backend/opendocument_backend.py:1793 — OdtDocumentBackend._used_master_pages has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseOcrModel._find_pdf_aware_layout_ocr_rects (cyclomatic 20) · ×1
  • BaseOcrModel._find_pdf_aware_layout_ocr_rects (cyclomatic 20) docling/models/base_ocr_model.py:372 — BaseOcrModel._find_pdf_aware_layout_ocr_rects has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingOrderPredictor._do_horizontal_dilation (cyclomatic 20) · ×1
  • ReadingOrderPredictor._do_horizontal_dilation (cyclomatic 20) docling/models/postprocessing/reading_order_rb.py:952 — ReadingOrderPredictor._do_horizontal_dilation has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rules.printed_cell (cyclomatic 20) · ×1
  • rules.printed_cell (cyclomatic 20) docling/models/stages/form_field/keying/rules.py:64 — rules.printed_cell has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OcrAutoModel.__init__ (cyclomatic 20) · ×1
  • OcrAutoModel.__init__ (cyclomatic 20) docling/models/stages/ocr/auto_ocr_model.py:48 — OcrAutoModel.__init__ has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · otsl.parse_otsl_output (cyclomatic 20) · ×1
  • otsl.parse_otsl_output (cyclomatic 20) docling/utils/otsl.py:24 — otsl.parse_otsl_output has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · iterate_pdf_pages.main (cyclomatic 20) · ×1
  • iterate_pdf_pages.main (cyclomatic 20) perfs/iterate_pdf_pages.py:809 — iterate_pdf_pages.main has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chart_image._plot (cyclomatic 19) · ×1
  • chart_image._plot (cyclomatic 19) REDACTED:237 — chart_image._plot has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TableHelperMixin._process_table_macro_node (cyclomatic 19) · ×1
  • TableHelperMixin._process_table_macro_node (cyclomatic 19) docling/backend/latex/utils/table.py:58 — TableHelperMixin._process_table_macro_node has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownDocumentBackend._iterate_cell_inline (cyclomatic 19) · ×1
  • MarkdownDocumentBackend._iterate_cell_inline (cyclomatic 19) docling/backend/md_backend.py:463 — MarkdownDocumentBackend._iterate_cell_inline has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XBRLDocumentBackend.__init__ (cyclomatic 19) · ×1
  • XBRLDocumentBackend.__init__ (cyclomatic 19) docling/backend/xml/xbrl_backend.py:88 — XBRLDocumentBackend.__init__ has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReadingOrderModel.__call__ (cyclomatic 19) · ×1
  • ReadingOrderModel.__call__ (cyclomatic 19) docling/models/stages/reading_order/readingorder_model.py:1087 — ReadingOrderModel.__call__ has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HuggingFaceTransformersVlmModel.__init__ (cyclomatic 19) · ×1
  • HuggingFaceTransformersVlmModel.__init__ (cyclomatic 19) docling/models/vlm_pipeline_models/hf_transformers_model.py:59 — HuggingFaceTransformersVlmModel.__init__ has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VllmVlmModel.process_images (cyclomatic 19) · ×1
  • VllmVlmModel.process_images (cyclomatic 19) docling/models/vlm_pipeline_models/vllm_model.py:274 — VllmVlmModel.process_images has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ThreadedPipelineStage._process_batch (cyclomatic 19) · ×1
  • ThreadedPipelineStage._process_batch (cyclomatic 19) docling/pipeline/standard_pdf_pipeline.py:333 — ThreadedPipelineStage._process_batch has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chandra_utils._inline_runs (cyclomatic 19) · ×1
  • chandra_utils._inline_runs (cyclomatic 19) docling/utils/chandra_utils.py:303 — chandra_utils._inline_runs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run_pr_fast_checks.main (cyclomatic 18) · ×1
  • run_pr_fast_checks.main (cyclomatic 18) .github/scripts/run_pr_fast_checks.py:325 — run_pr_fast_checks.main has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._should_ignore_table_kv_link (cyclomatic 18) · ×1
  • HTMLDocumentBackend._should_ignore_table_kv_link (cyclomatic 18) docling/backend/html_backend.py:3748 — HTMLDocumentBackend._should_ignore_table_kv_link has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · iwa.decompress_snappy_block (cyclomatic 18) · ×1
  • iwa.decompress_snappy_block (cyclomatic 18) docling/backend/iwork/iwa.py:120 — iwa.decompress_snappy_block has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · macros._strip_latex_comments (cyclomatic 18) · ×1
  • macros._strip_latex_comments (cyclomatic 18) docling/backend/latex/handlers/macros.py:109 — macros._strip_latex_comments has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TableHelperMixin._parse_table (cyclomatic 18) · ×1
  • TableHelperMixin._parse_table (cyclomatic 18) docling/backend/latex/utils/table.py:141 — TableHelperMixin._parse_table has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PatentUsptoGrantAps.store_content (cyclomatic 18) · ×1
  • PatentUsptoGrantAps.store_content (cyclomatic 18) REDACTED:1057 — PatentUsptoGrantAps.store_content has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConversionAssets.load (cyclomatic 18) · ×1
  • ConversionAssets.load (cyclomatic 18) docling/datamodel/document.py:509 — ConversionAssets.load has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: _DocumentConversionInput._mime_from_extension (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · MlxVlmEngine.predict_batch (cyclomatic 18) · ×1
  • MlxVlmEngine.predict_batch (cyclomatic 18) docling/models/inference_engines/vlm/mlx_engine.py:209 — MlxVlmEngine.predict_batch has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChartExtractionVlmEngineModel.__call__ (cyclomatic 18) · ×1
  • ChartExtractionVlmEngineModel.__call__ (cyclomatic 18) docling/models/stages/chart_extraction/granite_vision.py:152 — ChartExtractionVlmEngineModel.__call__ has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · inputs.inputs (cyclomatic 18) · ×1
  • inputs.inputs (cyclomatic 18) docling/models/stages/form_field/keying/inputs.py:98 — inputs.inputs has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · inputs.stacks (cyclomatic 18) · ×1
  • inputs.stacks (cyclomatic 18) docling/models/stages/form_field/keying/inputs.py:258 — inputs.stacks has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VllmVlmModel.__init__ (cyclomatic 18) · ×1
  • VllmVlmModel.__init__ (cyclomatic 18) docling/models/vlm_pipeline_models/vllm_model.py:91 — VllmVlmModel.__init__ has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StandardPdfPipeline._assemble_document (cyclomatic 18) · ×1
  • StandardPdfPipeline._assemble_document (cyclomatic 18) docling/pipeline/standard_pdf_pipeline.py:1149 — StandardPdfPipeline._assemble_document has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VlmPipeline._finalize_page_output (cyclomatic 18) · ×1
  • VlmPipeline._finalize_page_output (cyclomatic 18) docling/pipeline/vlm_pipeline.py:836 — VlmPipeline._finalize_page_output has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ai_pr_review.prepare (cyclomatic 17) · ×1
  • ai_pr_review.prepare (cyclomatic 17) .github/scripts/ai_pr_review.py:430 — ai_pr_review.prepare has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ai_pr_triage.assess_risk (cyclomatic 17) · ×1
  • ai_pr_triage.assess_risk (cyclomatic 17) .github/scripts/ai_pr_triage.py:544 — ai_pr_triage.assess_risk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · check_skill_routes.check_routes (cyclomatic 17) · ×1
  • check_skill_routes.check_routes (cyclomatic 17) .github/scripts/check_skill_routes.py:12 — check_skill_routes.check_routes has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTMLDocumentBackend._extract_input_like_text (cyclomatic 17) · ×1
  • HTMLDocumentBackend._extract_input_like_text (cyclomatic 17) docling/backend/html_backend.py:4152 — HTMLDocumentBackend._extract_input_like_text has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IWAReader._drawable_blocks (cyclomatic 17) · ×1
  • IWAReader._drawable_blocks (cyclomatic 17) docling/backend/iwork/archives.py:1127 — IWAReader._drawable_blocks has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsExcelDocumentBackend._find_tables_in_sheet (cyclomatic 17) · ×1
  • MsExcelDocumentBackend._find_tables_in_sheet (cyclomatic 17) docling/backend/msexcel_backend.py:972 — MsExcelDocumentBackend._find_tables_in_sheet has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._handle_tables (cyclomatic 17) · ×1
  • MsWordDocumentBackend._handle_tables (cyclomatic 17) docling/backend/msword_backend.py:3917 — MsWordDocumentBackend._handle_tables has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OdsDocumentBackend._find_data_tables_in_sheet (cyclomatic 17) · ×1
  • OdsDocumentBackend._find_data_tables_in_sheet (cyclomatic 17) docling/backend/opendocument_backend.py:2466 — OdsDocumentBackend._find_data_tables_in_sheet has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JatsDocumentBackend._load_figure_image (cyclomatic 17) · ×1
  • JatsDocumentBackend._load_figure_image (cyclomatic 17) docling/backend/xml/jats_backend.py:963 — JatsDocumentBackend._load_figure_image has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DocumentConversionInput._guess_from_content (cyclomatic 17) · ×1
  • _DocumentConversionInput._guess_from_content (cyclomatic 17) docling/datamodel/document.py:992 — _DocumentConversionInput._guess_from_content has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _DocumentConversionInput._mime_from_extension (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · nuextract_transformers_model.process_all_vision_info (cyclomatic 17) · ×1
  • nuextract_transformers_model.process_all_vision_info (cyclomatic 17) docling/models/extraction/nuextract_transformers_model.py:31 — nuextract_transformers_model.process_all_vision_info has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · prompt_utils._process_all_vision_info (cyclomatic 17) · ×1
  • prompt_utils._process_all_vision_info (cyclomatic 17) docling/models/extraction/prompt_utils.py:112 — prompt_utils._process_all_vision_info has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KserveV2HttpClient.infer (cyclomatic 17) · ×1
  • KserveV2HttpClient.infer (cyclomatic 17) docling/models/inference_engines/common/kserve_v2_http.py:318 — KserveV2HttpClient.infer has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingOrderPredictor.predict_reading_order (cyclomatic 17) · ×1
  • ReadingOrderPredictor.predict_reading_order (cyclomatic 17) docling/models/postprocessing/reading_order_rb.py:464 — ReadingOrderPredictor.predict_reading_order has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reading_order_rb.build_page_separators (cyclomatic 17) · ×1
  • reading_order_rb.build_page_separators (cyclomatic 17) docling/models/postprocessing/reading_order_rb.py:318 — reading_order_rb.build_page_separators has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaginatedPipeline._build_document (cyclomatic 17) · ×1
  • PaginatedPipeline._build_document (cyclomatic 17) docling/pipeline/base_pipeline.py:340 — PaginatedPipeline._build_document has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChandraDocumentBuilder._list (cyclomatic 17) · ×1
  • _ChandraDocumentBuilder._list (cyclomatic 17) docling/utils/chandra_utils.py:632 — _ChandraDocumentBuilder._list has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChandraDocumentBuilder._picture (cyclomatic 17) · ×1
  • _ChandraDocumentBuilder._picture (cyclomatic 17) docling/utils/chandra_utils.py:701 — _ChandraDocumentBuilder._picture has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · font_style.parse_font_style (cyclomatic 17) · ×1
  • font_style.parse_font_style (cyclomatic 17) docling/utils/font_style.py:122 — font_style.parse_font_style has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nemotron_parse_v3_5_utils._add_chart (cyclomatic 17) · ×1
  • nemotron_parse_v3_5_utils._add_chart (cyclomatic 17) docling/utils/nemotron_parse_v3_5_utils.py:435 — nemotron_parse_v3_5_utils._add_chart has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ai_pr_event.resolve (cyclomatic 16) · ×1
  • ai_pr_event.resolve (cyclomatic 16) .github/scripts/ai_pr_event.py:46 — ai_pr_event.resolve has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · afp_backend._iter_structured_fields (cyclomatic 16) · ×1
  • afp_backend._iter_structured_fields (cyclomatic 16) docling/backend/afp_backend.py:93 — afp_backend._iter_structured_fields has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EmailDocumentBackend.convert (cyclomatic 16) · ×1
  • EmailDocumentBackend.convert (cyclomatic 16) docling/backend/email_backend.py:349 — EmailDocumentBackend.convert has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MsExcelDocumentBackend._chart_range (cyclomatic 16) · ×1
  • MsExcelDocumentBackend._chart_range (cyclomatic 16) docling/backend/msexcel_backend.py:2186 — MsExcelDocumentBackend._chart_range has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._is_code_by_font (cyclomatic 16) · ×1
  • MsWordDocumentBackend._is_code_by_font (cyclomatic 16) docling/backend/msword_backend.py:2070 — MsWordDocumentBackend._is_code_by_font has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._iter_paragraph_content (cyclomatic 16) · ×1
  • MsWordDocumentBackend._iter_paragraph_content (cyclomatic 16) docling/backend/msword_backend.py:2401 — MsWordDocumentBackend._iter_paragraph_content has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MsWordDocumentBackend._collect_textbox_paragraphs (cyclomatic 16) · ×1
  • MsWordDocumentBackend._collect_textbox_paragraphs (cyclomatic 16) docling/backend/msword_backend.py:2755 — MsWordDocumentBackend._collect_textbox_paragraphs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opendocument_backend._find_true_data_bounds (cyclomatic 16) · ×1
  • opendocument_backend._find_true_data_bounds (cyclomatic 16) docling/backend/opendocument_backend.py:347 — opendocument_backend._find_true_data_bounds has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InputDocument.__init__ (cyclomatic 16) · ×1
  • InputDocument.__init__ (cyclomatic 16) docling/datamodel/document.py:158 — InputDocument.__init__ has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _DocumentConversionInput._mime_from_extension (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · VllmVlmEngine.initialize (cyclomatic 16) · ×1
  • VllmVlmEngine.initialize (cyclomatic 16) docling/models/inference_engines/vlm/vllm_engine.py:124 — VllmVlmEngine.initialize has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VllmVlmEngine.predict_batch (cyclomatic 16) · ×1
  • VllmVlmEngine.predict_batch (cyclomatic 16) docling/models/inference_engines/vlm/vllm_engine.py:268 — VllmVlmEngine.predict_batch has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PageAssembleModel.__call__ (cyclomatic 16) · ×1
  • PageAssembleModel.__call__ (cyclomatic 16) docling/models/stages/page_assemble/page_assemble_model.py:183 — PageAssembleModel.__call__ has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StandardPdfPipeline._integrate_results (cyclomatic 16) · ×1
  • StandardPdfPipeline._integrate_results (cyclomatic 16) docling/pipeline/standard_pdf_pipeline.py:1093 — StandardPdfPipeline._integrate_results has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chandra_utils.parse_chandra_html (cyclomatic 16) · ×1
  • chandra_utils.parse_chandra_html (cyclomatic 16) docling/utils/chandra_utils.py:800 — chandra_utils.parse_chandra_html has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nemotron_parse_v3_5_utils.latex_tabular_to_html (cyclomatic 16) · ×1
  • nemotron_parse_v3_5_utils.latex_tabular_to_html (cyclomatic 16) docling/utils/nemotron_parse_v3_5_utils.py:297 — nemotron_parse_v3_5_utils.latex_tabular_to_html has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · iterate_pdf_pages.process_pdf (cyclomatic 16) · ×1
  • iterate_pdf_pages.process_pdf (cyclomatic 16) perfs/iterate_pdf_pages.py:633 — iterate_pdf_pages.process_pdf has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · HTMLDocumentBackend._extract_form_region (cognitive 235) · ×1
  • HTMLDocumentBackend._extract_form_region (cognitive 235) docling/backend/html_backend.py:4609 — HTMLDocumentBackend._extract_form_region has cognitive complexity 235 (threshold 15). Drivers by points: if/else 70 (184 pts), loops 13 (24 pts), boolean chains 14, ternaries 4 (13 pts) (nesting depth added 134). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._handle_list (cognitive 149) · ×1
  • HTMLDocumentBackend._handle_list (cognitive 149) docling/backend/html_backend.py:3067 — HTMLDocumentBackend._handle_list has cognitive complexity 149 (threshold 15). Drivers by points: if/else 36 (108 pts), loops 5 (17 pts), boolean chains 15, ternaries 3 (9 pts) (nesting depth added 90). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MacroHandlerMixin._process_macro (cognitive 132) · ×1
  • MacroHandlerMixin._process_macro (cognitive 132) docling/backend/latex/handlers/macros.py:520 — MacroHandlerMixin._process_macro has cognitive complexity 132 (threshold 15). Drivers by points: if/else 39 (104 pts), error handling 4 (14 pts), boolean chains 9, loops 2 (5 pts) (nesting depth added 78). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · XmlTable._parse_table (cognitive 131) · ×1
  • XmlTable._parse_table (cognitive 131) REDACTED:1659 — XmlTable._parse_table has cognitive complexity 131 (threshold 15). Drivers by points: if/else 18 (78 pts), loops 7 (31 pts), ternaries 3 (17 pts), boolean chains 5 (nesting depth added 98). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · main.convert (cognitive 121) · ×1
  • main.convert (cognitive 121) docling/cli/main.py:912 — main.convert has cognitive complexity 121 (threshold 15). Drivers by points: if/else 51 (80 pts), boolean chains 15, ternaries 9 (15 pts), error handling 5 (10 pts), loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._walk_linear (cognitive 112) · ×1
  • MsWordDocumentBackend._walk_linear (cognitive 112) docling/backend/msword_backend.py:1224 — MsWordDocumentBackend._walk_linear has cognitive complexity 112 (threshold 15). Drivers by points: if/else 24 (78 pts), loops 6 (22 pts), boolean chains 5, ternaries 1 (4 pts), error handling 1 (3 pts) (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · main.export_documents (cognitive 100) · ×1
  • main.export_documents (cognitive 100) docling/cli/main.py:587 — main.export_documents has cognitive complexity 100 (threshold 15). Drivers by points: if/else 27 (74 pts), boolean chains 13, loops 4 (13 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XBRLDocumentBackend.convert (cognitive 95) · ×1
  • XBRLDocumentBackend.convert (cognitive 95) docling/backend/xml/xbrl_backend.py:266 — XBRLDocumentBackend.convert has cognitive complexity 95 (threshold 15). Drivers by points: if/else 19 (50 pts), loops 8 (16 pts), ternaries 6 (16 pts), boolean chains 13 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · candidates.candidates_for (cognitive 94) · ×1
  • candidates.candidates_for (cognitive 94) docling/models/stages/form_field/keying/candidates.py:170 — candidates.candidates_for has cognitive complexity 94 (threshold 15). Drivers by points: if/else 23 (60 pts), boolean chains 17, loops 9 (14 pts), ternaries 1 (3 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownDocumentBackend._iterate_elements (cognitive 91) · ×1
  • MarkdownDocumentBackend._iterate_elements (cognitive 91) docling/backend/md_backend.py:701 — MarkdownDocumentBackend._iterate_elements has cognitive complexity 91 (threshold 15). Drivers by points: if/else 28 (54 pts), boolean chains 17, ternaries 6 (16 pts), loops 2 (4 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HTMLDocumentBackend._extract_checkbox_text_and_consumed_label_obj_ids (cognitive 89) · ×1
  • HTMLDocumentBackend._extract_checkbox_text_and_consumed_label_obj_ids (cognitive 89) docling/backend/html_backend.py:4035 — HTMLDocumentBackend._extract_checkbox_text_and_consumed_label_obj_ids has cognitive complexity 89 (threshold 15). Drivers by points: if/else 23 (67 pts), loops 5 (17 pts), boolean chains 4, ternaries 1 (nesting depth added 56). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HTMLDocumentBackend._handle_block (cognitive 83) · ×1
  • HTMLDocumentBackend._handle_block (cognitive 83) docling/backend/html_backend.py:3369 — HTMLDocumentBackend._handle_block has cognitive complexity 83 (threshold 15). Drivers by points: if/else 20 (67 pts), loops 6 (13 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 55). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HTMLDocumentBackend._walk_nodes (cognitive 81) · ×1
  • HTMLDocumentBackend._walk_nodes (cognitive 81) docling/backend/html_backend.py:2196 — HTMLDocumentBackend._walk_nodes has cognitive complexity 81 (threshold 15). Drivers by points: if/else 22 (66 pts), loops 2 (6 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tables.table_fields (cognitive 79) · ×1
  • tables.table_fields (cognitive 79) docling/models/stages/form_field/keying/tables.py:31 — tables.table_fields has cognitive complexity 79 (threshold 15). Drivers by points: if/else 12 (36 pts), ternaries 6 (23 pts), boolean chains 13, loops 4 (7 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacroHandlerMixin._macro_definition_spans (cognitive 75) · ×1
  • MacroHandlerMixin._macro_definition_spans (cognitive 75) docling/backend/latex/handlers/macros.py:247 — MacroHandlerMixin._macro_definition_spans has cognitive complexity 75 (threshold 15). Drivers by points: if/else 17 (42 pts), ternaries 4 (12 pts), loops 4 (11 pts), boolean chains 10 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._handle_text_elements (cognitive 72) · ×1
  • MsWordDocumentBackend._handle_text_elements (cognitive 72) docling/backend/msword_backend.py:3028 — MsWordDocumentBackend._handle_text_elements has cognitive complexity 72 (threshold 15). Drivers by points: if/else 25 (47 pts), loops 4 (12 pts), boolean chains 9, ternaries 2 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend.parse_table_data (cognitive 65) · ×1
  • HTMLDocumentBackend.parse_table_data (cognitive 65) docling/backend/html_backend.py:2038 — HTMLDocumentBackend.parse_table_data has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 8 (19 pts), boolean chains 9 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DocumentConversionInput._guess_format (cognitive 65) · ×1
  • _DocumentConversionInput._guess_format (cognitive 65) docling/datamodel/document.py:815 — _DocumentConversionInput._guess_format has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (49 pts), boolean chains 12, ternaries 2 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._handle_form_container (cognitive 63) · ×1
  • HTMLDocumentBackend._handle_form_container (cognitive 63) docling/backend/html_backend.py:5085 — HTMLDocumentBackend._handle_form_container has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 5 (19 pts), boolean chains 1, ternaries 1 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · JatsDocumentBackend.parse_table_data (cognitive 63) · ×1
  • JatsDocumentBackend.parse_table_data (cognitive 63) docling/backend/xml/jats_backend.py:1048 — JatsDocumentBackend.parse_table_data has cognitive complexity 63 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 9 (21 pts), boolean chains 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsPowerpointDocumentBackend._handle_text_elements (cognitive 60) · ×1
  • MsPowerpointDocumentBackend._handle_text_elements (cognitive 60) docling/backend/mspowerpoint_backend.py:985 — MsPowerpointDocumentBackend._handle_text_elements has cognitive complexity 60 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 4 (12 pts), ternaries 2 (7 pts), boolean chains 4 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api_image_request.api_image_request_streaming (cognitive 60) · ×1
  • api_image_request.api_image_request_streaming (cognitive 60) REDACTED:304 — api_image_request.api_image_request_streaming has cognitive complexity 60 (threshold 15). Drivers by points: if/else 12 (35 pts), error handling 5 (13 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HuggingFaceMlxModel.process_images (cognitive 59) · ×1
  • HuggingFaceMlxModel.process_images (cognitive 59) docling/models/vlm_pipeline_models/mlx_model.py:174 — HuggingFaceMlxModel.process_images has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 3 (7 pts), ternaries 2 (7 pts), error handling 1 (5 pts), boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._handle_equations_in_text (cognitive 58) · ×1
  • MsWordDocumentBackend._handle_equations_in_text (cognitive 58) docling/backend/msword_backend.py:2917 — MsWordDocumentBackend._handle_equations_in_text has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (44 pts), loops 4 (9 pts), boolean chains 5 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RapidOcrModel.__init__ (cognitive 58) · ×1
  • RapidOcrModel.__init__ (cognitive 58) docling/models/stages/ocr/rapid_ocr_model.py:470 — RapidOcrModel.__init__ has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (42 pts), ternaries 4 (11 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MacroHandlerMixin._extract_custom_macros (cognitive 57) · ×1
  • MacroHandlerMixin._extract_custom_macros (cognitive 57) docling/backend/latex/handlers/macros.py:321 — MacroHandlerMixin._extract_custom_macros has cognitive complexity 57 (threshold 15). Drivers by points: if/else 10 (37 pts), ternaries 2 (8 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TesseractOcrModel.__call__ (cognitive 57) · ×1
  • TesseractOcrModel.__call__ (cognitive 57) docling/models/stages/ocr/tesseract_ocr_model.py:165 — TesseractOcrModel.__call__ has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (42 pts), loops 3 (8 pts), ternaries 1 (7 pts) (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · solver._solve (cognitive 54) · ×1
  • solver._solve (cognitive 54) docling/models/stages/form_field/keying/solver.py:367 — solver._solve has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 14 (23 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChandraDocumentBuilder._emit_runs (cognitive 54) · ×1
  • _ChandraDocumentBuilder._emit_runs (cognitive 54) docling/utils/chandra_utils.py:387 — _ChandraDocumentBuilder._emit_runs has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 13, ternaries 5 (10 pts), loops 5 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsciiDocBackend._parse (cognitive 53) · ×1
  • AsciiDocBackend._parse (cognitive 53) docling/backend/asciidoc_backend.py:195 — AsciiDocBackend._parse has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 9, loops 4 (9 pts), ternaries 1 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._add_heading (cognitive 51) · ×1
  • MsWordDocumentBackend._add_heading (cognitive 51) docling/backend/msword_backend.py:3317 — MsWordDocumentBackend._add_heading has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (13 pts), ternaries 3 (11 pts), boolean chains 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._get_paragraph_position (cognitive 50) · ×1
  • MsWordDocumentBackend._get_paragraph_position (cognitive 50) docling/backend/msword_backend.py:2644 — MsWordDocumentBackend._get_paragraph_position has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (27 pts), error handling 4 (15 pts), loops 4 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._add_comments (cognitive 50) · ×1
  • MsWordDocumentBackend._add_comments (cognitive 50) docling/backend/msword_backend.py:4918 — MsWordDocumentBackend._add_comments has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 4 (11 pts), error handling 1 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opendocument_backend._add_odf_list (cognitive 50) · ×1
  • opendocument_backend._add_odf_list (cognitive 50) docling/backend/opendocument_backend.py:1385 — opendocument_backend._add_odf_list has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 6 (14 pts), ternaries 4 (11 pts), boolean chains 5 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OcrAutoModel.__init__ (cognitive 49) · ×1
  • OcrAutoModel.__init__ (cognitive 49) docling/models/stages/ocr/auto_ocr_model.py:48 — OcrAutoModel.__init__ has cognitive complexity 49 (threshold 15). Drivers by points: error handling 11 (33 pts), if/else 8 (16 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageAssembleModel.__call__ (cognitive 49) · ×1
  • PageAssembleModel.__call__ (cognitive 49) docling/models/stages/page_assemble/page_assemble_model.py:183 — PageAssembleModel.__call__ has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (44 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JatsDocumentBackend._walk_linear (cognitive 47) · ×1
  • JatsDocumentBackend._walk_linear (cognitive 47) docling/backend/xml/jats_backend.py:1305 — JatsDocumentBackend._walk_linear has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HuggingFaceTransformersVlmModel.process_images (cognitive 47) · ×1
  • HuggingFaceTransformersVlmModel.process_images (cognitive 47) docling/models/vlm_pipeline_models/hf_transformers_model.py:251 — HuggingFaceTransformersVlmModel.process_images has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 5, loops 3 (4 pts), ternaries 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsciiDocBackend._iter_blocks (cognitive 46) · ×1
  • AsciiDocBackend._iter_blocks (cognitive 46) docling/backend/asciidoc_backend.py:499 — AsciiDocBackend._iter_blocks has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 (cognitive 46) · ×1
  • nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 (cognitive 46) docling/utils/nemotron_parse_v3_5_utils.py:479 — nemotron_parse_v3_5_utils.parse_nemotron_parse_v3_5 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (31 pts), ternaries 5 (13 pts), boolean chains 1, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetsGbsDocumentBackend.__init__ (cognitive 45) · ×1
  • MetsGbsDocumentBackend.__init__ (cognitive 45) docling/backend/mets_gbs_backend.py:242 — MetsGbsDocumentBackend.__init__ has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 5 (7 pts), error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoPipeline._process_video (cognitive 45) · ×1
  • VideoPipeline._process_video (cognitive 45) docling/pipeline/video_pipeline.py:156 — VideoPipeline._process_video has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (20 pts), error handling 5 (13 pts), boolean chains 6, loops 3, ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accelerator_utils.decide_device (cognitive 45) · ×1
  • accelerator_utils.decide_device (cognitive 45) docling/utils/accelerator_utils.py:13 — accelerator_utils.decide_device has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 10 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mineru_utils.parse_mineru2 (cognitive 45) · ×1
  • mineru_utils.parse_mineru2 (cognitive 45) docling/utils/mineru_utils.py:330 — mineru_utils.parse_mineru2 has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 11, ternaries 3 (8 pts), loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextHelperMixin._macro_node_to_text (cognitive 44) · ×1
  • TextHelperMixin._macro_node_to_text (cognitive 44) docling/backend/latex/utils/text.py:313 — TextHelperMixin._macro_node_to_text has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._manage_list_structure (cognitive 44) · ×1
  • MsWordDocumentBackend._manage_list_structure (cognitive 44) docling/backend/msword_backend.py:3582 — MsWordDocumentBackend._manage_list_structure has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (12 pts), boolean chains 9 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OdsDocumentBackend._find_data_tables_in_sheet (cognitive 44) · ×1
  • OdsDocumentBackend._find_data_tables_in_sheet (cognitive 44) docling/backend/opendocument_backend.py:2466 — OdsDocumentBackend._find_data_tables_in_sheet has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 7 (18 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MlxVlmEngine.predict_batch (cognitive 44) · ×1
  • MlxVlmEngine.predict_batch (cognitive 44) docling/models/inference_engines/vlm/mlx_engine.py:209 — MlxVlmEngine.predict_batch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (22 pts), ternaries 3 (9 pts), loops 3 (7 pts), error handling 1 (5 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dots_utils.parse_dots_json (cognitive 44) · ×1
  • dots_utils.parse_dots_json (cognitive 44) docling/utils/dots_utils.py:216 — dots_utils.parse_dots_json has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._get_format_from_run (cognitive 43) · ×1
  • MsWordDocumentBackend._get_format_from_run (cognitive 43) docling/backend/msword_backend.py:2234 — MsWordDocumentBackend._get_format_from_run has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (9 pts), boolean chains 8, error handling 1 (2 pts), ternaries 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacroHandlerMixin._process_macro_node_inline (cognitive 42) · ×1
  • MacroHandlerMixin._process_macro_node_inline (cognitive 42) docling/backend/latex/handlers/macros.py:417 — MacroHandlerMixin._process_macro_node_inline has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (38 pts), boolean chains 4 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · macros._strip_latex_comments (cognitive 42) · ×1
  • macros._strip_latex_comments (cognitive 42) docling/backend/latex/handlers/macros.py:109 — macros._strip_latex_comments has cognitive complexity 42 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (13 pts), ternaries 2 (7 pts), boolean chains 6 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TableHelperMixin._process_table_macro_node (cognitive 42) · ×1
  • TableHelperMixin._process_table_macro_node (cognitive 42) docling/backend/latex/utils/table.py:58 — TableHelperMixin._process_table_macro_node has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 4 (18 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._collect_textbox_paragraphs (cognitive 42) · ×1
  • MsWordDocumentBackend._collect_textbox_paragraphs (cognitive 42) docling/backend/msword_backend.py:2755 — MsWordDocumentBackend._collect_textbox_paragraphs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 4 (10 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadedLayoutVlmPipeline._build_document (cognitive 42) · ×1
  • ThreadedLayoutVlmPipeline._build_document (cognitive 42) docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:278 — ThreadedLayoutVlmPipeline._build_document has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 6 (7 pts), boolean chains 4, error handling 1 (4 pts), ternaries 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · iwa.decompress_snappy_block (cognitive 41) · ×1
  • iwa.decompress_snappy_block (cognitive 41) docling/backend/iwork/iwa.py:120 — iwa.decompress_snappy_block has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._find_tables_in_sheet (cognitive 41) · ×1
  • MsExcelDocumentBackend._find_tables_in_sheet (cognitive 41) docling/backend/msexcel_backend.py:972 — MsExcelDocumentBackend._find_tables_in_sheet has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 4 (11 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KserveV2GrpcClient.infer (cognitive 41) · ×1
  • KserveV2GrpcClient.infer (cognitive 41) docling/models/inference_engines/common/kserve_v2_grpc.py:281 — KserveV2GrpcClient.infer has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 5 (8 pts), error handling 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingOrderPredictor._init_ud_maps (cognitive 41) · ×1
  • ReadingOrderPredictor._init_ud_maps (cognitive 41) docling/models/postprocessing/reading_order_rb.py:805 — ReadingOrderPredictor._init_ud_maps has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 6 (10 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TableStructureModelV2.predict_tables (cognitive 41) · ×1
  • TableStructureModelV2.predict_tables (cognitive 41) docling/models/stages/table_structure/table_structure_model_v2.py:400 — TableStructureModelV2.predict_tables has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreprocessThreadedStage._process_batch (cognitive 41) · ×1
  • PreprocessThreadedStage._process_batch (cognitive 41) docling/pipeline/standard_pdf_pipeline.py:464 — PreprocessThreadedStage._process_batch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 6 (12 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._extract_text_and_hyperlink_recursively (cognitive 40) · ×1
  • HTMLDocumentBackend._extract_text_and_hyperlink_recursively (cognitive 40) docling/backend/html_backend.py:2444 — HTMLDocumentBackend._extract_text_and_hyperlink_recursively has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TableHelperMixin._parse_table (cognitive 40) · ×1
  • TableHelperMixin._parse_table (cognitive 40) docling/backend/latex/utils/table.py:141 — TableHelperMixin._parse_table has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JatsDocumentBackend._parse_element_citation (cognitive 40) · ×1
  • JatsDocumentBackend._parse_element_citation (cognitive 40) docling/backend/xml/jats_backend.py:621 — JatsDocumentBackend._parse_element_citation has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TesseractOcrCliModel.__call__ (cognitive 40) · ×1
  • TesseractOcrCliModel.__call__ (cognitive 40) docling/models/stages/ocr/tesseract_ocr_cli_model.py:322 — TesseractOcrCliModel.__call__ has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (24 pts), error handling 2 (8 pts), loops 3 (8 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadedPipelineStage._process_batch (cognitive 40) · ×1
  • ThreadedPipelineStage._process_batch (cognitive 40) docling/pipeline/standard_pdf_pipeline.py:333 — ThreadedPipelineStage._process_batch has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 6 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StandardPdfPipeline._build_document (cognitive 40) · ×1
  • StandardPdfPipeline._build_document (cognitive 40) docling/pipeline/standard_pdf_pipeline.py:890 — StandardPdfPipeline._build_document has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 6 (8 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChandraDocumentBuilder._block (cognitive 40) · ×1
  • _ChandraDocumentBuilder._block (cognitive 40) docling/utils/chandra_utils.py:534 — _ChandraDocumentBuilder._block has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 13, ternaries 3 (7 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._find_data_tables (cognitive 39) · ×1
  • MsExcelDocumentBackend._find_data_tables (cognitive 39) docling/backend/msexcel_backend.py:1224 — MsExcelDocumentBackend._find_data_tables has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (29 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BaseOcrModel._find_pdf_aware_layout_ocr_rects (cognitive 39) · ×1
  • BaseOcrModel._find_pdf_aware_layout_ocr_rects (cognitive 39) docling/models/base_ocr_model.py:372 — BaseOcrModel._find_pdf_aware_layout_ocr_rects has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OdtDocumentBackend._detach_annotations (cognitive 38) · ×1
  • OdtDocumentBackend._detach_annotations (cognitive 38) docling/backend/opendocument_backend.py:1918 — OdtDocumentBackend._detach_annotations has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 7 (9 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformersVlmEngine.predict_batch (cognitive 38) · ×1
  • TransformersVlmEngine.predict_batch (cognitive 38) docling/models/inference_engines/vlm/transformers_engine.py:382 — TransformersVlmEngine.predict_batch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 6, ternaries 4 (6 pts), loops 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ReadingOrderPredictor._do_horizontal_dilation (cognitive 38) · ×1
  • ReadingOrderPredictor._do_horizontal_dilation (cognitive 38) docling/models/postprocessing/reading_order_rb.py:952 — ReadingOrderPredictor._do_horizontal_dilation has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · symmetry.sequences (cognitive 38) · ×1
  • symmetry.sequences (cognitive 38) docling/models/stages/form_field/keying/symmetry.py:199 — symmetry.sequences has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 6 (12 pts), boolean chains 6 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TableStructureModel.predict_tables (cognitive 38) · ×1
  • TableStructureModel.predict_tables (cognitive 38) docling/models/stages/table_structure/table_structure_model.py:181 — TableStructureModel.predict_tables has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deepseekocr_utils.parse_deepseekocr_markdown (cognitive 38) · ×1
  • deepseekocr_utils.parse_deepseekocr_markdown (cognitive 38) docling/utils/deepseekocr_utils.py:229 — deepseekocr_utils.parse_deepseekocr_markdown has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 9, error handling 1 (3 pts), loops 2, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._handle_tables (cognitive 37) · ×1
  • MsWordDocumentBackend._handle_tables (cognitive 37) docling/backend/msword_backend.py:3917 — MsWordDocumentBackend._handle_tables has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opendocument_backend._find_true_data_bounds (cognitive 37) · ×1
  • opendocument_backend._find_true_data_bounds (cognitive 37) docling/backend/opendocument_backend.py:347 — opendocument_backend._find_true_data_bounds has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (29 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chandra_utils._table_cells (cognitive 37) · ×1
  • chandra_utils._table_cells (cognitive 37) docling/utils/chandra_utils.py:194 — chandra_utils._table_cells has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (10 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai_pr_triage.assess_risk (cognitive 36) · ×1
  • ai_pr_triage.assess_risk (cognitive 36) .github/scripts/ai_pr_triage.py:544 — ai_pr_triage.assess_risk has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (11 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · heading_hierarchy_model._infer_from_bookmarks (cognitive 36) · ×1
  • heading_hierarchy_model._infer_from_bookmarks (cognitive 36) docling/models/stages/heading_hierarchy/heading_hierarchy_model.py:462 — heading_hierarchy_model._infer_from_bookmarks has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · models.download (cognitive 35) · ×1
  • models.download (cognitive 35) docling/cli/models.py:127 — models.download has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 7, error handling 3 (6 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · rules.printed_cell (cognitive 35) · ×1
  • rules.printed_cell (cognitive 35) docling/models/stages/form_field/keying/rules.py:64 — rules.printed_cell has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 10, loops 3 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._fix_invalid_paragraph_structure (cognitive 34) · ×1
  • HTMLDocumentBackend._fix_invalid_paragraph_structure (cognitive 34) docling/backend/html_backend.py:1841 — HTMLDocumentBackend._fix_invalid_paragraph_structure has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 3 (5 pts), error handling 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inputs.inputs (cognitive 34) · ×1
  • inputs.inputs (cognitive 34) docling/models/stages/form_field/keying/inputs.py:98 — inputs.inputs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 6 (10 pts), boolean chains 1, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HuggingFaceTransformersVlmModel.__init__ (cognitive 34) · ×1
  • HuggingFaceTransformersVlmModel.__init__ (cognitive 34) docling/models/vlm_pipeline_models/hf_transformers_model.py:59 — HuggingFaceTransformersVlmModel.__init__ has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · model_downloader.download_models (cognitive 34) · ×1
  • model_downloader.download_models (cognitive 34) docling/utils/model_downloader.py:149 — model_downloader.download_models has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, loops 3 (6 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · iterate_pdf_pages.main (cognitive 34) · ×1
  • iterate_pdf_pages.main (cognitive 34) perfs/iterate_pdf_pages.py:809 — iterate_pdf_pages.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 7 (12 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._add_list_item_with_content (cognitive 33) · ×1
  • HTMLDocumentBackend._add_list_item_with_content (cognitive 33) docling/backend/html_backend.py:2913 — HTMLDocumentBackend._add_list_item_with_content has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · EnvironmentHandlerMixin._process_environment (cognitive 32) · ×1
  • EnvironmentHandlerMixin._process_environment (cognitive 32) docling/backend/latex/handlers/environments.py:85 — EnvironmentHandlerMixin._process_environment has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 1 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MsWordDocumentBackend._iter_paragraph_content (cognitive 32) · ×1
  • MsWordDocumentBackend._iter_paragraph_content (cognitive 32) docling/backend/msword_backend.py:2401 — MsWordDocumentBackend._iter_paragraph_content has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EpubDocumentBackend.convert (cognitive 31) · ×1
  • EpubDocumentBackend.convert (cognitive 31) docling/backend/epub_backend.py:384 — EpubDocumentBackend.convert has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 8, error handling 3 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._extract_input_like_text (cognitive 31) · ×1
  • HTMLDocumentBackend._extract_input_like_text (cognitive 31) docling/backend/html_backend.py:4152 — HTMLDocumentBackend._extract_input_like_text has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsPowerpointDocumentBackend._handle_tables (cognitive 31) · ×1
  • MsPowerpointDocumentBackend._handle_tables (cognitive 31) docling/backend/mspowerpoint_backend.py:1224 — MsPowerpointDocumentBackend._handle_tables has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChandraDocumentBuilder._list (cognitive 31) · ×1
  • _ChandraDocumentBuilder._list (cognitive 31) docling/utils/chandra_utils.py:632 — _ChandraDocumentBuilder._list has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LayoutPostprocessor._process_special_clusters (cognitive 31) · ×1
  • LayoutPostprocessor._process_special_clusters (cognitive 31) docling/utils/layout_postprocessor.py:278 — LayoutPostprocessor._process_special_clusters has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 4, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nemotron_parse_v3_5_utils.latex_tabular_to_html (cognitive 31) · ×1
  • nemotron_parse_v3_5_utils.latex_tabular_to_html (cognitive 31) docling/utils/nemotron_parse_v3_5_utils.py:297 — nemotron_parse_v3_5_utils.latex_tabular_to_html has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (9 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · otsl.parse_otsl_output (cognitive 31) · ×1
  • otsl.parse_otsl_output (cognitive 31) docling/utils/otsl.py:24 — otsl.parse_otsl_output has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · afp_backend._iter_structured_fields (cognitive 30) · ×1
  • afp_backend._iter_structured_fields (cognitive 30) docling/backend/afp_backend.py:93 — afp_backend._iter_structured_fields has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._compact_adjacent_single_char_parts (cognitive 30) · ×1
  • HTMLDocumentBackend._compact_adjacent_single_char_parts (cognitive 30) docling/backend/html_backend.py:1723 — HTMLDocumentBackend._compact_adjacent_single_char_parts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (17 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._get_label_and_level (cognitive 30) · ×1
  • MsWordDocumentBackend._get_label_and_level (cognitive 30) docling/backend/msword_backend.py:2132 — MsWordDocumentBackend._get_label_and_level has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 10 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JatsDocumentBackend._load_figure_image (cognitive 30) · ×1
  • JatsDocumentBackend._load_figure_image (cognitive 30) docling/backend/xml/jats_backend.py:963 — JatsDocumentBackend._load_figure_image has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PictureDescriptionBaseModel.__call__ (cognitive 30) · ×1
  • PictureDescriptionBaseModel.__call__ (cognitive 30) docling/models/picture_description_base_model.py:75 — PictureDescriptionBaseModel.__call__ has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ReadingOrderPredictor.predict_merges (cognitive 30) · ×1
  • ReadingOrderPredictor.predict_merges (cognitive 30) docling/models/postprocessing/reading_order_rb.py:590 — ReadingOrderPredictor.predict_merges has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChartExtractionVlmEngineModel.__call__ (cognitive 30) · ×1
  • ChartExtractionVlmEngineModel.__call__ (cognitive 30) docling/models/stages/chart_extraction/granite_vision.py:152 — ChartExtractionVlmEngineModel.__call__ has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 6 (9 pts), ternaries 1 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run_pr_fast_checks.main (cognitive 29) · ×1
  • run_pr_fast_checks.main (cognitive 29) .github/scripts/run_pr_fast_checks.py:325 — run_pr_fast_checks.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chart_image._plot (cognitive 29) · ×1
  • chart_image._plot (cognitive 29) REDACTED:237 — chart_image._plot has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 4 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._get_level_element (cognitive 29) · ×1
  • MsWordDocumentBackend._get_level_element (cognitive 29) docling/backend/msword_backend.py:1574 — MsWordDocumentBackend._get_level_element has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OdtDocumentBackend._used_master_pages (cognitive 29) · ×1
  • OdtDocumentBackend._used_master_pages (cognitive 29) docling/backend/opendocument_backend.py:1793 — OdtDocumentBackend._used_master_pages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (9 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatentHandler._add_property (cognitive 29) · ×1
  • PatentHandler._add_property (cognitive 29) REDACTED:1403 — PatentHandler._add_property has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (8 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingOrderModel.__call__ (cognitive 29) · ×1
  • ReadingOrderModel.__call__ (cognitive 29) docling/models/stages/reading_order/readingorder_model.py:1087 — ReadingOrderModel.__call__ has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 6 (9 pts), ternaries 4 (7 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TableStructureModelV2._build_table_cells (cognitive 29) · ×1
  • TableStructureModelV2._build_table_cells (cognitive 29) docling/models/stages/table_structure/table_structure_model_v2.py:252 — TableStructureModelV2._build_table_cells has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (10 pts), ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VllmVlmModel.process_images (cognitive 29) · ×1
  • VllmVlmModel.process_images (cognitive 29) docling/models/vlm_pipeline_models/vllm_model.py:274 — VllmVlmModel.process_images has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 3 (6 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · font_style.parse_font_style (cognitive 29) · ×1
  • font_style.parse_font_style (cognitive 29) docling/utils/font_style.py:122 — font_style.parse_font_style has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 3 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend.convert (cognitive 28) · ×1
  • HTMLDocumentBackend.convert (cognitive 28) docling/backend/html_backend.py:920 — HTMLDocumentBackend.convert has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, loops 5 (6 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsPowerpointDocumentBackend._extract_slide_comments (cognitive 28) · ×1
  • MsPowerpointDocumentBackend._extract_slide_comments (cognitive 28) docling/backend/mspowerpoint_backend.py:2097 — MsPowerpointDocumentBackend._extract_slide_comments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (15 pts), ternaries 2 (6 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VlmPipeline._finalize_page_output (cognitive 28) · ×1
  • VlmPipeline._finalize_page_output (cognitive 28) docling/pipeline/vlm_pipeline.py:836 — VlmPipeline._finalize_page_output has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (9 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._parse_threaded_comments (cognitive 27) · ×1
  • MsExcelDocumentBackend._parse_threaded_comments (cognitive 27) docling/backend/msexcel_backend.py:670 — MsExcelDocumentBackend._parse_threaded_comments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 4 (7 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XmlTable._create_tg_range (cognitive 27) · ×1
  • XmlTable._create_tg_range (cognitive 27) REDACTED:1563 — XmlTable._create_tg_range has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 7 (10 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoInlineVlmEngine._select_engine (cognitive 27) · ×1
  • AutoInlineVlmEngine._select_engine (cognitive 27) docling/models/inference_engines/vlm/auto_inline_engine.py:75 — AutoInlineVlmEngine._select_engine has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 2 (6 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StandardPdfPipeline._assemble_document (cognitive 27) · ×1
  • StandardPdfPipeline._assemble_document (cognitive 27) docling/pipeline/standard_pdf_pipeline.py:1149 — StandardPdfPipeline._assemble_document has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_skill_routes.check_routes (cognitive 26) · ×1
  • check_skill_routes.check_routes (cognitive 26) .github/scripts/check_skill_routes.py:12 — check_skill_routes.check_routes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (8 pts), boolean chains 3, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._make_text_prov (cognitive 26) · ×1
  • HTMLDocumentBackend._make_text_prov (cognitive 26) docling/backend/html_backend.py:1610 — HTMLDocumentBackend._make_text_prov has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HTMLDocumentBackend._handle_heading (cognitive 26) · ×1
  • HTMLDocumentBackend._handle_heading (cognitive 26) docling/backend/html_backend.py:2767 — HTMLDocumentBackend._handle_heading has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (9 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatentHandler._add_property (cognitive 26) · ×1
  • PatentHandler._add_property (cognitive 26) REDACTED:484 — PatentHandler._add_property has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (8 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HuggingFaceMlxModel.__init__ (cognitive 26) · ×1
  • HuggingFaceMlxModel.__init__ (cognitive 26) docling/models/vlm_pipeline_models/mlx_model.py:42 — HuggingFaceMlxModel.__init__ has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HTMLDocumentBackend._should_ignore_table_kv_link (cognitive 25) · ×1
  • HTMLDocumentBackend._should_ignore_table_kv_link (cognitive 25) docling/backend/html_backend.py:3748 — HTMLDocumentBackend._should_ignore_table_kv_link has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 7 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacy.legacy_list_styles (cognitive 25) · ×1
  • legacy.legacy_list_styles (cognitive 25) REDACTED:510 — legacy.legacy_list_styles has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (6 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._build_enum_marker (cognitive 25) · ×1
  • MsWordDocumentBackend._build_enum_marker (cognitive 25) docling/backend/msword_backend.py:1761 — MsWordDocumentBackend._build_enum_marker has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opendocument_backend._add_table_from_odf (cognitive 25) · ×1
  • opendocument_backend._add_table_from_odf (cognitive 25) docling/backend/opendocument_backend.py:1567 — opendocument_backend._add_table_from_odf has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · solver.in_checkbox_blocks (cognitive 25) · ×1
  • solver.in_checkbox_blocks (cognitive 25) docling/models/stages/form_field/keying/solver.py:307 — solver.in_checkbox_blocks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaginatedPipeline._build_document (cognitive 25) · ×1
  • PaginatedPipeline._build_document (cognitive 25) docling/pipeline/base_pipeline.py:340 — PaginatedPipeline._build_document has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deepseekocr_utils._parse_table_html (cognitive 25) · ×1
  • deepseekocr_utils._parse_table_html (cognitive 25) docling/utils/deepseekocr_utils.py:32 — deepseekocr_utils._parse_table_html has cognitive complexity 25 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · EmailDocumentBackend._msg_to_rfc822_bytes (cognitive 24) · ×1
  • EmailDocumentBackend._msg_to_rfc822_bytes (cognitive 24) docling/backend/email_backend.py:155 — EmailDocumentBackend._msg_to_rfc822_bytes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IWAReader._drawable_blocks (cognitive 24) · ×1
  • IWAReader._drawable_blocks (cognitive 24) docling/backend/iwork/archives.py:1127 — IWAReader._drawable_blocks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · keynote_xml.iter_drawables (cognitive 24) · ×1
  • keynote_xml.iter_drawables (cognitive 24) REDACTED:278 — keynote_xml.iter_drawables has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (10 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextHelperMixin._contains_math (cognitive 24) · ×1
  • TextHelperMixin._contains_math (cognitive 24) docling/backend/latex/utils/text.py:207 — TextHelperMixin._contains_math has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformersVlmEngine._load_model_for_repo (cognitive 24) · ×1
  • TransformersVlmEngine._load_model_for_repo (cognitive 24) docling/models/inference_engines/vlm/transformers_engine.py:215 — TransformersVlmEngine._load_model_for_repo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 8, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · VllmVlmEngine.initialize (cognitive 24) · ×1
  • VllmVlmEngine.initialize (cognitive 24) docling/models/inference_engines/vlm/vllm_engine.py:124 — VllmVlmEngine.initialize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RapidOcrModel.__call__ (cognitive 24) · ×1
  • RapidOcrModel.__call__ (cognitive 24) docling/models/stages/ocr/rapid_ocr_model.py:749 — RapidOcrModel.__call__ has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VllmVlmModel.__init__ (cognitive 24) · ×1
  • VllmVlmModel.__init__ (cognitive 24) docling/models/vlm_pipeline_models/vllm_model.py:91 — VllmVlmModel.__init__ has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · iterate_pdf_pages.process_pdf (cognitive 24) · ×1
  • iterate_pdf_pages.process_pdf (cognitive 24) perfs/iterate_pdf_pages.py:633 — iterate_pdf_pages.process_pdf has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai_pr_event.resolve (cognitive 23) · ×1
  • ai_pr_event.resolve (cognitive 23) .github/scripts/ai_pr_event.py:46 — ai_pr_event.resolve has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai_pr_triage.render_comment (cognitive 23) · ×1
  • ai_pr_triage.render_comment (cognitive 23) .github/scripts/ai_pr_triage.py:908 — ai_pr_triage.render_comment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CsvDocumentBackend.convert (cognitive 23) · ×1
  • CsvDocumentBackend.convert (cognitive 23) docling/backend/csv_backend.py:160 — CsvDocumentBackend.convert has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (8 pts), boolean chains 2, error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._find_table_bounds (cognitive 23) · ×1
  • MsExcelDocumentBackend._find_table_bounds (cognitive 23) docling/backend/msexcel_backend.py:1308 — MsExcelDocumentBackend._find_table_bounds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 5 (9 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._handle_vml_pictures (cognitive 23) · ×1
  • MsWordDocumentBackend._handle_vml_pictures (cognitive 23) docling/backend/msword_backend.py:4345 — MsWordDocumentBackend._handle_vml_pictures has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 1 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PatentHandler._add_property (cognitive 23) · ×1
  • PatentHandler._add_property (cognitive 23) REDACTED:822 — PatentHandler._add_property has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (8 pts), ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformersExtractionModel.__init__ (cognitive 23) · ×1
  • TransformersExtractionModel.__init__ (cognitive 23) docling/models/extraction/transformers_extraction_model.py:41 — TransformersExtractionModel.__init__ has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · solver.penalized_pairs (cognitive 23) · ×1
  • solver.penalized_pairs (cognitive 23) docling/models/stages/form_field/keying/solver.py:112 — solver.penalized_pairs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EasyOcrModel.__call__ (cognitive 23) · ×1
  • EasyOcrModel.__call__ (cognitive 23) docling/models/stages/ocr/easyocr_model.py:308 — EasyOcrModel.__call__ has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nemotron_parse_v3_5_utils._add_chart (cognitive 23) · ×1
  • nemotron_parse_v3_5_utils._add_chart (cognitive 23) docling/utils/nemotron_parse_v3_5_utils.py:435 — nemotron_parse_v3_5_utils._add_chart has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · iterate_pdf_pages.collect_pdfs_by_page_count (cognitive 23) · ×1
  • iterate_pdf_pages.collect_pdfs_by_page_count (cognitive 23) perfs/iterate_pdf_pages.py:576 — iterate_pdf_pages.collect_pdfs_by_page_count has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 1 (3 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai_pr_review.prepare (cognitive 22) · ×1
  • ai_pr_review.prepare (cognitive 22) .github/scripts/ai_pr_review.py:430 — ai_pr_review.prepare has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1 (2 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownDocumentBackend._iterate_cell_inline (cognitive 22) · ×1
  • MarkdownDocumentBackend._iterate_cell_inline (cognitive 22) docling/backend/md_backend.py:463 — MarkdownDocumentBackend._iterate_cell_inline has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (10 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsPowerpointDocumentBackend._to_slide_coordinates (cognitive 22) · ×1
  • MsPowerpointDocumentBackend._to_slide_coordinates (cognitive 22) docling/backend/mspowerpoint_backend.py:463 — MsPowerpointDocumentBackend._to_slide_coordinates has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 3 (8 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._style_numbering (cognitive 22) · ×1
  • MsWordDocumentBackend._style_numbering (cognitive 22) docling/backend/msword_backend.py:1540 — MsWordDocumentBackend._style_numbering has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OdsDocumentBackend._find_page_size (cognitive 22) · ×1
  • OdsDocumentBackend._find_page_size (cognitive 22) docling/backend/opendocument_backend.py:2616 — OdsDocumentBackend._find_page_size has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JatsDocumentBackend._parse_contrib_name (cognitive 22) · ×1
  • JatsDocumentBackend._parse_contrib_name (cognitive 22) docling/backend/xml/jats_backend.py:398 — JatsDocumentBackend._parse_contrib_name has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 7 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XBRLDocumentBackend.__init__ (cognitive 22) · ×1
  • XBRLDocumentBackend.__init__ (cognitive 22) docling/backend/xml/xbrl_backend.py:88 — XBRLDocumentBackend.__init__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _DocumentConversionInput.docs (cognitive 22) · ×1
  • _DocumentConversionInput.docs (cognitive 22) docling/datamodel/document.py:673 — _DocumentConversionInput.docs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KserveV2HttpClient.infer (cognitive 22) · ×1
  • KserveV2HttpClient.infer (cognitive 22) docling/models/inference_engines/common/kserve_v2_http.py:318 — KserveV2HttpClient.infer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingOrderPredictor.predict_reading_order (cognitive 22) · ×1
  • ReadingOrderPredictor.predict_reading_order (cognitive 22) docling/models/postprocessing/reading_order_rb.py:464 — ReadingOrderPredictor.predict_reading_order has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 9 (11 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inputs.stacks (cognitive 22) · ×1
  • inputs.stacks (cognitive 22) docling/models/stages/form_field/keying/inputs.py:258 — inputs.stacks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · heading_hierarchy_model._resolve_ambiguous (cognitive 22) · ×1
  • heading_hierarchy_model._resolve_ambiguous (cognitive 22) docling/models/stages/heading_hierarchy/heading_hierarchy_model.py:172 — heading_hierarchy_model._resolve_ambiguous has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (8 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deepseekocr_utils._collect_annotation_content (cognitive 22) · ×1
  • deepseekocr_utils._collect_annotation_content (cognitive 22) docling/utils/deepseekocr_utils.py:127 — deepseekocr_utils._collect_annotation_content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deepseekocr_utils._process_annotation_item (cognitive 22) · ×1
  • deepseekocr_utils._process_annotation_item (cognitive 22) docling/utils/deepseekocr_utils.py:175 — deepseekocr_utils._process_annotation_item has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai_pr_triage.find_candidates (cognitive 21) · ×1
  • ai_pr_triage.find_candidates (cognitive 21) .github/scripts/ai_pr_triage.py:715 — ai_pr_triage.find_candidates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opendocument_backend._odf_cell_has_rich_content (cognitive 21) · ×1
  • opendocument_backend._odf_cell_has_rich_content (cognitive 21) docling/backend/opendocument_backend.py:967 — opendocument_backend._odf_cell_has_rich_content has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InputDocument.__init__ (cognitive 21) · ×1
  • InputDocument.__init__ (cognitive 21) docling/datamodel/document.py:158 — InputDocument.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DocumentConversionInput._detect_mets_gbs (cognitive 21) · ×1
  • _DocumentConversionInput._detect_mets_gbs (cognitive 21) docling/datamodel/document.py:1229 — _DocumentConversionInput._detect_mets_gbs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 3, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · prompt_utils._process_all_vision_info (cognitive 21) · ×1
  • prompt_utils._process_all_vision_info (cognitive 21) docling/models/extraction/prompt_utils.py:112 — prompt_utils._process_all_vision_info has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, ternaries 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformersExtractionModel.process_images (cognitive 21) · ×1
  • TransformersExtractionModel.process_images (cognitive 21) docling/models/extraction/transformers_extraction_model.py:137 — TransformersExtractionModel.process_images has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListItemMarkerProcessor.merge_markers_and_text_items_into_list_items (cognitive 21) · ×1
  • ListItemMarkerProcessor.merge_markers_and_text_items_into_list_items (cognitive 21) docling/models/postprocessing/list_marker_processor.py:288 — ListItemMarkerProcessor.merge_markers_and_text_items_into_list_items has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 2 (10 pts), if/else 3 (9 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · reading_order_rb.build_page_separators (cognitive 21) · ×1
  • reading_order_rb.build_page_separators (cognitive 21) docling/models/postprocessing/reading_order_rb.py:318 — reading_order_rb.build_page_separators has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, loops 3 (4 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingOrderModel._add_rich_table_fields (cognitive 21) · ×1
  • ReadingOrderModel._add_rich_table_fields (cognitive 21) docling/models/stages/reading_order/readingorder_model.py:518 — ReadingOrderModel._add_rich_table_fields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraniteVisionTableStructureModel.predict_tables (cognitive 21) · ×1
  • GraniteVisionTableStructureModel.predict_tables (cognitive 21) docling/models/stages/table_structure/table_structure_model_granite_vision.py:122 — GraniteVisionTableStructureModel.predict_tables has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chandra_utils._inline_runs (cognitive 21) · ×1
  • chandra_utils._inline_runs (cognitive 21) docling/utils/chandra_utils.py:303 — chandra_utils._inline_runs has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chandra_utils.parse_chandra_html (cognitive 21) · ×1
  • chandra_utils.parse_chandra_html (cognitive 21) docling/utils/chandra_utils.py:800 — chandra_utils.parse_chandra_html has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 1 (2 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nemotron_parse_utils.parse_nemotron_parse_v2 (cognitive 21) · ×1
  • nemotron_parse_utils.parse_nemotron_parse_v2 (cognitive 21) docling/utils/nemotron_parse_utils.py:255 — nemotron_parse_utils.parse_nemotron_parse_v2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (7 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pdf_outline.extract_outline_from_pdfium (cognitive 21) · ×1
  • pdf_outline.extract_outline_from_pdfium (cognitive 21) docling/utils/pdf_outline.py:95 — pdf_outline.extract_outline_from_pdfium has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ai_pr_triage.code_segments (cognitive 20) · ×1
  • ai_pr_triage.code_segments (cognitive 20) .github/scripts/ai_pr_triage.py:352 — ai_pr_triage.code_segments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BoxNoteDocumentBackend._add_table (cognitive 20) · ×1
  • BoxNoteDocumentBackend._add_table (cognitive 20) docling/backend/boxnote_backend.py:271 — BoxNoteDocumentBackend._add_table has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (7 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · HTMLDocumentBackend._consume_form_fields_in_subtree (cognitive 20) · ×1
  • HTMLDocumentBackend._consume_form_fields_in_subtree (cognitive 20) docling/backend/html_backend.py:4405 — HTMLDocumentBackend._consume_form_fields_in_subtree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacy.legacy_runs (cognitive 20) · ×1
  • legacy.legacy_runs (cognitive 20) REDACTED:426 — legacy.legacy_runs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PagesReader.page_furniture (cognitive 20) · ×1
  • PagesReader.page_furniture (cognitive 20) docling/backend/iwork/pages_iwa.py:199 — PagesReader.page_furniture has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · MsExcelDocumentBackend._find_chart_in_sheet (cognitive 20) · ×1
  • MsExcelDocumentBackend._find_chart_in_sheet (cognitive 20) docling/backend/msexcel_backend.py:1725 — MsExcelDocumentBackend._find_chart_in_sheet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (5 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._is_in_mc_fallback_with_choice_txbx (cognitive 20) · ×1
  • MsWordDocumentBackend._is_in_mc_fallback_with_choice_txbx (cognitive 20) docling/backend/msword_backend.py:2715 — MsWordDocumentBackend._is_in_mc_fallback_with_choice_txbx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._is_rich_table_cell (cognitive 20) · ×1
  • MsWordDocumentBackend._is_rich_table_cell (cognitive 20) docling/backend/msword_backend.py:4090 — MsWordDocumentBackend._is_rich_table_cell has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PageChars.text_in_rect (cognitive 20) · ×1
  • _PageChars.text_in_rect (cognitive 20) docling/backend/pypdfium2_backend.py:317 — _PageChars.text_in_rect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebVTTDocumentBackend.convert (cognitive 20) · ×1
  • WebVTTDocumentBackend.convert (cognitive 20) docling/backend/webvtt_backend.py:109 — WebVTTDocumentBackend.convert has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConversionAssets.load (cognitive 20) · ×1
  • ConversionAssets.load (cognitive 20) docling/datamodel/document.py:509 — ConversionAssets.load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NuExtractTransformersModel.process_images (cognitive 20) · ×1
  • NuExtractTransformersModel.process_images (cognitive 20) docling/models/extraction/nuextract_transformers_model.py:173 — NuExtractTransformersModel.process_images has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3, boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VllmVlmEngine.predict_batch (cognitive 20) · ×1
  • VllmVlmEngine.predict_batch (cognitive 20) docling/models/inference_engines/vlm/vllm_engine.py:268 — VllmVlmEngine.predict_batch has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 4, boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OcrMacModel.__call__ (cognitive 20) · ×1
  • OcrMacModel.__call__ (cognitive 20) docling/models/stages/ocr/ocr_mac_model.py:150 — OcrMacModel.__call__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TesseractOcrModel.__init__ (cognitive 20) · ×1
  • TesseractOcrModel.__init__ (cognitive 20) docling/models/stages/ocr/tesseract_ocr_model.py:43 — TesseractOcrModel.__init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingOrderModel._match_table_pictures (cognitive 20) · ×1
  • ReadingOrderModel._match_table_pictures (cognitive 20) docling/models/stages/reading_order/readingorder_model.py:376 — ReadingOrderModel._match_table_pictures has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VllmVlmModel.__call__ (cognitive 20) · ×1
  • VllmVlmModel.__call__ (cognitive 20) docling/models/vlm_pipeline_models/vllm_model.py:215 — VllmVlmModel.__call__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (9 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LayoutPostprocessor._process_regular_clusters (cognitive 20) · ×1
  • LayoutPostprocessor._process_regular_clusters (cognitive 20) docling/utils/layout_postprocessor.py:220 — LayoutPostprocessor._process_regular_clusters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._is_lonely_key_covered_by_table (cognitive 19) · ×1
  • HTMLDocumentBackend._is_lonely_key_covered_by_table (cognitive 19) docling/backend/html_backend.py:4434 — HTMLDocumentBackend._is_lonely_key_covered_by_table has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · archives.iwa_referenced_ids (cognitive 19) · ×1
  • archives.iwa_referenced_ids (cognitive 19) docling/backend/iwork/archives.py:1312 — archives.iwa_referenced_ids has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · numbers_xml.place_row (cognitive 19) · ×1
  • numbers_xml.place_row (cognitive 19) REDACTED:329 — numbers_xml.place_row has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · numbers_xml.formula_text (cognitive 19) · ×1
  • numbers_xml.formula_text (cognitive 19) REDACTED:441 — numbers_xml.formula_text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (9 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IWorkNumbersDocumentBackend.convert (cognitive 19) · ×1
  • IWorkNumbersDocumentBackend.convert (cognitive 19) docling/backend/iwork_backend.py:1207 — IWorkNumbersDocumentBackend.convert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EnvironmentHandlerMixin._process_list (cognitive 19) · ×1
  • EnvironmentHandlerMixin._process_list (cognitive 19) docling/backend/latex/handlers/environments.py:340 — EnvironmentHandlerMixin._process_list has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EnvironmentHandlerMixin._process_bibliography (cognitive 19) · ×1
  • EnvironmentHandlerMixin._process_bibliography (cognitive 19) docling/backend/latex/handlers/environments.py:377 — EnvironmentHandlerMixin._process_bibliography has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · encoding.decode_latex_content (cognitive 19) · ×1
  • encoding.decode_latex_content (cognitive 19) docling/backend/latex/utils/encoding.py:15 — encoding.decode_latex_content has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (12 pts), loops 2 (4 pts), if/else 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._convert_workbook (cognitive 19) · ×1
  • MsExcelDocumentBackend._convert_workbook (cognitive 19) docling/backend/msexcel_backend.py:853 — MsExcelDocumentBackend._convert_workbook has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._title_text (cognitive 19) · ×1
  • MsExcelDocumentBackend._title_text (cognitive 19) docling/backend/msexcel_backend.py:1896 — MsExcelDocumentBackend._title_text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._chart_range (cognitive 19) · ×1
  • MsExcelDocumentBackend._chart_range (cognitive 19) docling/backend/msexcel_backend.py:2186 — MsExcelDocumentBackend._chart_range has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MsWordDocumentBackend._add_footnotes_and_endnotes (cognitive 19) · ×1
  • MsWordDocumentBackend._add_footnotes_and_endnotes (cognitive 19) docling/backend/msword_backend.py:4852 — MsWordDocumentBackend._add_footnotes_and_endnotes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DocumentConversionInput._guess_from_content (cognitive 19) · ×1
  • _DocumentConversionInput._guess_from_content (cognitive 19) docling/datamodel/document.py:992 — _DocumentConversionInput._guess_from_content has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nuextract_transformers_model.process_all_vision_info (cognitive 19) · ×1
  • nuextract_transformers_model.process_all_vision_info (cognitive 19) docling/models/extraction/nuextract_transformers_model.py:31 — nuextract_transformers_model.process_all_vision_info has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), ternaries 4, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · granite_vision._dataframe_to_tabledata (cognitive 19) · ×1
  • granite_vision._dataframe_to_tabledata (cognitive 19) docling/models/stages/chart_extraction/granite_vision.py:337 — granite_vision._dataframe_to_tabledata has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 5, loops 3 (5 pts), if/else 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inputs.lines (cognitive 19) · ×1
  • inputs.lines (cognitive 19) docling/models/stages/form_field/keying/inputs.py:188 — inputs.lines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · heading_hierarchy_model._resolve_bare_arabic (cognitive 19) · ×1
  • heading_hierarchy_model._resolve_bare_arabic (cognitive 19) docling/models/stages/heading_hierarchy/heading_hierarchy_model.py:216 — heading_hierarchy_model._resolve_bare_arabic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtractionVlmPipeline._extract_data (cognitive 19) · ×1
  • ExtractionVlmPipeline._extract_data (cognitive 19) docling/pipeline/extraction_vlm_pipeline.py:57 — ExtractionVlmPipeline._extract_data has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StandardPdfPipeline._integrate_results (cognitive 19) · ×1
  • StandardPdfPipeline._integrate_results (cognitive 19) docling/pipeline/standard_pdf_pipeline.py:1093 — StandardPdfPipeline._integrate_results has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai_pr_triage.parse_triage_result (cognitive 18) · ×1
  • ai_pr_triage.parse_triage_result (cognitive 18) .github/scripts/ai_pr_triage.py:230 — ai_pr_triage.parse_triage_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pr_topic_labels.deterministic_topics (cognitive 18) · ×1
  • pr_topic_labels.deterministic_topics (cognitive 18) .github/scripts/pr_topic_labels.py:130 — pr_topic_labels.deterministic_topics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · afp_backend._extract_ptoca_text (cognitive 18) · ×1
  • afp_backend._extract_ptoca_text (cognitive 18) docling/backend/afp_backend.py:164 — afp_backend._extract_ptoca_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmailDocumentBackend.convert (cognitive 18) · ×1
  • EmailDocumentBackend.convert (cognitive 18) docling/backend/email_backend.py:349 — EmailDocumentBackend.convert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · archives.iwa_tile_placements (cognitive 18) · ×1
  • archives.iwa_tile_placements (cognitive 18) docling/backend/iwork/archives.py:834 — archives.iwa_tile_placements has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacy.legacy_inherited_lists (cognitive 18) · ×1
  • legacy.legacy_inherited_lists (cognitive 18) REDACTED:554 — legacy.legacy_inherited_lists has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LatexDocumentBackend._process_nodes (cognitive 18) · ×1
  • LatexDocumentBackend._process_nodes (cognitive 18) docling/backend/latex/backend.py:274 — LatexDocumentBackend._process_nodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetsGbsDocumentBackend._parse_page (cognitive 18) · ×1
  • MetsGbsDocumentBackend._parse_page (cognitive 18) docling/backend/mets_gbs_backend.py:400 — MetsGbsDocumentBackend._parse_page has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MsPowerpointDocumentBackend._walk_linear (cognitive 18) · ×1
  • MsPowerpointDocumentBackend._walk_linear (cognitive 18) docling/backend/mspowerpoint_backend.py:1826 — MsPowerpointDocumentBackend._walk_linear has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._convert_elements_via_docx (cognitive 18) · ×1
  • MsWordDocumentBackend._convert_elements_via_docx (cognitive 18) docling/backend/msword_backend.py:4210 — MsWordDocumentBackend._convert_elements_via_docx has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._chart_to_table_data (cognitive 18) · ×1
  • MsWordDocumentBackend._chart_to_table_data (cognitive 18) docling/backend/msword_backend.py:4590 — MsWordDocumentBackend._chart_to_table_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 5 (6 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatentUsptoIce.parse (cognitive 18) · ×1
  • PatentUsptoIce.parse (cognitive 18) REDACTED:267 — PatentUsptoIce.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 4 (6 pts), loops 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (PatentUsptoGrantV2.parse, PatentUsptoAppV1.parse) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PatentUsptoGrantV2.parse (cognitive 18) · ×1
  • PatentUsptoGrantV2.parse (cognitive 18) REDACTED:617 — PatentUsptoGrantV2.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 4 (6 pts), loops 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (PatentUsptoIce.parse, PatentUsptoAppV1.parse) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PatentUsptoAppV1.parse (cognitive 18) · ×1
  • PatentUsptoAppV1.parse (cognitive 18) REDACTED:1191 — PatentUsptoAppV1.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 4 (6 pts), loops 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (PatentUsptoIce.parse, PatentUsptoGrantV2.parse) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · heading_hierarchy_model._heading_style (cognitive 18) · ×1
  • heading_hierarchy_model._heading_style (cognitive 18) docling/models/stages/heading_hierarchy/heading_hierarchy_model.py:294 — heading_hierarchy_model._heading_style has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HuggingFaceTransformersVlmModel.__call__ (cognitive 18) · ×1
  • HuggingFaceTransformersVlmModel.__call__ (cognitive 18) docling/models/vlm_pipeline_models/hf_transformers_model.py:195 — HuggingFaceTransformersVlmModel.__call__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HuggingFaceMlxModel.__call__ (cognitive 18) · ×1
  • HuggingFaceMlxModel.__call__ (cognitive 18) docling/models/vlm_pipeline_models/mlx_model.py:118 — HuggingFaceMlxModel.__call__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _NativeWhisperModel.__init__ (cognitive 18) · ×1
  • _NativeWhisperModel.__init__ (cognitive 18) docling/pipeline/asr_transcriber.py:230 — _NativeWhisperModel.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChandraDocumentBuilder._picture (cognitive 18) · ×1
  • _ChandraDocumentBuilder._picture (cognitive 18) docling/utils/chandra_utils.py:701 — _ChandraDocumentBuilder._picture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4, boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · LayoutPostprocessor._select_best_cluster (cognitive 18) · ×1
  • LayoutPostprocessor._select_best_cluster (cognitive 18) docling/utils/layout_postprocessor.py:608 — LayoutPostprocessor._select_best_cluster has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · paddleocr_vl_utils._add_block (cognitive 18) · ×1
  • paddleocr_vl_utils._add_block (cognitive 18) docling/utils/paddleocr_vl_utils.py:242 — paddleocr_vl_utils._add_block has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate_asr_models.run_models (cognitive 18) · ×1
  • validate_asr_models.run_models (cognitive 18) scripts/validate_asr_models.py:90 — validate_asr_models.run_models has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (5 pts), error handling 1 (2 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._merge_adjacent_form_values (cognitive 17) · ×1
  • HTMLDocumentBackend._merge_adjacent_form_values (cognitive 17) docling/backend/html_backend.py:4229 — HTMLDocumentBackend._merge_adjacent_form_values has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._emit_input (cognitive 17) · ×1
  • HTMLDocumentBackend._emit_input (cognitive 17) docling/backend/html_backend.py:5303 — HTMLDocumentBackend._emit_input has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · archives.iwa_value_list (cognitive 17) · ×1
  • archives.iwa_value_list (cognitive 17) docling/backend/iwork/archives.py:740 — archives.iwa_value_list has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · iwa.iter_objects (cognitive 17) · ×1
  • iwa.iter_objects (cognitive 17) docling/backend/iwork/iwa.py:235 — iwa.iter_objects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacroHandlerMixin._extract_all_macro_args_inline (cognitive 17) · ×1
  • MacroHandlerMixin._extract_all_macro_args_inline (cognitive 17) docling/backend/latex/handlers/macros.py:827 — MacroHandlerMixin._extract_all_macro_args_inline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownDocumentBackend._parse_gfm_table (cognitive 17) · ×1
  • MarkdownDocumentBackend._parse_gfm_table (cognitive 17) docling/backend/md_backend.py:356 — MarkdownDocumentBackend._parse_gfm_table has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._get_or_create_list_group (cognitive 17) · ×1
  • MsWordDocumentBackend._get_or_create_list_group (cognitive 17) docling/backend/msword_backend.py:1106 — MsWordDocumentBackend._get_or_create_list_group has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (6 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsWordDocumentBackend._handle_pictures (cognitive 17) · ×1
  • MsWordDocumentBackend._handle_pictures (cognitive 17) docling/backend/msword_backend.py:4287 — MsWordDocumentBackend._handle_pictures has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opendocument_backend._table_data_from_odf (cognitive 17) · ×1
  • opendocument_backend._table_data_from_odf (cognitive 17) docling/backend/opendocument_backend.py:1679 — opendocument_backend._table_data_from_odf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatentUsptoGrantAps.store_content (cognitive 17) · ×1
  • PatentUsptoGrantAps.store_content (cognitive 17) REDACTED:1057 — PatentUsptoGrantAps.store_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeadingHierarchyModel.assign_heading_levels (cognitive 17) · ×1
  • HeadingHierarchyModel.assign_heading_levels (cognitive 17) docling/models/stages/heading_hierarchy/heading_hierarchy_model.py:580 — HeadingHierarchyModel.assign_heading_levels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · rapid_ocr_model._rapidocr_artifacts (cognitive 17) · ×1
  • rapid_ocr_model._rapidocr_artifacts (cognitive 17) docling/models/stages/ocr/rapid_ocr_model.py:339 — rapid_ocr_model._rapidocr_artifacts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VlmPipeline._build_document (cognitive 17) · ×1
  • VlmPipeline._build_document (cognitive 17) docling/pipeline/vlm_pipeline.py:260 — VlmPipeline._build_document has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LayoutPostprocessor._remove_overlapping_clusters (cognitive 17) · ×1
  • LayoutPostprocessor._remove_overlapping_clusters (cognitive 17) docling/utils/layout_postprocessor.py:551 — LayoutPostprocessor._remove_overlapping_clusters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (6 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai_pr_triage.publish (cognitive 16) · ×1
  • ai_pr_triage.publish (cognitive 16) .github/scripts/ai_pr_triage.py:1022 — ai_pr_triage.publish has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HTMLDocumentBackend._make_text_prov_for_source_tag_ids (cognitive 16) · ×1
  • HTMLDocumentBackend._make_text_prov_for_source_tag_ids (cognitive 16) docling/backend/html_backend.py:1657 — HTMLDocumentBackend._make_text_prov_for_source_tag_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTMLDocumentBackend._is_rich_table_cell (cognitive 16) · ×1
  • HTMLDocumentBackend._is_rich_table_cell (cognitive 16) docling/backend/html_backend.py:1973 — HTMLDocumentBackend._is_rich_table_cell has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · archives.iwa_object_runs (cognitive 16) · ×1
  • archives.iwa_object_runs (cognitive 16) docling/backend/iwork/archives.py:525 — archives.iwa_object_runs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pages_xml.read_content (cognitive 16) · ×1
  • pages_xml.read_content (cognitive 16) REDACTED:80 — pages_xml.read_content has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · macros._simple_declaration_end (cognitive 16) · ×1
  • macros._simple_declaration_end (cognitive 16) docling/backend/latex/handlers/macros.py:142 — macros._simple_declaration_end has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LatexMetadataHandler._unwrap_parboxes (cognitive 16) · ×1
  • LatexMetadataHandler._unwrap_parboxes (cognitive 16) docling/backend/latex/handlers/metadata.py:178 — LatexMetadataHandler._unwrap_parboxes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._find_true_data_bounds (cognitive 16) · ×1
  • MsExcelDocumentBackend._find_true_data_bounds (cognitive 16) docling/backend/msexcel_backend.py:1173 — MsExcelDocumentBackend._find_true_data_bounds has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MsExcelDocumentBackend._chart_to_table_data (cognitive 16) · ×1
  • MsExcelDocumentBackend._chart_to_table_data (cognitive 16) docling/backend/msexcel_backend.py:1932 — MsExcelDocumentBackend._chart_to_table_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (5 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opendocument_backend._normalize_odf_text_runs (cognitive 16) · ×1
  • opendocument_backend._normalize_odf_text_runs (cognitive 16) docling/backend/opendocument_backend.py:557 — opendocument_backend._normalize_odf_text_runs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageResourceLoader.resolve_relative_path (cognitive 16) · ×1
  • ImageResourceLoader.resolve_relative_path (cognitive 16) REDACTED:313 — ImageResourceLoader.resolve_relative_path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (16 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · JatsDocumentBackend._parse_abstract (cognitive 16) · ×1
  • JatsDocumentBackend._parse_abstract (cognitive 16) docling/backend/xml/jats_backend.py:442 — JatsDocumentBackend._parse_abstract has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JatsDocumentBackend._add_abstract (cognitive 16) · ×1
  • JatsDocumentBackend._add_abstract (cognitive 16) docling/backend/xml/jats_backend.py:550 — JatsDocumentBackend._add_abstract has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · JatsDocumentBackend._walk_inline_formula (cognitive 16) · ×1
  • JatsDocumentBackend._walk_inline_formula (cognitive 16) docling/backend/xml/jats_backend.py:800 — JatsDocumentBackend._walk_inline_formula has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseOcrModel.post_process_cells (cognitive 16) · ×1
  • BaseOcrModel.post_process_cells (cognitive 16) docling/models/base_ocr_model.py:597 — BaseOcrModel.post_process_cells has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · factory.create_vlm_engine (cognitive 16) · ×1
  • factory.create_vlm_engine (cognitive 16) docling/models/inference_engines/vlm/factory.py:30 — factory.create_vlm_engine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EasyOcrModel.download_models (cognitive 16) · ×1
  • EasyOcrModel.download_models (cognitive 16) docling/models/stages/ocr/easyocr_model.py:260 — EasyOcrModel.download_models has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KserveV2OcrModel.__call__ (cognitive 16) · ×1
  • KserveV2OcrModel.__call__ (cognitive 16) docling/models/stages/ocr/kserve_v2_ocr_model.py:216 — KserveV2OcrModel.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingOrderModel._readingorder_elements_to_docling_doc (cognitive 16) · ×1
  • ReadingOrderModel._readingorder_elements_to_docling_doc (cognitive 16) docling/models/stages/reading_order/readingorder_model.py:615 — ReadingOrderModel._readingorder_elements_to_docling_doc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingOrderModel._handle_text_element (cognitive 16) · ×1
  • ReadingOrderModel._handle_text_element (cognitive 16) docling/models/stages/reading_order/readingorder_model.py:938 — ReadingOrderModel._handle_text_element has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiVlmModel.__call__ (cognitive 16) · ×1
  • ApiVlmModel.__call__ (cognitive 16) docling/models/vlm_pipeline_models/api_vlm_model.py:51 — ApiVlmModel.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasePipeline._enrich_document (cognitive 16) · ×1
  • BasePipeline._enrich_document (cognitive 16) docling/pipeline/base_pipeline.py:173 — BasePipeline._enrich_document has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LayoutPostprocessor._select_best_cluster_from_group (cognitive 16) · ×1
  • LayoutPostprocessor._select_best_cluster_from_group (cognitive 16) docling/utils/layout_postprocessor.py:518 — LayoutPostprocessor._select_best_cluster_from_group has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfmpegRunner.run (cognitive 16) · ×1
  • FfmpegRunner.run (cognitive 16) docling/utils/video_frame_sampling.py:146 — FfmpegRunner.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 2, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) docling/backend/html_backend.py:2046 — docling/backend/html_backend.py:2046-2176 | docling/backend/xml/jats_backend.py:1050-1154 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) docling/models/inference_engines/image_classification/api_kserve_v2_engine.py:94 — docling/models/inference_engines/image_classification/api_kserve_v2_engine.py:94-144 | docling/models/inference_engines/object_detection/api_kserve_v2_engine.py:108-167 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) REDACTED:384 — REDACTED:384-414 | REDACTED:432-453 | REDACTED:732-762 | REDACTED:777-798 | REDACTED:1306-1336 | REDACTED:1351-1372 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:356 — docling/models/stages/ocr/_nemotron_ocr_model.py:356-420 | docling/models/stages/ocr/nemotron_ocr_model.py:387-451 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/ocr/_nemotron_ocr_model.py:356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33–47 lines × 2) · ×1
  • Duplicated block (33–47 lines × 2) docling/backend/msword_backend.py:4290 — docling/backend/msword_backend.py:4290-4322 | docling/backend/msword_backend.py:4348-4394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (44 lines × 3) · ×1
  • Duplicated block (44 lines × 3) REDACTED:268 — REDACTED:268-311 | REDACTED:618-661 | REDACTED:1192-1235 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) docling/models/inference_engines/image_classification/api_kserve_v2_engine.py:94 — docling/models/inference_engines/image_classification/api_kserve_v2_engine.py:94-136 | docling/models/inference_engines/object_detection/api_kserve_v2_engine.py:108-150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:311 — docling/models/stages/ocr/_nemotron_ocr_model.py:311-351 | docling/models/stages/ocr/nemotron_ocr_model.py:342-382 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/ocr/_nemotron_ocr_model.py:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) docling/models/stages/table_structure/table_structure_model.py:186 — docling/models/stages/table_structure/table_structure_model.py:186-222 | docling/models/stages/table_structure/table_structure_model_v2.py:407-444 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26–31 lines × 2) · ×1
  • Duplicated block (26–31 lines × 2) docling/models/extraction/nuextract_transformers_model.py:57 — docling/models/extraction/nuextract_transformers_model.py:57-87 | docling/models/extraction/prompt_utils.py:120-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:192 — docling/models/stages/ocr/_nemotron_ocr_model.py:192-222 | docling/models/stages/ocr/nemotron_ocr_model.py:223-253 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) docling/document_converter.py:893 — docling/document_converter.py:893-919 | docling/document_extractor.py:214-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/document_converter.py:893` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–27 lines × 2) · ×1
  • Duplicated block (21–27 lines × 2) docling/models/inference_engines/image_classification/transformers_engine.py:143 — docling/models/inference_engines/image_classification/transformers_engine.py:143-163 | docling/models/inference_engines/object_detection/transformers_engine.py:167-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/inference_engines/image_classification/transformers_engine.py:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) docling/models/vlm_pipeline_models/hf_transformers_model.py:115 — docling/models/vlm_pipeline_models/hf_transformers_model.py:115-140 | docling/models/vlm_pipeline_models/mlx_model.py:71-96 | docling/models/vlm_pipeline_models/vllm_model.py:133-158 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) docling/models/stages/ocr/_nemotron_ocr_model.py:227 — docling/models/stages/ocr/_nemotron_ocr_model.py:227-252 | docling/models/stages/ocr/nemotron_ocr_model.py:258-283 — before extracting anything, compare `docling/models/stages/ocr/_nemotron_ocr_model.py` and `docling/models/stages/ocr/nemotron_ocr_model.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) docling/models/stages/table_structure/table_structure_model.py:292 — docling/models/stages/table_structure/table_structure_model.py:292-316 | docling/models/stages/table_structure/table_structure_model_v2.py:518-540 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/table_structure/table_structure_model.py:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) docling/service_client/_async_client.py:321 — docling/service_client/_async_client.py:321-345 | docling/service_client/client.py:1172-1196 — before extracting anything, compare `docling/service_client/_async_client.py` and `docling/service_client/client.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22–24 lines × 4) · ×1
  • Duplicated block (22–24 lines × 4) docling/models/extraction/nuextract_transformers_model.py:188 — docling/models/extraction/nuextract_transformers_model.py:188-211 | docling/models/extraction/transformers_extraction_model.py:142-163 | docling/models/vlm_pipeline_models/hf_transformers_model.py:264-287 | docling/models/vlm_pipeline_models/vllm_model.py:281-304 — before extracting anything, compare `docling/models/extraction/nuextract_transformers_model.py` and `docling/models/extraction/transformers_extraction_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–24 lines × 3) · ×1
  • Duplicated block (21–24 lines × 3) docling/models/vlm_pipeline_models/api_vlm_model.py:70 — docling/models/vlm_pipeline_models/api_vlm_model.py:70-90 | docling/models/vlm_pipeline_models/hf_transformers_model.py:216-239 | docling/models/vlm_pipeline_models/mlx_model.py:139-162 — before extracting anything, compare `docling/models/vlm_pipeline_models/api_vlm_model.py` and `docling/models/vlm_pipeline_models/mlx_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) docling/backend/latex/backend.py:382 — docling/backend/latex/backend.py:382-404 | docling/backend/latex/utils/text.py:258-281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `docling/backend/latex/backend.py:382` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `docling/backend/latex/backend.py:379` calls `isinstance` and `docling/backend/latex/utils/text.py:258` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) docling/pipeline/standard_pdf_pipeline.py:335 — docling/pipeline/standard_pdf_pipeline.py:335-358 | docling/pipeline/standard_pdf_pipeline.py:465-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) docling/backend/iwork_backend.py:694 — docling/backend/iwork_backend.py:694-716 | docling/backend/iwork_backend.py:1281-1301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) docling/models/inference_engines/vlm/vllm_engine.py:198 — docling/models/inference_engines/vlm/vllm_engine.py:198-220 | docling/models/vlm_pipeline_models/vllm_model.py:163-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) docling/models/stages/ocr/auto_ocr_model.py:124 — docling/models/stages/ocr/auto_ocr_model.py:124-146 | docling/models/stages/ocr/auto_ocr_model.py:178-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) docling/models/stages/code_formula/code_formula_vlm_model.py:103 — docling/models/stages/code_formula/code_formula_vlm_model.py:103-124 | docling/models/stages/picture_description/picture_description_vlm_engine_model.py:86-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (18–21 lines × 3) · ×1
  • Duplicated block (18–21 lines × 3) docling/models/inference_engines/image_classification/base.py:71 — docling/models/inference_engines/image_classification/base.py:71-88 | docling/models/inference_engines/object_detection/base.py:71-91 | docling/models/inference_engines/vlm/base.py:89-109 — `docling/models/inference_engines/image_classification/base.py` and `docling/models/inference_engines/object_detection/base.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) docling/backend/msword_backend.py:584 — docling/backend/msword_backend.py:584-602 | docling/backend/msword_backend.py:611-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:90 — docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:90-110 | docling/pipeline/standard_pdf_pipeline.py:652-671 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) docling/models/inference_engines/image_classification/onnxruntime_engine.py:61 — docling/models/inference_engines/image_classification/onnxruntime_engine.py:61-77 | docling/models/inference_engines/object_detection/onnxruntime_engine.py:71-91 — `docling/models/inference_engines/image_classification/onnxruntime_engine.py` and `docling/models/inference_engines/object_detection/onnxruntime_engine.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 58 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (14–20 lines × 5) · ×1
  • Duplicated block (14–20 lines × 5) docling/models/stages/ocr/auto_ocr_model.py:75 — docling/models/stages/ocr/auto_ocr_model.py:75-88 | docling/models/stages/ocr/auto_ocr_model.py:100-116 | docling/models/stages/ocr/auto_ocr_model.py:131-150 | docling/models/stages/ocr/auto_ocr_model.py:160-173 | docling/models/stages/ocr/auto_ocr_model.py:185-204 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/ocr/auto_ocr_model.py:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `docling/models/stages/ocr/auto_ocr_model.py:117` calls `except`, `warning`, `_Rejection` and `docling/models/stages/ocr/auto_ocr_model.py:175` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–20 lines × 4) · ×1
  • Duplicated block (17–20 lines × 4) docling/models/vlm_pipeline_models/api_vlm_model.py:82 — docling/models/vlm_pipeline_models/api_vlm_model.py:82-98 | docling/models/vlm_pipeline_models/hf_transformers_model.py:228-247 | docling/models/vlm_pipeline_models/mlx_model.py:151-170 | docling/models/vlm_pipeline_models/vllm_model.py:256-272 — before extracting anything, compare `docling/models/vlm_pipeline_models/api_vlm_model.py` and `docling/models/vlm_pipeline_models/mlx_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) docling/models/stages/ocr/easyocr_model.py:311 — docling/models/stages/ocr/easyocr_model.py:311-330 | docling/models/stages/ocr/ocr_mac_model.py:153-172 | docling/models/stages/ocr/rapid_ocr_model.py:752-771 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) docling/backend/opendocument_backend.py:1598 — docling/backend/opendocument_backend.py:1598-1616 | docling/backend/opendocument_backend.py:1715-1734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `docling/backend/opendocument_backend.py:1735` calls `_odf_cell_text` and `docling/backend/opendocument_backend.py:1617` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) docling/models/stages/table_structure/table_structure_model_v2.py:133 — docling/models/stages/table_structure/table_structure_model_v2.py:133-150 | docling/models/stages/table_structure/table_structure_model_v2.py:457-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/table_structure/table_structure_model_v2.py:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) REDACTED:432 — REDACTED:432-450 | REDACTED:777-795 | REDACTED:1351-1369 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) docling/models/vlm_pipeline_models/api_vlm_model.py:122 — docling/models/vlm_pipeline_models/api_vlm_model.py:122-136 | docling/models/vlm_pipeline_models/mlx_model.py:215-233 — before extracting anything, compare `docling/models/vlm_pipeline_models/api_vlm_model.py` and `docling/models/vlm_pipeline_models/mlx_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) REDACTED:524 — REDACTED:524-541 | REDACTED:872-889 | REDACTED:1447-1464 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) docling/utils/model_downloader.py:330 — docling/utils/model_downloader.py:330-344 | docling/utils/model_downloader.py:347-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) docling/backend/msexcel_backend.py:1392 — docling/backend/msexcel_backend.py:1392-1407 | docling/backend/opendocument_backend.py:2547-2557 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/backend/msexcel_backend.py:1392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) REDACTED:384 — REDACTED:384-398 | REDACTED:732-746 | REDACTED:1306-1320 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–15 lines × 3) · ×1
  • Duplicated block (12–15 lines × 3) docling/pipeline/asr_transcriber.py:328 — docling/pipeline/asr_transcriber.py:328-342 | docling/pipeline/asr_transcriber.py:743-755 | docling/pipeline/video_pipeline.py:158-169 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) docling/models/vlm_pipeline_models/mlx_model.py:194 — docling/models/vlm_pipeline_models/mlx_model.py:194-208 | docling/models/vlm_pipeline_models/vllm_model.py:300-312 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) docling/models/stages/table_structure/table_structure_model.py:121 — docling/models/stages/table_structure/table_structure_model.py:121-134 | docling/models/stages/table_structure/table_structure_model_v2.py:357-368 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (13 lines × 6) · ×1
  • Duplicated block (13 lines × 6) REDACTED:402 — REDACTED:402-414 | REDACTED:441-453 | REDACTED:750-762 | REDACTED:786-798 | REDACTED:1324-1336 | REDACTED:1360-1372 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) docling/models/extraction/transformers_extraction_model.py:159 — docling/models/extraction/transformers_extraction_model.py:159-170 | docling/models/stages/vlm_convert/vlm_convert_model.py:375-387 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `prompt` to `Union[str, list[str]]` in one and `str | list[str]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) docling/backend/msexcel_backend.py:1534 — docling/backend/msexcel_backend.py:1534-1545 | docling/backend/msexcel_backend.py:2045-2056 | docling/backend/mspowerpoint_backend.py:1156-1167 | docling/backend/mspowerpoint_backend.py:1813-1824 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) docling/models/extraction/nuextract_transformers_model.py:132 — docling/models/extraction/nuextract_transformers_model.py:132-140 | docling/models/extraction/transformers_extraction_model.py:60-71 — before extracting anything, compare `docling/models/extraction/nuextract_transformers_model.py` and `docling/models/extraction/transformers_extraction_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/extraction/nuextract_transformers_model.py:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) docling/service_client/_async_client.py:859 — docling/service_client/_async_client.py:859-869 | docling/service_client/_async_client.py:879-889 | docling/service_client/client.py:1428-1438 — before extracting anything, compare `docling/service_client/_async_client.py` and `docling/service_client/client.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/service_client/_async_client.py:859` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) docling/models/inference_engines/common/kserve_v2_grpc.py:376 — docling/models/inference_engines/common/kserve_v2_grpc.py:376-386 | docling/models/inference_engines/common/kserve_v2_http.py:115-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) docling/models/stages/ocr/easyocr_model.py:356 — docling/models/stages/ocr/easyocr_model.py:356-363 | docling/models/stages/ocr/rapid_ocr_model.py:803-813 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/stages/ocr/easyocr_model.py:356` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) docling/models/base_ocr_model.py:779 — docling/models/base_ocr_model.py:779-788 | docling/models/stages/page_preprocessing/page_preprocessing_model.py:151-160 | docling/models/stages/table_structure/table_structure_model.py:170-179 | docling/models/stages/table_structure/table_structure_model_v2.py:390-398 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) docling/backend/opendocument_backend.py:1775 — docling/backend/opendocument_backend.py:1775-1784 | docling/backend/opendocument_backend.py:2049-2058 | docling/backend/opendocument_backend.py:2332-2341 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) docling/models/vlm_pipeline_models/api_vlm_model.py:109 — docling/models/vlm_pipeline_models/api_vlm_model.py:109-116 | docling/models/vlm_pipeline_models/mlx_model.py:197-206 | docling/models/vlm_pipeline_models/vllm_model.py:303-310 — before extracting anything, compare `docling/models/vlm_pipeline_models/api_vlm_model.py` and `docling/models/vlm_pipeline_models/mlx_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) docling/backend/html_backend.py:2131 — docling/backend/html_backend.py:2131-2139 | docling/backend/xml/jats_backend.py:1128-1137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `docling/backend/html_backend.py:2131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) docling/models/extraction/nuextract_transformers_model.py:294 — docling/models/extraction/nuextract_transformers_model.py:294-304 | docling/models/extraction/transformers_extraction_model.py:219-227 | docling/models/vlm_pipeline_models/hf_transformers_model.py:430-439 — before extracting anything, compare `docling/models/extraction/nuextract_transformers_model.py` and `docling/models/extraction/transformers_extraction_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docling/models/extraction/nuextract_transformers_model.py:294` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–9 lines × 3) · ×1
  • Duplicated block (4–9 lines × 3) .github/scripts/ai_pr_review.py:602 — .github/scripts/ai_pr_review.py:602-610 | .github/scripts/ai_pr_triage.py:1115-1118 | .github/scripts/ai_pr_triage.py:1121-1129 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `.github/scripts/ai_pr_triage.py:1119` calls `add_argument`, `cwd` and `.github/scripts/ai_pr_review.py:600` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) docling/backend/html_backend.py:2049 — docling/backend/html_backend.py:2049-2055 | docling/backend/xml/jats_backend.py:1076-1084 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) REDACTED:470 — REDACTED:470-477 | REDACTED:808-815 | REDACTED:1389-1396 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:514 — docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:514-518 | docling/pipeline/native_pdf_pipeline.py:430-434 | docling/pipeline/standard_pdf_pipeline.py:1312-1316 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) docling/backend/msexcel_backend.py:1486 — docling/backend/msexcel_backend.py:1486-1504 | docling/backend/mspowerpoint_backend.py:1638-1654 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: docling-slim — docling-slim: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: _BaseDoclingServiceClient (LCOM4 11) docling/service_client/client.py:312 — _BaseDoclingServiceClient's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
P12 · CI test-gate honesty · Coverage collected but not gated · ×1
  • Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Minor — 120 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging docling/document_extractor.py:237 — `info` at line 237 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/document_extractor.py:308 — `info` at line 308 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/document_extractor.py:315 — `debug` at line 315 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/document_converter.py:916 — `info` at line 916 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/document_converter.py:937 — `info` at line 937 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/document_converter.py:944 — `debug` at line 944 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/pypdfium2_backend.py:390 — `info` at line 390 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/opendocument_backend.py:2353 — `debug` at line 2353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/opendocument_backend.py:2360 — `info` at line 2360 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/opendocument_backend.py:2611 — `debug` at line 2611 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/opendocument_backend.py:2613 — `debug` at line 2613 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/noop_backend.py:25 — `debug` at line 25 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/noop_backend.py:32 — `debug` at line 32 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/noop_backend.py:38 — `debug` at line 38 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/noop_backend.py:42 — `error` at line 42 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:1166 — `warning` at line 1166 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:1307 — `debug` at line 1307 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:1340 — `debug` at line 1340 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:1433 — `debug` at line 1433 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:1658 — `debug` at line 1658 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:1909 — `debug` at line 1909 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:3942 — `debug` at line 3942 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:4016 — `debug` at line 4016 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:4284 — `debug` at line 4284 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging docling/backend/msword_backend.py:4325 — `warning` at line 4325 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate docling/backend/html_backend.py:2155 — `(not col_header) and html_cell.name == "th"` appears character-identically in 2 files — docling/backend/html_backend.py, docling/backend/xml/jats_backend.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/stages/ocr/_nemotron_ocr_model.py:218 — `cuda_version is None or not cuda_version.startswith("13.")` appears character-identically in 2 files — docling/models/stages/ocr/_nemotron_ocr_model.py, docling/models/stages/ocr/nemotron_ocr_model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/postprocessing/reading_order_rb.py:174 — `deadline is not None and time.monotonic() > deadline` appears character-identically in 2 files — docling/models/postprocessing/reading_order_rb.py, docling/models/stages/reading_order/readingorder_model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/inference_engines/image_classification/base.py:85 — `engine_type is None and field.default is not PydanticUndefined` appears character-identically in 3 files — docling/models/inference_engines/image_classification/base.py, docling/models/inference_engines/object_detection/base.py, docling/models/inference_engines/vlm/base.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/inference_engines/image_classification/onnxruntime_engine.py:83 — `extra_filename and isinstance(extra_filename, str)` appears character-identically in 2 files — docling/models/inference_engines/image_classification/onnxruntime_engine.py, docling/models/inference_engines/object_detection/onnxruntime_engine.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/document_converter.py:925 — `fopt is None or fopt.pipeline_options is None` appears character-identically in 2 files — docling/document_converter.py, docling/document_extractor.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/inference_engines/vlm/_utils.py:122 — `image.ndim == 3 and image.shape[2] in [3, 4]` appears character-identically in 3 files — docling/models/inference_engines/vlm/_utils.py, docling/models/vlm_pipeline_models/api_vlm_model.py, docling/models/vlm_pipeline_models/mlx_model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/extraction/nuextract_transformers_model.py:194 — `img.ndim == 3 and img.shape[2] in (3, 4)` appears character-identically in 4 files — docling/models/extraction/nuextract_transformers_model.py, docling/models/extraction/transformers_extraction_model.py, docling/models/vlm_pipeline_models/hf_transformers_model.py, docling/models/vlm_pipeline_models/vllm_model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:286 — `int_attr(model, SF_ATTR_HEADER_ROWS) or 0` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/inference_engines/vlm/transformers_engine.py:241 — `is_dots_model and parsed_transformers_version.major >= 5` appears character-identically in 2 files — docling/models/inference_engines/vlm/transformers_engine.py, docling/models/vlm_pipeline_models/hf_transformers_model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/vlm_pipeline_models/api_vlm_model.py:147 — `isinstance(criteria, type) and issubclass( criteria, GenerationStopper )` appears character-identically in 2 files — docling/models/vlm_pipeline_models/api_vlm_model.py, docling/models/vlm_pipeline_models/mlx_model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/inference_engines/vlm/_utils.py:172 — `isinstance(criteria, type) and issubclass(criteria, GenerationStopper)` appears character-identically in 2 files — docling/models/inference_engines/vlm/_utils.py, docling/models/inference_engines/vlm/transformers_engine.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/extraction/nuextract_transformers_model.py:68 — `isinstance(example.get("input"), dict) and example["input"].get("type") == "image"` appears character-identically in 2 files — docling/models/extraction/nuextract_transformers_model.py, docling/models/extraction/prompt_utils.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/extraction/nuextract_transformers_model.py:81 — `isinstance(examples[0], list) or examples[0] is None` appears character-identically in 2 files — docling/models/extraction/nuextract_transformers_model.py, docling/models/extraction/prompt_utils.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/backend/latex/backend.py:196 — `isinstance(node, LatexEnvironmentNode) and node.envname == "document"` appears character-identically in 3 files — docling/backend/latex/backend.py, docling/backend/latex/handlers/environments.py, docling/backend/latex/handlers/metadata.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/experimental/pipeline/threaded_layout_vlm_pipeline.py:358 — `itm.error or RuntimeError("unknown error")` appears character-identically in 2 files — docling/experimental/pipeline/threaded_layout_vlm_pipeline.py, docling/pipeline/standard_pdf_pipeline.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/inference_engines/vlm/vllm_engine.py:208 — `k not in self._VLLM_ENGINE_KEYS and k not in self._VLLM_SAMPLING_KEYS` appears character-identically in 2 files — docling/models/inference_engines/vlm/vllm_engine.py, docling/models/vlm_pipeline_models/vllm_model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/backend/msexcel_backend.py:1876 — `labels or [PictureClassificationLabel.OTHER_CHART]` appears character-identically in 2 files — docling/backend/msexcel_backend.py, docling/backend/mspowerpoint_backend.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/extraction/nuextract_transformers_model.py:76 — `messages and isinstance(messages[0], list)` appears character-identically in 2 files — docling/models/extraction/nuextract_transformers_model.py, docling/models/extraction/prompt_utils.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/service_client/_async_client.py:1074 — `mimetypes.guess_type(filename)[0] or "application/octet-stream"` appears character-identically in 2 files — docling/service_client/_async_client.py, docling/service_client/client.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/backend/latex/handlers/macros.py:500 — `node.macroname in MACROS_SPACING or node.macroname in MACROS_IGNORED` appears character-identically in 2 files — docling/backend/latex/handlers/macros.py, docling/backend/latex/utils/text.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/backend/latex/handlers/macros.py:327 — `node.nodeargd and node.nodeargd.argnlist` appears character-identically in 2 files — docling/backend/latex/handlers/macros.py, docling/backend/latex/utils/text.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/backend/latex/handlers/macros.py:787 — `node.nodeargd is None or not node.nodeargd.argnlist` appears character-identically in 2 files — docling/backend/latex/handlers/macros.py, docling/backend/latex/handlers/metadata.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/backend/latex/handlers/macros.py:529 — `node.nodeargd is not None and node.nodeargd.argnlist` appears character-identically in 2 files — docling/backend/latex/handlers/macros.py, docling/backend/latex/handlers/metadata.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docling/models/extraction/nuextract_transformers_model.py:91 — `not is_batch and len(examples_batch) == 1` appears character-identically in 2 files — docling/models/extraction/nuextract_transformers_model.py, docling/models/extraction/prompt_utils.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
M4 · Documentation accuracy · README/code drift · ×22
  • README/code drift .actor/README.md:119 — .actor/README.md documents the environment variable `DOCLING_LOG`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/integrations/apify.md:19 — docs/integrations/apify.md documents the environment variable `OUTPUT_RESULT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/integrations/apify.md:20 — docs/integrations/apify.md documents the environment variable `DOCLING_LOG`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/mcp.md:38 — docs/usage/mcp.md documents the environment variable `DOCLING_CONVERSION_MODE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/processing_audio_media.md:470 — docs/usage/processing_audio_media.md documents the environment variable `TURBOCTC_NC`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:12 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_KIND`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:30 — docs/usage/api_server/deployment.md documents the environment variable `UVICORN_HOST`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:30 — docs/usage/api_server/deployment.md documents the environment variable `UVICORN_PORT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:31 — docs/usage/api_server/deployment.md documents the environment variable `UVICORN_WORKERS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:32 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_API_KEY`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:33 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENABLE_UI`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:34 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ARTIFACTS_PATH`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:35 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_MAX_NUM_PAGES`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:35 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_MAX_FILE_SIZE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:36 — docs/usage/api_server/deployment.md documents the setting `kfp`, but no code or configuration file names `kfp`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:49 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_PERF_ELEMENTS_BATCH_SIZE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:50 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_DEBUG_PROFILE_PIPELINE_TIMINGS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:58 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_LOC_NUM_WORKERS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:58 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_LOC_SHARE_MODELS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/deployment.md:118 — docs/usage/api_server/deployment.md documents the environment variable `DOCLING_SERVE_ENG_RQ_REDIS_URL`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/index.md:23 — docs/usage/api_server/index.md documents the environment variable `DOCLING_SERVE_API_KEY`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/usage/api_server/rest_api.md:24 — docs/usage/api_server/rest_api.md documents the environment variable `DOCLING_SERVE_API_KEY`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×7
  • Silent fallback default on parse failure REDACTED:666 — `as_int` returns `0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure docling/backend/latex/handlers/macros.py:869 — `_parse_custom_macro_num_args` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure docling/backend/opendocument_backend.py:407 — `_odf_span` returns `1` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure docling/backend/opendocument_backend.py:940 — `_odf_list_start_value` returns `1` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure docling/utils/text_decoding.py:63 — `_utf8_sequence_length` returns `0` when `UnicodeDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure docling/utils/video_frame_sampling.py:325 — `probe_duration` returns `0.0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure docs/examples/legacy/vlm_pipeline_api_model_legacy.py:128 — `decode_response` (in `lms_olmocr_vlm_options`) returns `''` when `json.decoder.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×5
  • Hand-rolled JSON/XML parsing via regex docling/backend/epub_backend.py:449 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex docling/datamodel/document.py:1160 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex docling/utils/paddleocr_vl_utils.py:140 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex docling/utils/otsl.py:29 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex docling/utils/deepseekocr_utils.py:43 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 6 significant file(s) lose their only recent owner: docling/backend/iwork/archives.py, docling/backend/iwork/keynote_iwa.py, docling/backend/iwork/content.py, docling/backend/iwork/iwa.py, docling/backend/iwork/pages_iwa.py, REDACTED. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: docling/service_client/watchers.py, docling/models/postprocessing/list_marker_processor.py, docling/service_client/exceptions.py. Pair on, review, or document these before any departure.
D19 · Documentation Quality · Documentation · ×2
  • Documentation: no project overview README.md — The root README begins with a two-image banner and a link badge but does not state what the repository is for, its main value proposition, or which directories are deployed tiers. Add an overview paragraph explaining what Docling is (the project name, purpose) and where each directory lives.
  • Documentation: no licence statement README.md — The root README has no licence statement in the documentation; only a link to the root's 'Getting started' section. Add a License badge and a short line stating the open-source license used by Docling.
D34 · Knowledge Freshness · Orphaned file · ×2
  • Orphaned file docling/utils/speaker_diarization.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file docling/models/extraction/prompt_utils.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×2
  • Diagnostic log message is built whether or not it is wanted docling/pipeline/standard_pdf_pipeline.py:1293 — `debug` at line 1293 is called with an argument built by `sorted(missing_page_nos)` (line 1296), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted REDACTED:358 — `debug` at line 358 is called with an argument built by `json.dumps(payload, indent = 2)` (line 359), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (11 single-owned of 214 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 214 of the 306 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: perfs/xlsx_merged_cells.py, docling/models/factories/base_factory.py.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (91349 LoC, 958 module-visible types across 54 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 2 of 214 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 214 of the 306 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: docling/utils/speaker_diarization.py, docling/models/extraction/prompt_utils.py. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 85471 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch docling/backend/mets_gbs_backend.py:236 — `_extract_confidence` swallows every exception into `return 1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-ca5e0c10e78f423487f0eb36ed7d7c2d/history.json --exit-code 0 --source .2artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-ca5e0c10e78f423487f0eb36ed7d7c2d/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .21artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .7artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .8artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a170ab-44d8-73e1-9871-0a9b1dc7aa81 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md