Public report of hikopensource/DAVAR-Lab-OCR, published 17 November 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.11.4). Assert 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, 17 November 2026, 13:27 UTC · Survey ID cd_2f3a9abacd5146289178966309be9dee

hikopensource/DAVAR-Lab-OCR

Measured 17 November 2026, 13:26 UTC, at code version bcd145a

First survey, so nothing to compare with yet Bus factor: not measured

Bus factor is not measured: One contributor carries this repository.

CAI score 48.4out of 100 At risk

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: 48,798 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Maturity, 35.5

Findings by how serious they are

3 critical 444 serious 235 minor

17 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look 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

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 13:26 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 the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer 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. We work 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 ▸

37of 37 dimensions measured by tools.
676of 682 findings point to an exact file and line, so you can open each one in the code. The other 6 concern the repository as a whole, such as missing documentation.
37dimensions across 5 lenses, read from 48,798 lines of product code in 2 projects.
Chapters

Executive summary

hikopensource/DAVAR-Lab-OCR is rated At risk because critical security findings are open, most of them in the packages it uses. Its score is held back because 169 files are no longer known to anyone active in the project and we found no recorded design decisions and no architecture document or diagram. It scores 48.4 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Maturity, at 35.5, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 7.3 points. Adding an automated build and test pipeline comes next, worth about 6.3 points. Raising Maturity to 62 would lift the score to about 56.9.

Two known security holes in the packages the code depends on can be used by attackers. One place in the code runs text as code, which an attacker could use. Updating the vulnerable packages and replacing text run as code with direct calls would close both risks.

The product code is 48,798 lines, about €49,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.
Maturity 35.5 · counts for 47%Production Readiness 42.6 · counts for 26%Code Health 66.1 · counts for 14%Architecture 89.4 · counts for 8%Security and Compliance 92.0 · counts for 4%

If Maturity rose from 35.5 to 62, the lowest score rated Strong, the score would rise from 48.4 to about 56.9.

Code composition: what the lines of code are
Product code 92%Tests 8%
Rebuild cost: about €49,000 · Estimate
Cost to rebuild€16,000 to €81,000, for 269 to 852 hours of work, about 0.3 person-years for one engineer
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.7 at a score of 48. 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: 48,798 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price 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
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.
Raises the score by about 7.3 points · Medium effort · Architecture documentation
2
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 6.3 points · Medium effort · CI/CD gates
3
Run what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Raises the score by about 6.3 points · Medium effort · Security & performance tooling

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 €49,000 to build again, about 0.3 person-years of work. Its weakest lens is Maturity, at 35.5 (Weak). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity actions in Top priorities.
If you do one thing first · First action
Record your significant design decisions. Of all the actions in this report, it raises the score most for the work it takes: about 7.3 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 5.1 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 16% on every change. The history of the code shows how much it changes: about 14 lines over the last 90 days, which is about 57 lines a year. At that pace, the extra work comes to an estimated 0 to 0.1 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 our 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, never less than 2% to 5% and never more than 40% to 60% in all; 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: 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.

217 modules, with 58 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 177 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 davar_common.datasets.davar_custom2 davar_common.datasets.pipelines.davar_formating3 davar_common.datasets.pipelines.davar_loading4 davar_common.datasets.pipelines.transforms5 davar_det.core.post_processing.post_detector_base6 davar_det.datasets.pipelines.seg_det_formating7 davar_det.models.detectors.mask_rcnn_det8 davar_det.models.detectors.seg_based_det9 davar_det.models.seg_heads.east_head10 davar_distill.models.distillation.base11 davar_ie.models.connects.multimodal_feature_merge12 davar_layout.datasets.pipelines.mm_layout_formating13 davar_ner.core.converters.transformers_converter14 davar_nlp_common.models.decoders.base_decoder15 davar_rcg.models.recognizors.base16 davar_spotting.core.post_processing.post_spotter_base17 davar_spotting.models.spotters.base.base18 davar_det.core.post_processing.post_east19 davar_det.core.post_processing.post_mask_rcnn20 davar_det.core.post_processing.post_tp_det21 davar_det.datasets.text_det_dataset22 davar_det.models.detectors.east23 davar_det.models.detectors.text_perceptron_det24 davar_distill.models.distillation.spot_res_distill25 davar_ie.datasets.pipelines.chargrid_data26 davar_ie.datasets.wildreceipt_dataset27 davar_ie.models.infor_extrators.chargrid.chargrid_layout28 davar_ie.models.infor_extrators.chargrid.chargrid_net_ie29 davar_ie.models.infor_extrators.chargrid.chargrid_textdet30 davar_layout.datasets.mm_layout_dataset31 davar_layout.datasets.pipelines.mm_layout_loading32 davar_rcg.models.recognizors.general33 davar_spotting.models.spotters.base.seg_based_e2e34 davar_spotting.models.spotters.base.two_stage_e2e35 davar_videotext.datasets.pipelines.formating36 davar_ie.models.infor_extrators.trie.trie37 davar_layout.datasets.docbank_dataset38 davar_spotting.models.spotters.mask_rcnn_spot39 davar_distill.models.spotters.kd_two_stage_ete40 davar_ie.models.infor_extrators.trie.trie_gt
1 davar_common.datasets.davar_custom
2 davar_common.datasets.pipelines.davar_formating
3 davar_common.datasets.pipelines.davar_loading
4 davar_common.datasets.pipelines.transforms
5 davar_det.core.post_processing.post_detector_base
6 davar_det.datasets.pipelines.seg_det_formating
7 davar_det.models.detectors.mask_rcnn_det
8 davar_det.models.detectors.seg_based_det
9 davar_det.models.seg_heads.east_head
10 davar_distill.models.distillation.base
11 davar_ie.models.connects.multimodal_feature_merge
12 davar_layout.datasets.pipelines.mm_layout_formating
13 davar_ner.core.converters.transformers_converter
14 davar_nlp_common.models.decoders.base_decoder
15 davar_rcg.models.recognizors.base
16 davar_spotting.core.post_processing.post_spotter_base
17 davar_spotting.models.spotters.base.base
18 davar_det.core.post_processing.post_east1
19 davar_det.core.post_processing.post_mask_rcnn1
20 davar_det.core.post_processing.post_tp_det1
21 davar_det.datasets.text_det_dataset1
22 davar_det.models.detectors.east1
23 davar_det.models.detectors.text_perceptron_det1
24 davar_distill.models.distillation.spot_res_distill1
25 davar_ie.datasets.pipelines.chargrid_data1
26 davar_ie.datasets.wildreceipt_dataset1
27 davar_ie.models.infor_extrators.chargrid.chargrid_layout1
28 davar_ie.models.infor_extrators.chargrid.chargrid_net_ie1
29 davar_ie.models.infor_extrators.chargrid.chargrid_textdet1
30 davar_layout.datasets.mm_layout_dataset1
31 davar_layout.datasets.pipelines.mm_layout_loading1
32 davar_rcg.models.recognizors.general1
33 davar_spotting.models.spotters.base.seg_based_e2e1
34 davar_spotting.models.spotters.base.two_stage_e2e1
35 davar_videotext.datasets.pipelines.formating11
36 davar_ie.models.infor_extrators.trie.trie1
37 davar_layout.datasets.docbank_dataset1
38 davar_spotting.models.spotters.mask_rcnn_spot1
39 davar_distill.models.spotters.kd_two_stage_ete1
40 davar_ie.models.infor_extrators.trie.trie_gt1
Uses a module listed above itPart of a loopThe module itself
1 davar_common.datasets.davar_custom2 davar_common.datasets.pipelines.davar_formating3 davar_common.datasets.pipelines.davar_loading4 davar_common.datasets.pipelines.transforms5 davar_det.core.post_processing.post_detector_base6 davar_det.datasets.pipelines.seg_det_formating7 davar_det.models.detectors.mask_rcnn_det8 davar_det.models.detectors.seg_based_det9 davar_det.models.seg_heads.east_head10 davar_distill.models.distillation.base11 davar_ie.models.connects.multimodal_feature_merge12 davar_layout.datasets.pipelines.mm_layout_formating13 davar_ner.core.converters.transformers_converter14 davar_nlp_common.models.decoders.base_decoder15 davar_rcg.models.recognizors.base16 davar_spotting.core.post_processing.post_spotter_base17 davar_spotting.models.spotters.base.base18 davar_det.core.post_processing.post_east19 davar_det.core.post_processing.post_mask_rcnn20 davar_det.core.post_processing.post_tp_det21 davar_det.datasets.text_det_dataset22 davar_det.models.detectors.east23 davar_det.models.detectors.text_perceptron_det24 davar_distill.models.distillation.spot_res_distill25 davar_ie.datasets.pipelines.chargrid_data26 davar_ie.datasets.wildreceipt_dataset27 davar_ie.models.infor_extrators.chargrid.chargrid_layout28 davar_ie.models.infor_extrators.chargrid.chargrid_net_ie29 davar_ie.models.infor_extrators.chargrid.chargrid_textdet30 davar_layout.datasets.mm_layout_dataset31 davar_layout.datasets.pipelines.mm_layout_loading32 davar_rcg.models.recognizors.general33 davar_spotting.models.spotters.base.seg_based_e2e34 davar_spotting.models.spotters.base.two_stage_e2e35 davar_videotext.datasets.pipelines.formating36 davar_ie.models.infor_extrators.trie.trie37 davar_layout.datasets.docbank_dataset38 davar_spotting.models.spotters.mask_rcnn_spot39 davar_distill.models.spotters.kd_two_stage_ete40 davar_ie.models.infor_extrators.trie.trie_gtdavar_common.datasets.davar_custom1davar_common.datasets.pipelines.davar_formating2davar_common.datasets.pipelines.davar_loading3davar_common.datasets.pipelines.transforms4davar_det.core.post_processing.post_detector_base5davar_det.datasets.pipelines.seg_det_formating6davar_det.models.detectors.mask_rcnn_det7davar_det.models.detectors.seg_based_det8davar_det.models.seg_heads.east_head9davar_distill.models.distillation.base10davar_ie.models.connects.multimodal_feature_merge11davar_layout.datasets.pipelines.mm_layout_formating12davar_ner.core.converters.transformers_converter13davar_nlp_common.models.decoders.base_decoder14davar_rcg.models.recognizors.base15davar_spotting.core.post_processing.post_spotter_base16davar_spotting.models.spotters.base.base17davar_det.core.post_processing.post_east18davar_det.core.post_processing.post_mask_rcnn19davar_det.core.post_processing.post_tp_det20davar_det.datasets.text_det_dataset21davar_det.models.detectors.east22davar_det.models.detectors.text_perceptron_det23davar_distill.models.distillation.spot_res_distill24davar_ie.datasets.pipelines.chargrid_data25davar_ie.datasets.wildreceipt_dataset26davar_ie.models.infor_extrators.chargrid.chargrid_layout27davar_ie.models.infor_extrators.chargrid.chargrid_net_ie28davar_ie.models.infor_extrators.chargrid.chargrid_textdet29davar_layout.datasets.mm_layout_dataset30davar_layout.datasets.pipelines.mm_layout_loading31davar_rcg.models.recognizors.general32davar_spotting.models.spotters.base.seg_based_e2e33davar_spotting.models.spotters.base.two_stage_e2e34davar_videotext.datasets.pipelines.formating35davar_ie.models.infor_extrators.trie.trie36davar_layout.datasets.docbank_dataset37davar_spotting.models.spotters.mask_rcnn_spot38davar_distill.models.spotters.kd_two_stage_ete39davar_ie.models.infor_extrators.trie.trie_gt40111111111111111111111111+177 more modules (most-connected shown)

At a glance — Code Health · 66.1 · Adequate · gated by D2, D4 ·

At a glance — Architecture · 89.4 · Adequate · gated by D26 ·

At a glance — Maturity · 35.5 · Weak · gated by D34, M2, M4 ·

At a glance — Readiness · 42.6 · Adequate · gated by P1, P3 ·

At a glance — Security · 92.0 · Checked 2 of 5 ·

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
A03:2025 — Software Supply Chain Failures2High / Critical
A05:2025 — Injection1High / Critical

Roadmap

Top priorities: Resolve the 169 Orphaned file finding(s) in Knowledge Freshness — start with base.py (3), crf.py (2), test.py (2); 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; Add a CI workflow that builds and runs the test suite on every push/PR.

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

Do thisHelpsEffortDimension
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.+7.3 ptsMediumArchitecture documentation
Add a CI workflow that builds and runs the test suite on every push/PR.+6.3 ptsMediumCI/CD gates
Run what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.+6.3 ptsMediumSecurity & performance tooling
Resolve the 169 Orphaned file finding(s) in Knowledge Freshness — start with base.py (3), crf.py (2), test.py (2).+12.1 ptsHighKnowledge Freshness
Reconcile the README with reality: demo/ner/BERT/readme.md links to `./configs/bert_softmax.py`, but `demo/ner/BERT/configs/bert_softmax.py` does not exist; demo/ner/BERT/readme.md links to `./configs/bert_span.py`, but `demo/ner/BERT/configs/bert_span.py` does not exist; demo/ner/BERT/readme.md links to `./configs/bert_crf.py`, but `demo/ner/BERT/configs/bert_crf.py` does not exist; demo/ner/bilstm_crf/readme.md links to `./configs/bilstm_crf.py`, but `demo/ner/bilstm_crf/configs/bilstm_crf.py` does not exist; demo/text_detection/east/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist.+5.6 ptsMediumDocumentation accuracy
Swallowed exception (caught, then discarded)+2.3 ptsMediumException handling
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED.+0.6 ptsLowProject Cohesion
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with davar_loading.py, transforms.py, loading_utils.py.+0.4 ptsLowKnowledge Freshness

File quality

Per-file score 0–10 — a quality signature. Of 118 files carrying findings, judged against the Preview bar: 0% slop · 9% mixed · 91% near-clean.

FileScoreBandWorst signal
davarocr/davar_rcg/models/sequence_heads/att_head.py5.6MixedCode Duplication: Near-duplicate member pair (26 shared lines)
REDACTED5.8MixedDependency Vulnerabilities: Critical CVE: REDACTED
davarocr/davar_rcg/models/sequence_heads/ace_head.py5.9MixedCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)
davarocr/davar_layout/models/heads/cascade_roi_head_w_gcn.py6.0MixedExplicit Debt: TodoComment
davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py6.0MixedExplicit Debt: TodoComment
davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py6.0MixedExplicit Debt: TodoComment
davarocr/davar_distill/models/distillation/base.py6.0MixedExplicit Debt: TodoComment
davarocr/davar_table/models/roi_heads/mask_heads/lpma_mask_head.py6.0MixedExplicit Debt: TodoComment
davarocr/davar_layout/models/heads/gcn_head.py6.3MixedCognitive Complexity: GCNHead.forward (cognitive 17)
davarocr/davar_spotting/models/roi_extractors/mask_roi_extractor.py6.7MixedExplicit Debt: TodoComment
REDACTED6.7MixedStatic Analysis (SAST): High: REDACTED
davarocr/davar_det/core/evaluation/hmean.py7.0Near-cleanCyclomatic Complexity: hmean.evaluate_method (cyclomatic 30)
davarocr/davar_common/datasets/pipelines/davar_loading.py7.0Near-cleanCyclomatic Complexity: DavarLoadAnnotations._load_labels (cyclomatic 25)
davarocr/davar_common/datasets/pipelines/transforms.py7.0Near-cleanCyclomatic Complexity: RandomRotate._rotate_img (cyclomatic 20)
davarocr/davar_ie/models/infor_extrators/trie/trie.py7.0Near-cleanCognitive Complexity: TRIE.simple_test (cognitive 19)
davarocr/davar_rcg/models/recognizors/general.py7.0Near-cleanCode Duplication: Edited copy of a member (61 corresponding lines)
demo/text_detection/evaluation/rrc_evaluation_funcs.py7.0Near-cleanCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)
davarocr/davar_rcg/datasets/davar_rcg_dataset.py7.0Near-cleanCyclomatic Complexity: DavarRCGDataset._filter_file_to_list (cyclomatic 34)
davarocr/davar_table/core/bbox/bbox_process.py7.0Near-cleanCyclomatic Complexity: bbox_process.recon_noncell (cyclomatic 25)
davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py7.0Near-cleanCognitive Complexity: loading_utils.wordmap_loader (cognitive 20)

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 — 3

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 — 444

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 — 235

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

Could not be resolved — 17

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

This survey 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. All 37 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.

Every figure here is one of two 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. 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.

What we checked — 37 dimensions across the health lenses
D1D2D3D4D5D6D13D15D17D19D26D28D29D30D34D35D43AX10AX3AX4AX6M1M2M3M4P1P10P3P6X12X24X25X27X28X3X30X4

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, 676 of 682 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 or a scanner, 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
Canine Code Analyzer 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1e9b0-0182-700e-93d9-5e81ce3f0078.

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 — We 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 MEASURED: the Python half could not be measured — the pytest suite ran no test, so nothing was measured (its dependency install failed (pip exit 1: no error line printed), so its suite was not run against dependencies it does not declare). Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We 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 (2 distributions), but it was not re-run: its dependency install failed (pip exit 1: no error line printed), so its suite was not run against dependencies it does not declare. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — We 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 repository's dependency manifest (a Python pyproject.toml/REDACTED (pip/uv/Poetry)) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
  • D14 License Compliance — not measured this run — We 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. Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Python pyproject.toml/REDACTED (pip/uv/Poetry)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D21 Naming Consistency — not measured this run — We 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We 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. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D24 Comment Value — not measured this run — We 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's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D44 Platform End-of-Life — not measured this run — We 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • C1 Data Protection — not measured this run — We 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 — We 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, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Python, cpp 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 — We 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, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Python, cpp 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.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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 — We 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 — We 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, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust 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 — We 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, PHP, Rust and Elixir source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP, Rust or Elixir 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 — We 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 (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala, Kotlin and PHP 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.
  • X5 Nullable reference types — not measured this run — We 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, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Cpp, 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 (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do 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.
  • 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").
  • 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.
  • 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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • 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 REDACTED, 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.
  • 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.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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.

Dimensions

D1 · Cyclomatic Complexity6.8 / 10Adequate✓ 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 6.8 / 10 · rule-coverage 100% · ceiling Prevented

24 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was NERLoader._load at 50.

NERLoader._load (cyclomatic 50)davarocr/davar_ner/datasets/loaders/ner_loader.py:69
generate_html.area_to_html (cyclomatic 40)davarocr/davar_table/core/post_processing/generate_html.py:16
DavarRCGDataset._filter_file_to_list (cyclomatic 34)davarocr/davar_rcg/datasets/davar_rcg_dataset.py:367
davar_loading_json.rcg_json_dataload (cyclomatic 34)davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:24
hmean.evaluate_method (cyclomatic 30)davarocr/davar_det/core/evaluation/hmean.py:15

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

What to do

  1. Bring the 24 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with NERLoader._load (cyclomatic 50), generate_html.area_to_html (cyclomatic 40), DavarRCGDataset._filter_file_to_list (cyclomatic 34). — 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 24 together lifts Cyclomatic Complexity from 6.8 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

82 method(s) exceeded the cognitive complexity threshold of 15; the worst was NERLoader._load at 212.

NERLoader._load (cognitive 212)davarocr/davar_ner/datasets/loaders/ner_loader.py:69
DavarRCGDataset._filter_file_to_list (cognitive 114)davarocr/davar_rcg/datasets/davar_rcg_dataset.py:367
generate_html.area_to_html (cognitive 84)davarocr/davar_table/core/post_processing/generate_html.py:16
TableRcgDataset.evaluate (cognitive 75)davarocr/davar_table/datasets/table_rcg_dataset.py:57
hmean.evaluate_method (cognitive 73)davarocr/davar_det/core/evaluation/hmean.py:15

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

What to do

  1. Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with NERLoader._load (cognitive 212), DavarRCGDataset._filter_file_to_list (cognitive 114), generate_html.area_to_html (cognitive 84). — 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 8 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.

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

D3 · God Classes10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 god class(es) detected.

✓ On the Gold path — maintain.

Detailed fixes: d3_recommendation.md.

D4 · Code Duplication2.2 / 10Critical✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

226 duplicated block group(s) detected. 19.6 % of the production lines (9,563 of 48,798) are in a reported copy. A further 91 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 42 of the 317 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (5 lines × 2) · ×10davarocr/davar_det/models/neck/east_merge.py:62
Duplicated block (18 lines × 2) · ×6davarocr/davar_common/datasets/pipelines/davar_formating.py:84
Duplicated block (13 lines × 2) · ×6davarocr/davar_det/core/evaluation/hmean.py:301
Duplicated block (7 lines × 2) · ×6davarocr/davar_ie/models/embedding/text_embedding.py:144
Duplicated block (6 lines × 2) · ×6davarocr/davar_common/datasets/sampler/davar_sampler.py:189

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

What to do

  1. Resolve the 10 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with bbox_process.py (2), east_merge.py, multimodal_context_module.py. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 6 Duplicated block (18 lines × 2) finding(s) in Code Duplication — start with davar_formating.py, base.py, trie_gt.py. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 6 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with ctunet.py (2), hmean.py, yoro_recommender_head.py. — One of this dimension's main actionable groups (6 warning-level).

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

D5 · Coupling10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 production modules (Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (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).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.6 / 10Stronggated by 4 serious findings✓ 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.6 / 10 · rule-coverage 100% · ceiling Verified

4 of 110 classes have LCOM4 above 3.

Low cohesion: GCNHead (LCOM4 4) · ×4davarocr/davar_layout/models/heads/gcn_head.py:25

What to do

  1. Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with gcn_head.py, ace_head.py, att_head.py. — One of this dimension's main actionable groups (4 warning-level).

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.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.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt10.0 / 10Stronggated by 10 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

10 deducted task-comment markers across 48798 LoC (0.0/KLoC) → score 10.0. 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 · ×10davarocr/davar_table/models/roi_heads/mask_heads/lpma_mask_head.py:25

What to do

  1. Resolve the 10 TodoComment finding(s) in Explicit Debt — start with base.py (3), lpma_mask_head.py (2), two_stage_e2e.py. — One of this dimension's main actionable groups (10 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

1 of 1 documentation facets pass in full. 36 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_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.

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

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

Projects may be oversized for their cohesionREDACTED:1

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED. — 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)8.4 / 10Adequategated by 1 critical finding✓ 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 8.4 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D30 · Dependency Vulnerabilities8.1 / 10Adequategated by 2 critical findings✓ 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

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

REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

Orphaned file · ×169davarocr/davar_rcg/datasets/davar_rcg_dataset.py:1
Most significant orphaned file · ×3davarocr/davar_common/datasets/pipelines/davar_loading.py:1
Dormant codebase

What to do

  1. Resolve the 169 Orphaned file finding(s) in Knowledge Freshness — start with base.py (3), crf.py (2), test.py (2). — One of this dimension's main actionable groups (169 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with davar_loading.py, transforms.py, loading_utils.py. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Dormant codebase finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.6 / 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.

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.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

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

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

M2 · Architecture documentation0.0 / 10Critical✓ 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.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

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.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy2.0 / 10Weak✓ Tool-verified

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

  • demo/ner/BERT/readme.md links to `./configs/bert_softmax.py`, but `demo/ner/BERT/configs/bert_softmax.py` does not exist. 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. — demo/ner/BERT/readme.md:32
  • demo/ner/BERT/readme.md links to `./configs/bert_span.py`, but `demo/ner/BERT/configs/bert_span.py` does not exist. 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. — demo/ner/BERT/readme.md:33
  • demo/ner/BERT/readme.md links to `./configs/bert_crf.py`, but `demo/ner/BERT/configs/bert_crf.py` does not exist. 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. — demo/ner/BERT/readme.md:34
  • demo/ner/bilstm_crf/readme.md links to `./configs/bilstm_crf.py`, but `demo/ner/bilstm_crf/configs/bilstm_crf.py` does not exist. 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. — demo/ner/bilstm_crf/readme.md:30
  • demo/text_detection/east/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist. 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. — demo/text_detection/east/readme.md:33
  • demo/text_detection/mask_rcnn_det/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist. 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. — demo/text_detection/mask_rcnn_det/readme.md:33
  • demo/text_detection/text_perceptron_det/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist. 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. — demo/text_detection/text_perceptron_det/readme.md:36
  • demo/text_spotting/dld/readme.md links to `../evalution/`, but `demo/text_spotting/evalution` does not exist. 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. — demo/text_spotting/dld/readme.md:40
  • demo/text_spotting/mango/readme.md links to `../evalution/`, but `demo/text_spotting/evalution` does not exist. 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. — demo/text_spotting/mango/readme.md:43
  • demo/text_spotting/mask_rcnn_spot/readme.md links to `../evalution/`, but `demo/text_spotting/evalution` does not exist. 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. — demo/text_spotting/mask_rcnn_spot/readme.md:41
  • demo/videotext/yoro/readme.md links to `demo/text_detection/evaluation/`, but `demo/videotext/yoro/demo/text_detection/evaluation` does not exist. 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. — demo/videotext/yoro/readme.md:126
  • demo/videotext/yoro/readme.md links to `demo/videotext/evaluation/`, but `demo/videotext/yoro/demo/videotext/evaluation` does not exist. 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. — demo/videotext/yoro/readme.md:129
  • demo/videotext/yoro/readme.md links to `config/yoro_east.py`, but `demo/videotext/yoro/config/yoro_east.py` does not exist. 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. — demo/videotext/yoro/readme.md:144
  • demo/videotext/yoro/readme.md links to `demo/videotext/yoro/rcg/config/ic15_qscore_rgb_res32_bilstm_attn.py`, but `demo/videotext/yoro/demo/videotext/yoro/rcg/config/ic15_qscore_rgb_res32_bilstm_attn.py` does not exist. 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. — demo/videotext/yoro/readme.md:153

What to do

  • Reconcile the README with reality: demo/ner/BERT/readme.md links to `./configs/bert_softmax.py`, but `demo/ner/BERT/configs/bert_softmax.py` does not exist; demo/ner/BERT/readme.md links to `./configs/bert_span.py`, but `demo/ner/BERT/configs/bert_span.py` does not exist; demo/ner/BERT/readme.md links to `./configs/bert_crf.py`, but `demo/ner/BERT/configs/bert_crf.py` does not exist; demo/ner/bilstm_crf/readme.md links to `./configs/bilstm_crf.py`, but `demo/ner/bilstm_crf/configs/bilstm_crf.py` does not exist; demo/text_detection/east/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist.
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified

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.

  • No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.

What to do

  • Add a CI workflow that builds and runs the test suite on every push/PR.
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's code 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.

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 — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.
  • `requirements/build.txt` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — requirements/build.txt:2

What to do

  • Run what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add 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.
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.

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.

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.

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 handling4.3 / 10Weak✓ 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` 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. (×2) — davarocr/davar_table/core/post_processing/post_lgpma.py:179, davarocr/davar_table/core/post_processing/post_lgpma.py:203
  • `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. (×3) — davarocr/davar_det/core/evaluation/hmean.py:93, davarocr/davar_det/core/evaluation/hmean.py:116, davarocr/davar_det/core/evaluation/hmean.py:164

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 logging10.0 / 10Exemplary○ Nothing flagged

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.

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 Health66.1Adequate — gated by D2, D4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture89.4Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity35.5Weak — gated by D34, M2, M4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness42.6Adequate — gated by P1, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security92.0Checked 2 of 5Strongest area.
Unscored — 2 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.

  • X10 Duplicated predicate — 35 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 — 2 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.

  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 76 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.
  • 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
  • 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
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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 — ~4041 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
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Package manifest not parsed for licence data — analyzer language-coverage gap
  • D16 Bus Factor — bus factor 1 — one contributor carries this repository
  • 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.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 6 candidate(s) found and not reported.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (davarocr), 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 — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • 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.
  • D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • 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 measured — Python suite
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit))
  • 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, Scala, Rust and Java, 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
  • P12 CI test-gate honesty — no CI workflow found
  • P2 Observability — This repository's Python source (1 module(s), 343 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
  • 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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 scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • 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.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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 — 3 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
Serious — 444 finding(s)
D17 · Explicit Debt · TodoComment · ×10
  • TodoComment davarocr/davar_table/models/roi_heads/mask_heads/lpma_mask_head.py:25 — # TODO: This memory limit may be too much or too little. It would be better 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 davarocr/davar_table/models/roi_heads/mask_heads/lpma_mask_head.py:187 — # TODO: Remove after F.grid_sample 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 davarocr/davar_spotting/models/spotters/base/base.py:56 — # TODO: remove the restriction of imgs_per_gpu == 1 when prepared — 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 davarocr/davar_rcg/models/recognizors/base.py:121 — # TODO: remove the restriction of imgs_per_gpu == 1 when prepared — 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 davarocr/davar_distill/models/distillation/base.py:87 — # TODO: remove the restriction of imgs_per_gpu == 1 when prepared — 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 davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:75 — # TODO: refactor assigner & sampler — 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 davarocr/davar_spotting/models/roi_extractors/mask_roi_extractor.py:66 — # TODO: remove this when parrots supports — 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 davarocr/davar_rcg/datasets/pipelines/rcg_extra_aug.py:33 — # TODO: All of the Augmentation operations will be in the coming DavarOCR version — 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 davarocr/davar_layout/models/heads/cascade_roi_head_w_gcn.py:143 — # TODO: Support empty tensor input. #2280
  • TodoComment davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:87 — # TODO: a more flexible way to decide which feature maps to use — 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×10
  • Duplicated block (5 lines × 2) davarocr/davar_det/models/neck/east_merge.py:62 — davarocr/davar_det/models/neck/east_merge.py:62-66 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:128-132 — 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 (5 lines × 2) davarocr/davar_ie/models/connects/multimodal_context_module.py:175 — davarocr/davar_ie/models/connects/multimodal_context_module.py:175-179 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:221-225 — before extracting anything, compare `davarocr/davar_ie/models/connects/multimodal_context_module.py` and `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 `davarocr/davar_ie/models/connects/multimodal_context_module.py:175` 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 (5 lines × 2) davarocr/davar_rcg/models/sequence_heads/att_head.py:178 — davarocr/davar_rcg/models/sequence_heads/att_head.py:178-182 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:208-214 — 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 (5 lines × 2) davarocr/davar_table/core/bbox/bbox_process.py:236 — davarocr/davar_table/core/bbox/bbox_process.py:236-240 | davarocr/davar_table/core/bbox/bbox_process.py:243-247 — 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 (5 lines × 2) davarocr/davar_det/models/losses/east_iou_loss.py:79 — davarocr/davar_det/models/losses/east_iou_loss.py:79-83 | davarocr/davar_det/models/losses/east_iou_loss.py:88-92 — 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 (5 lines × 2) davarocr/davar_rcg/core/converters/ctc_converter.py:154 — davarocr/davar_rcg/core/converters/ctc_converter.py:154-158 | davarocr/davar_rcg/core/converters/ctc_converter.py:172-176 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_rcg/core/converters/ctc_converter.py:159` calls `join` and `davarocr/davar_rcg/core/converters/ctc_converter.py:177` 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.
  • Duplicated block (5 lines × 2) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:290 — davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:290-294 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:455-459 — 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 (5 lines × 2) davarocr/davar_table/core/bbox/bbox_process.py:35 — davarocr/davar_table/core/bbox/bbox_process.py:35-39 | davarocr/davar_table/core/bbox/bbox_process.py:141-145 — 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 (5 lines × 2) davarocr/davar_table/models/understanding_detectors/ctunet.py:302 — davarocr/davar_table/models/understanding_detectors/ctunet.py:302-306 | davarocr/davar_table/models/understanding_detectors/ctunet.py:447-451 — 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 (5 lines × 2) demo/text_spotting/evaluation/script.py:109 — demo/text_spotting/evaluation/script.py:109-113 | demo/videotext/evaluation/evaluate_utils.py:45-49 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×6
  • Duplicated block (18 lines × 2) davarocr/davar_common/datasets/pipelines/davar_formating.py:84 — davarocr/davar_common/datasets/pipelines/davar_formating.py:84-101 | davarocr/davar_table/datasets/pipelines/ctunet_formating.py:31-48 — 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 `davarocr/davar_common/datasets/pipelines/davar_formating.py:84` 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. 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) davarocr/davar_distill/models/distillation/base.py:77 — davarocr/davar_distill/models/distillation/base.py:77-94 | davarocr/davar_spotting/models/spotters/base/base.py:46-63 — 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 (18 lines × 2) davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:77 — davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:77-94 | davarocr/davar_table/models/understanding_detectors/ctunet.py:69-86 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py` and `davarocr/davar_table/models/understanding_detectors/ctunet.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 140 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:77` 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) davarocr/davar_common/datasets/pipelines/davar_loading.py:333 — davarocr/davar_common/datasets/pipelines/davar_loading.py:333-350 | davarocr/davar_common/datasets/pipelines/davar_loading.py:492-509 — 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) demo/videotext/evaluation/evaluate_ata.py:109 — demo/videotext/evaluation/evaluate_ata.py:109-126 | demo/videotext/evaluation/evaluate_mot.py:146-163 — 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 (18 lines × 2) demo/text_detection/evaluation/script.py:110 — demo/text_detection/evaluation/script.py:110-127 | demo/text_spotting/evaluation/script.py:127-144 — before extracting anything, compare `demo/text_detection/evaluation/script.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×6
  • Duplicated block (13 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:301 — davarocr/davar_det/core/evaluation/hmean.py:301-313 | demo/text_spotting/evaluation/script.py:435-447 — 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 (13 lines × 2) davarocr/davar_table/models/understanding_detectors/ctunet.py:285 — davarocr/davar_table/models/understanding_detectors/ctunet.py:285-297 | davarocr/davar_table/models/understanding_detectors/ctunet.py:338-350 — 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 (13 lines × 2) davarocr/davar_table/models/understanding_detectors/ctunet.py:309 — davarocr/davar_table/models/understanding_detectors/ctunet.py:309-321 | davarocr/davar_table/models/understanding_detectors/ctunet.py:358-370 — 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 (13 lines × 2) davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:371 — davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:371-383 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:411-423 — 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 (13 lines × 2) davarocr/davar_table/core/bbox/bbox_process.py:68 — davarocr/davar_table/core/bbox/bbox_process.py:68-80 | davarocr/davar_table/core/bbox/bbox_process.py:108-120 — 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 (13 lines × 2) davarocr/davar_common/models/heads/cls_head.py:25 — davarocr/davar_common/models/heads/cls_head.py:25-37 | davarocr/davar_ie/models/heads/ner_head.py:26-38 — 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) · ×6
  • Duplicated block (7 lines × 2) davarocr/davar_ie/models/embedding/text_embedding.py:144 — davarocr/davar_ie/models/embedding/text_embedding.py:144-150 | davarocr/davar_ie/models/embedding/text_embedding.py:154-160 — 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 `davarocr/davar_ie/models/embedding/text_embedding.py:144` 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 (7 lines × 2) davarocr/davar_ner/models/ner_models/base_ner.py:29 — davarocr/davar_ner/models/ner_models/base_ner.py:29-35 | davarocr/davar_ner/models/ner_models/base_ner.py:58-64 — 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 (7 lines × 2) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:120 — davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:120-126 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:191-197 — 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 (7 lines × 2) davarocr/davar_ie/models/losses/crf.py:56 — davarocr/davar_ie/models/losses/crf.py:56-62 | davarocr/davar_ner/models/decoders/layers/crf.py:52-58 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:262 — davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:262-268 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:425-431 — 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 (7 lines × 2) davarocr/davar_spotting/models/seg_heads/grid_category_head.py:266 — davarocr/davar_spotting/models/seg_heads/grid_category_head.py:266-272 | davarocr/davar_spotting/utils/util_poly.py:145-151 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/grid_category_head.py` and `davarocr/davar_spotting/utils/util_poly.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (6 lines × 2) · ×6
  • Duplicated block (6 lines × 2) davarocr/davar_common/datasets/sampler/davar_sampler.py:189 — davarocr/davar_common/datasets/sampler/davar_sampler.py:189-194 | davarocr/davar_common/datasets/sampler/davar_sampler.py:313-320 — 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 `davarocr/davar_common/datasets/sampler/davar_sampler.py:313` 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 (6 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:272 — davarocr/davar_det/core/evaluation/hmean.py:272-277 | demo/text_detection/evaluation/script.py:358-363 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `demo/text_detection/evaluation/script.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) davarocr/davar_ie/models/connects/multimodal_context_module.py:165 — davarocr/davar_ie/models/connects/multimodal_context_module.py:165-170 | davarocr/davar_ie/models/infor_extrators/chargrid/chargrid_net_ie.py:61-66 — 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 (6 lines × 2) davarocr/davar_ie/models/embedding/text_embedding.py:154 — davarocr/davar_ie/models/embedding/text_embedding.py:154-159 | davarocr/davar_ie/models/embedding/text_embedding.py:164-169 — 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 `davarocr/davar_ie/models/embedding/text_embedding.py:154` 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 (6 lines × 2) davarocr/davar_ie/models/backbones/chargrid_backbone.py:130 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:130-135 | davarocr/davar_ie/models/necks/chargrid_neck.py:121-126 — 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 (6 lines × 2) davarocr/davar_spotting/models/seg_heads/grid_category_head.py:224 — davarocr/davar_spotting/models/seg_heads/grid_category_head.py:224-229 | davarocr/davar_spotting/utils/util_poly.py:98-103 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/grid_category_head.py` and `davarocr/davar_spotting/utils/util_poly.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×5
  • Edited copy of a member (21 corresponding lines) davarocr/davar_table/core/post_processing/generate_html.py:162 — davarocr/davar_table/core/post_processing/generate_html.py:162-182 | davarocr/davar_table/utils/format.py:9-41 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) davarocr/davar_common/datasets/pipelines/transforms.py:503 — davarocr/davar_common/datasets/pipelines/transforms.py:503-523 | davarocr/davar_videotext/datasets/pipelines/transforms.py:145-180 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) davarocr/davar_rcg/models/connects/stack_block.py:51 — davarocr/davar_rcg/models/connects/stack_block.py:51-71 | davarocr/davar_rcg/models/connects/stack_block.py:134-157 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) davarocr/davar_common/datasets/pipelines/davar_loading.py:243 — davarocr/davar_common/datasets/pipelines/davar_loading.py:243-263 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:113-133 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) davarocr/davar_spotting/models/seg_heads/centerline_seg_head.py:202 — davarocr/davar_spotting/models/seg_heads/centerline_seg_head.py:202-222 | davarocr/davar_spotting/models/seg_heads/grid_category_head.py:392-412 — These two members are one piece of code written twice and then edited apart: 21 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 · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) davarocr/davar_common/datasets/pipelines/transforms.py:503 — davarocr/davar_common/datasets/pipelines/transforms.py:503-521 | davarocr/davar_videotext/datasets/pipelines/transforms.py:145-163 — 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 (19 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:140 — davarocr/davar_det/core/evaluation/hmean.py:140-158 | demo/text_detection/evaluation/script.py:178-196 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `demo/text_detection/evaluation/script.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. 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 (19 lines × 2) davarocr/davar_ie/datasets/wildreceipt_dataset.py:51 — davarocr/davar_ie/datasets/wildreceipt_dataset.py:51-71 | davarocr/davar_table/datasets/ctunet_dataset.py:67-85 — 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 `davarocr/davar_ie/datasets/wildreceipt_dataset.py:51` 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 (19 lines × 2) davarocr/davar_table/models/roi_heads/mask_heads/lpma_mask_head.py:206 — davarocr/davar_table/models/roi_heads/mask_heads/lpma_mask_head.py:206-224 | davarocr/davar_table/models/roi_heads/mask_heads/lpma_mask_head.py:228-246 — 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) davarocr/davar_rcg/models/losses/ctc_loss.py:53 — davarocr/davar_rcg/models/losses/ctc_loss.py:53-71 | davarocr/davar_rcg/models/losses/warpctc_loss.py:45-66 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) davarocr/davar_common/core/evaluation/davar_eval_hook.py:112 — davarocr/davar_common/core/evaluation/davar_eval_hook.py:112-122 | davarocr/davar_common/core/evaluation/davar_eval_hook.py:353-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.
  • Duplicated block (11 lines × 2) davarocr/davar_rcg/core/converters/bert_converter.py:87 — davarocr/davar_rcg/core/converters/bert_converter.py:87-97 | davarocr/davar_rcg/core/converters/ctc_converter.py:86-96 — 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 `davarocr/davar_rcg/core/converters/bert_converter.py:87` 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 lines × 2) davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:70 — davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:70-80 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:69-79 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py` and `davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:68` calls `ModuleList` and `davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:67` 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 (11 lines × 2) davarocr/davar_spotting/models/seg_heads/grid_category_head.py:230 — davarocr/davar_spotting/models/seg_heads/grid_category_head.py:230-240 | davarocr/davar_spotting/utils/util_poly.py:106-116 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/grid_category_head.py` and `davarocr/davar_spotting/utils/util_poly.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (11 lines × 2) demo/text_detection/evaluation/script.py:304 — demo/text_detection/evaluation/script.py:304-314 | demo/text_spotting/evaluation/script.py:340-350 — before extracting anything, compare `demo/text_detection/evaluation/script.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) davarocr/davar_common/datasets/pipelines/davar_formating.py:94 — davarocr/davar_common/datasets/pipelines/davar_formating.py:94-101 | davarocr/davar_distill/dataset/pipelines/distill_formating.py:44-51 | davarocr/davar_table/datasets/pipelines/ctunet_formating.py:41-48 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_common/datasets/pipelines/davar_formating.py:94` 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 (8 lines × 3) davarocr/davar_det/datasets/text_det_dataset.py:83 — davarocr/davar_det/datasets/text_det_dataset.py:83-90 | davarocr/davar_spotting/datasets/text_spot_dataset.py:93-100 | davarocr/davar_table/datasets/table_rcg_dataset.py:114-121 — before extracting anything, compare `davarocr/davar_det/datasets/text_det_dataset.py` and `davarocr/davar_spotting/datasets/text_spot_dataset.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) davarocr/davar_ie/models/backbones/chargrid_backbone.py:63 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:63-70 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:80-87 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:97-104 — 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 `davarocr/davar_ie/models/backbones/chargrid_backbone.py:63` 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 (8 lines × 3) davarocr/davar_ner/datasets/loaders/ner_loader.py:131 — davarocr/davar_ner/datasets/loaders/ner_loader.py:131-139 | davarocr/davar_ner/datasets/loaders/ner_loader.py:167-174 | davarocr/davar_ner/datasets/loaders/ner_loader.py:210-217 — 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.
  • Duplicated block (8 lines × 3) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:305 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:305-312 | demo/text_detection/evaluation/script.py:363-370 | demo/text_spotting/evaluation/script.py:400-407 — 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 (8 lines × 2) · ×5
  • Duplicated block (8 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:323 — davarocr/davar_det/core/evaluation/hmean.py:323-330 | demo/text_spotting/evaluation/script.py:485-492 — 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 (8 lines × 2) davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:213 — davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:213-220 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:223-230 — 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) davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:221 — davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:221-228 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:180-187 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py` and `davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 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 (8 lines × 2) davarocr/davar_table/core/post_processing/generate_html.py:88 — davarocr/davar_table/core/post_processing/generate_html.py:88-95 | davarocr/davar_table/core/post_processing/generate_html.py:113-120 — 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 (8 lines × 2) davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:190 — davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:190-197 | davarocr/davar_layout/models/heads/gcn_head.py:195-202 — 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 `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:190` 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×5
  • Swallowed exception (caught, then discarded) davarocr/davar_table/core/post_processing/post_lgpma.py:179 — `except` 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) davarocr/davar_table/core/post_processing/post_lgpma.py:203 — `except` 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) davarocr/davar_det/core/evaluation/hmean.py:93 — `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) davarocr/davar_det/core/evaluation/hmean.py:116 — `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) davarocr/davar_det/core/evaluation/hmean.py:164 — `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.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×4
  • Edited copy of a member (32 corresponding lines) davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:116 — davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:116-147 | davarocr/davar_table/models/roi_heads/lgpma_roi_head.py:94-140 — These two members are one piece of code written twice and then edited apart: 32 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.
  • Edited copy of a member (32 corresponding lines) davarocr/davar_layout/datasets/mm_layout_dataset.py:138 — davarocr/davar_layout/datasets/mm_layout_dataset.py:138-169 | davarocr/davar_layout/datasets/publaynet_dataset.py:167-203 — These two members are one piece of code written twice and then edited apart: 32 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.
  • Edited copy of a member (32 corresponding lines) davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:277 — davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:277-308 | davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:347-382 — These two members are one piece of code written twice and then edited apart: 32 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.
  • Edited copy of a member (32 corresponding lines) demo/text_detection/evaluation/rrc_evaluation_funcs.py:190 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:190-221 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:285-316 — These two members are one piece of code written twice and then edited apart: 32 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 · Edited copy of a member (18 corresponding lines) · ×4
  • Edited copy of a member (18 corresponding lines) davarocr/davar_distill/models/distillation/base.py:68 — davarocr/davar_distill/models/distillation/base.py:68-94 | davarocr/davar_spotting/models/spotters/base/base.py:46-63 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) davarocr/davar_rcg/models/recognizors/general.py:129 — davarocr/davar_rcg/models/recognizors/general.py:129-146 | davarocr/davar_rcg/models/recognizors/rf_learning.py:145-169 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) davarocr/davar_rcg/core/converters/att_converter.py:136 — davarocr/davar_rcg/core/converters/att_converter.py:136-153 | davarocr/davar_rcg/core/converters/bert_converter.py:135-152 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) demo/text_detection/evaluation/script.py:65 — demo/text_detection/evaluation/script.py:65-83 | demo/text_spotting/evaluation/script.py:62-79 — These two members are one piece of code written twice and then edited apart: 18 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 · Edited copy of a member (13 corresponding lines) · ×4
  • Edited copy of a member (13 corresponding lines) davarocr/davar_layout/datasets/publaynet_dataset.py:226 — davarocr/davar_layout/datasets/publaynet_dataset.py:226-238 | davarocr/davar_layout/datasets/publaynet_dataset.py:241-255 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) davarocr/davar_layout/models/heads/cascade_roi_head_w_gcn.py:60 — davarocr/davar_layout/models/heads/cascade_roi_head_w_gcn.py:60-72 | davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:100-112 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) demo/videotext/evaluation/evaluate_utils.py:14 — demo/videotext/evaluation/evaluate_utils.py:14-27 | davarocr/davar_videotext/tools/filter.py:26-38 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:463 — davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:463-479 | davarocr/davar_spotting/utils/util_poly.py:28-40 — These two members are one piece of code written twice and then edited apart: 13 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 · Duplicated block (26 lines × 2) · ×4
  • Duplicated block (26 lines × 2) davarocr/davar_common/datasets/pipelines/davar_loading.py:675 — davarocr/davar_common/datasets/pipelines/davar_loading.py:675-700 | davarocr/davar_common/datasets/pipelines/davar_loading.py:703-728 — 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 (26 lines × 2) davarocr/davar_ie/models/losses/crf.py:185 — davarocr/davar_ie/models/losses/crf.py:185-210 | davarocr/davar_ner/models/decoders/layers/crf.py:181-206 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (26 lines × 2) davarocr/davar_det/models/seg_heads/east_head.py:100 — davarocr/davar_det/models/seg_heads/east_head.py:100-125 | davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:205-230 — before extracting anything, compare `davarocr/davar_det/models/seg_heads/east_head.py` and `davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) demo/text_detection/evaluation/rrc_evaluation_funcs.py:224 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:224-249 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:319-344 — before extracting anything, compare `demo/text_detection/evaluation/rrc_evaluation_funcs.py` and `demo/text_spotting/evaluation/rrc_evaluation_funcs.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (22 lines × 2) · ×4
  • Duplicated block (22 lines × 2) davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:40 — davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:40-61 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:40-61 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py` and `davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 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 (22 lines × 2) davarocr/davar_table/core/bbox/bbox_process.py:43 — davarocr/davar_table/core/bbox/bbox_process.py:43-64 | davarocr/davar_table/core/bbox/bbox_process.py:83-104 — 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 (22 lines × 2) davarocr/davar_ie/models/losses/crf.py:156 — davarocr/davar_ie/models/losses/crf.py:156-177 | davarocr/davar_ner/models/decoders/layers/crf.py:152-173 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (22 lines × 2) davarocr/davar_common/datasets/pipelines/transforms.py:38 — davarocr/davar_common/datasets/pipelines/transforms.py:38-59 | davarocr/davar_videotext/datasets/pipelines/transforms.py:37-58 — 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. 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 (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) davarocr/davar_rcg/models/connects/stack_block.py:51 — davarocr/davar_rcg/models/connects/stack_block.py:51-67 | davarocr/davar_rcg/models/connects/stack_block.py:134-150 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_rcg/models/connects/stack_block.py:152` calls `constant_` and `davarocr/davar_rcg/models/connects/stack_block.py:68` 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.
  • Duplicated block (17 lines × 2) davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:171 — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:171-187 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:197-213 — before extracting anything, compare `davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 151 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:167` calls `init_weights` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:194` 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 (17 lines × 2) demo/text_detection/evaluation/rrc_evaluation_funcs.py:252 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:252-268 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:348-364 — before extracting anything, compare `demo/text_detection/evaluation/rrc_evaluation_funcs.py` and `demo/text_spotting/evaluation/rrc_evaluation_funcs.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) demo/text_detection/evaluation/script.py:344 — demo/text_detection/evaluation/script.py:344-360 | demo/text_spotting/evaluation/script.py:385-401 — before extracting anything, compare `demo/text_detection/evaluation/script.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. 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 (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) davarocr/davar_common/datasets/pipelines/davar_loading.py:747 — davarocr/davar_common/datasets/pipelines/davar_loading.py:747-761 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:416-430 — before extracting anything, compare `davarocr/davar_common/datasets/pipelines/davar_loading.py` and `davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (15 lines × 2) davarocr/davar_spotting/models/seg_heads/grid_category_head.py:108 — davarocr/davar_spotting/models/seg_heads/grid_category_head.py:108-123 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:138-152 — 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 (15 lines × 2) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:264 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:264-278 | demo/text_spotting/evaluation/script.py:348-362 — before extracting anything, compare `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) demo/text_detection/evaluation/rrc_evaluation_funcs.py:312 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:312-326 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:408-422 — before extracting anything, compare `demo/text_detection/evaluation/rrc_evaluation_funcs.py` and `demo/text_spotting/evaluation/rrc_evaluation_funcs.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×4
  • Duplicated block (14 lines × 2) davarocr/davar_layout/models/embedding/bertgrid_embedding.py:63 — davarocr/davar_layout/models/embedding/bertgrid_embedding.py:63-79 | davarocr/davar_layout/models/embedding/chargrid_embedding.py:57-70 — 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 (14 lines × 2) davarocr/davar_rcg/models/recognizors/general.py:168 — davarocr/davar_rcg/models/recognizors/general.py:168-181 | davarocr/davar_rcg/models/recognizors/general.py:239-252 — 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) davarocr/davar_common/models/heads/cls_head.py:72 — davarocr/davar_common/models/heads/cls_head.py:72-85 | davarocr/davar_table/models/cls_heads/table_cls_head.py:93-106 — before extracting anything, compare `davarocr/davar_common/models/heads/cls_head.py` and `davarocr/davar_table/models/cls_heads/table_cls_head.py` as WHOLE FILES: 84% 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 2 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (14 lines × 2) davarocr/davar_rcg/models/sequence_heads/ace_head.py:130 — davarocr/davar_rcg/models/sequence_heads/ace_head.py:130-143 | davarocr/davar_rcg/models/sequence_heads/att_head.py:222-236 — 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 (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) davarocr/davar_common/datasets/pipelines/davar_loading.py:851 — davarocr/davar_common/datasets/pipelines/davar_loading.py:851-860 | davarocr/davar_table/datasets/pipelines/ctunet_loading.py:128-137 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:297-306 — before extracting anything, compare `davarocr/davar_common/datasets/pipelines/davar_loading.py` and `davarocr/davar_table/datasets/pipelines/davar_loading_table.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_table/datasets/pipelines/davar_loading_table.py:295` calls `_load_enlarge_bboxes` and `davarocr/davar_common/datasets/pipelines/davar_loading.py:850` 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 (10 lines × 3) davarocr/davar_det/models/seg_heads/east_head.py:87 — davarocr/davar_det/models/seg_heads/east_head.py:87-96 | davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:108-117 | davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:191-200 — before extracting anything, compare `davarocr/davar_det/models/seg_heads/east_head.py` and `davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) davarocr/davar_ie/models/infor_extrators/trie/trie.py:328 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:328-337 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:363-373 | davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py:77-87 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) demo/text_spotting/mango/tools/show_masks.py:34 — demo/text_spotting/mango/tools/show_masks.py:34-43 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:34-43 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:34-43 — before extracting anything, compare `demo/text_spotting/mango/tools/show_masks.py` and `demo/text_spotting/mask_rcnn_spot/tools/show_masks.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×4
  • Duplicated block (10 lines × 2) davarocr/davar_ie/models/losses/crf.py:44 — davarocr/davar_ie/models/losses/crf.py:44-53 | davarocr/davar_ner/models/decoders/layers/crf.py:40-49 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) davarocr/davar_layout/datasets/publaynet_dataset.py:245 — davarocr/davar_layout/datasets/publaynet_dataset.py:245-254 | davarocr/davar_layout/datasets/publaynet_dataset.py:264-273 — 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 (10 lines × 2) davarocr/davar_rcg/models/recognizors/general.py:87 — davarocr/davar_rcg/models/recognizors/general.py:87-96 | davarocr/davar_rcg/models/recognizors/rf_learning.py:82-91 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_rcg/models/recognizors/rf_learning.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 94 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 (10 lines × 2) demo/text_detection/evaluation/rrc_evaluation_funcs.py:76 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:76-85 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:76-85 — before extracting anything, compare `demo/text_detection/evaluation/rrc_evaluation_funcs.py` and `demo/text_spotting/evaluation/rrc_evaluation_funcs.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 lines × 2) · ×4
  • Duplicated block (9 lines × 2) davarocr/davar_rcg/models/sequence_heads/att_head.py:147 — davarocr/davar_rcg/models/sequence_heads/att_head.py:147-155 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:164-172 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:174` calls `FloatTensor` and `davarocr/davar_rcg/models/sequence_heads/att_head.py:156` 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 (9 lines × 2) davarocr/davar_spotting/models/seg_heads/grid_category_head.py:213 — davarocr/davar_spotting/models/seg_heads/grid_category_head.py:213-221 | davarocr/davar_spotting/utils/util_poly.py:87-95 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/grid_category_head.py` and `davarocr/davar_spotting/utils/util_poly.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. 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 (9 lines × 2) davarocr/davar_table/datasets/ctunet_dataset.py:199 — davarocr/davar_table/datasets/ctunet_dataset.py:199-207 | davarocr/davar_table/datasets/ctunet_dataset.py:218-226 — 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) demo/text_detection/evaluation/rrc_evaluation_funcs.py:213 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:213-221 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:308-316 — before extracting anything, compare `demo/text_detection/evaluation/rrc_evaluation_funcs.py` and `demo/text_spotting/evaluation/rrc_evaluation_funcs.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D6 · Cohesion (LCOM4) · Low cohesion · ×4
  • Low cohesion: GCNHead (LCOM4 4) davarocr/davar_layout/models/heads/gcn_head.py:25 — GCNHead's methods fall into 4 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 4 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.
  • Low cohesion: ACEHead (LCOM4 4) davarocr/davar_rcg/models/sequence_heads/ace_head.py:25 — ACEHead's methods fall into 4 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 4 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.
  • Low cohesion: AttentionHead (LCOM4 4) davarocr/davar_rcg/models/sequence_heads/att_head.py:28 — AttentionHead's methods fall into 4 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 4 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.
  • Low cohesion: CNTHead (LCOM4 4) davarocr/davar_rcg/models/sequence_heads/counting_head.py:26 — CNTHead's methods fall into 4 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 4 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) davarocr/davar_rcg/core/converters/att_converter.py:30 — davarocr/davar_rcg/core/converters/att_converter.py:30-96 | davarocr/davar_rcg/core/converters/bert_converter.py:27-97 | davarocr/davar_rcg/core/converters/ctc_converter.py:32-96 | davarocr/davar_rcg/core/converters/rfl_converter.py:30-93 — 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) davarocr/davar_rcg/models/sequence_heads/ace_head.py:60 — davarocr/davar_rcg/models/sequence_heads/ace_head.py:60-77 | davarocr/davar_rcg/models/sequence_heads/att_head.py:76-93 | davarocr/davar_rcg/models/sequence_heads/counting_head.py:64-81 | davarocr/davar_rcg/models/sequence_heads/warpctc_head.py:69-86 — 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) demo/text_detection/evaluation/rrc_evaluation_funcs.py:19 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:19-42 | demo/text_detection/evaluation/rrc_evaluation_funcs.py:46-73 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:18-41 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:45-72 — 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 · Edited copy of a member (46 corresponding lines) · ×3
  • Edited copy of a member (46 corresponding lines) davarocr/davar_common/datasets/pipelines/transforms.py:173 — davarocr/davar_common/datasets/pipelines/transforms.py:173-218 | davarocr/davar_common/datasets/pipelines/transforms.py:221-266 — These two members are one piece of code written twice and then edited apart: 46 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.
  • Edited copy of a member (46 corresponding lines) davarocr/davar_ie/models/infor_extrators/trie/trie.py:48 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:48-93 | davarocr/davar_table/models/understanding_detectors/ctunet.py:46-96 — These two members are one piece of code written twice and then edited apart: 46 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.
  • Edited copy of a member (46 corresponding lines) davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:210 — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:210-285 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:240-337 — These two members are one piece of code written twice and then edited apart: 46 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 · Edited copy of a member (10 corresponding lines) · ×3
  • Edited copy of a member (10 corresponding lines) davarocr/davar_ner/models/decoders/crf_decoder.py:25 — davarocr/davar_ner/models/decoders/crf_decoder.py:25-34 | davarocr/davar_ner/models/decoders/fc_decoder.py:29-39 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) davarocr/davar_ie/models/heads/chargrid_reg.py:19 — davarocr/davar_ie/models/heads/chargrid_reg.py:19-28 | davarocr/davar_layout/models/heads/convfc_bbox_head_w_gcn.py:126-135 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) davarocr/davar_ie/models/embedding/embedding.py:25 — davarocr/davar_ie/models/embedding/embedding.py:25-34 | davarocr/davar_layout/models/embedding/chargrid_embedding.py:28-39 — These two members are one piece of code written twice and then edited apart: 10 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 · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) davarocr/davar_common/datasets/davar_custom.py:155 — davarocr/davar_common/datasets/davar_custom.py:155-177 | davarocr/davar_videotext/datasets/multi_frame_dataset.py:157-179 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_videotext/datasets/multi_frame_dataset.py:180` calls `get` and `davarocr/davar_common/datasets/davar_custom.py:178` 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.
  • Duplicated block (23 lines × 2) davarocr/davar_table/core/evaluation/tree_f1_score.py:159 — davarocr/davar_table/core/evaluation/tree_f1_score.py:159-181 | davarocr/davar_table/core/evaluation/tree_f1_score.py:185-207 — 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 `davarocr/davar_table/core/evaluation/tree_f1_score.py:159` 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. 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 (23 lines × 2) davarocr/davar_det/models/seg_heads/east_head.py:130 — davarocr/davar_det/models/seg_heads/east_head.py:130-152 | davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:256-278 — before extracting anything, compare `davarocr/davar_det/models/seg_heads/east_head.py` and `davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (19–20 lines × 2) · ×3
  • Duplicated block (19–20 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:278 — davarocr/davar_det/core/evaluation/hmean.py:278-296 | demo/text_detection/evaluation/script.py:366-385 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `demo/text_detection/evaluation/script.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19–20 lines × 2) davarocr/davar_det/datasets/text_det_dataset.py:91 — davarocr/davar_det/datasets/text_det_dataset.py:91-110 | davarocr/davar_spotting/datasets/text_spot_dataset.py:112-130 — before extracting anything, compare `davarocr/davar_det/datasets/text_det_dataset.py` and `davarocr/davar_spotting/datasets/text_spot_dataset.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19–20 lines × 2) davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:292 — davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:292-310 | davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py:106-125 — before extracting anything, compare `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py` and `davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) davarocr/davar_ie/models/connects/multimodal_context_module.py:51 — davarocr/davar_ie/models/connects/multimodal_context_module.py:51-63 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:63-75 | davarocr/davar_layout/models/heads/gcn_head.py:66-78 — before extracting anything, compare `davarocr/davar_ie/models/connects/multimodal_context_module.py` and `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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. Note first that the copies are not typed on the same thing: `BertConfig` names `.util` in one and `davarocr.davar_ie.models` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:60` calls `get` and `davarocr/davar_layout/models/heads/gcn_head.py:65` 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 × 3) davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:296 — davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:296-308 | davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:365-377 | davarocr/davar_rcg/datasets/pipelines/davar_loading_lmdb.py:273-285 — 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.
  • Duplicated block (13 lines × 3) demo/text_spotting/mango/tools/show_masks.py:78 — demo/text_spotting/mango/tools/show_masks.py:78-90 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:78-90 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:78-90 — before extracting anything, compare `demo/text_spotting/mango/tools/show_masks.py` and `demo/text_spotting/mask_rcnn_spot/tools/show_masks.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×3
  • Duplicated block (11–13 lines × 3) davarocr/davar_ie/models/connects/multimodal_context_module.py:151 — davarocr/davar_ie/models/connects/multimodal_context_module.py:151-161 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:197-207 | davarocr/davar_layout/models/heads/gcn_head.py:202-214 — before extracting anything, compare `davarocr/davar_ie/models/connects/multimodal_context_module.py` and `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 `davarocr/davar_ie/models/connects/multimodal_context_module.py:151` 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 (11–13 lines × 3) davarocr/davar_rcg/models/recognizors/general.py:183 — davarocr/davar_rcg/models/recognizors/general.py:183-195 | davarocr/davar_rcg/models/recognizors/rf_learning.py:216-228 | davarocr/davar_videotext/models/recognizors/text_recommender.py:116-126 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_rcg/models/recognizors/rf_learning.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 94 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_rcg/models/recognizors/rf_learning.py:232` calls `get_target` and `davarocr/davar_rcg/models/recognizors/general.py:202` 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 (11–13 lines × 3) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:288 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:288-300 | demo/text_detection/evaluation/script.py:341-351 | demo/text_spotting/evaluation/script.py:381-392 — 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. 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, `demo/text_detection/evaluation/script.py:353` calls `str` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py:302` 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 (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) davarocr/davar_ie/models/connects/multimodal_context_module.py:133 — davarocr/davar_ie/models/connects/multimodal_context_module.py:133-144 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:179-190 — before extracting anything, compare `davarocr/davar_ie/models/connects/multimodal_context_module.py` and `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 (12 lines × 2) davarocr/davar_videotext/models/recognizors/text_recommender.py:118 — davarocr/davar_videotext/models/recognizors/text_recommender.py:118-129 | davarocr/davar_videotext/models/recognizors/text_recommender.py:176-187 — 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) davarocr/davar_spotting/models/roi_extractors/tps_roi_extractor.py:145 — davarocr/davar_spotting/models/roi_extractors/tps_roi_extractor.py:145-156 | davarocr/davar_spotting/models/seg_heads/grid_category_head.py:312-323 — 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 · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) davarocr/davar_rcg/models/backbones/ResNet32.py:144 — davarocr/davar_rcg/models/backbones/ResNet32.py:144-212 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:189-233 — These two members are one piece of code written twice and then edited apart: 37 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.
  • Edited copy of a member (37 corresponding lines) demo/videotext/evaluation/evaluate_utils.py:210 — demo/videotext/evaluation/evaluate_utils.py:210-248 | demo/videotext/evaluation/evaluate_utils.py:335-371 — These two members are one piece of code written twice and then edited apart: 37 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 · Edited copy of a member (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) davarocr/davar_ie/datasets/wildreceipt_dataset.py:51 — davarocr/davar_ie/datasets/wildreceipt_dataset.py:51-78 | davarocr/davar_table/datasets/ctunet_dataset.py:67-93 — These two members are one piece of code written twice and then edited apart: 26 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.
  • Edited copy of a member (26 corresponding lines) davarocr/davar_common/datasets/pipelines/davar_loading.py:736 — davarocr/davar_common/datasets/pipelines/davar_loading.py:736-761 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:403-430 — These two members are one piece of code written twice and then edited apart: 26 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) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) davarocr/davar_det/core/post_processing/post_east.py:32 — davarocr/davar_det/core/post_processing/post_east.py:32-74 | davarocr/davar_det/core/post_processing/post_tp_det.py:39-89 | davarocr/davar_det/datasets/pipelines/east_data.py:37-86 | davarocr/davar_det/datasets/pipelines/tp_data.py:35-89 | davarocr/davar_spotting/core/post_processing/post_mango.py:39-78 | davarocr/davar_table/datasets/pipelines/gpma_data.py:34-73 — 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.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) demo/text_spotting/mango/tools/show_masks.py:34 — demo/text_spotting/mango/tools/show_masks.py:34-49 | demo/text_spotting/mango/tools/show_masks.py:78-96 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:34-49 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:78-96 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:34-49 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:78-96 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) davarocr/davar_common/datasets/pipelines/davar_loading.py:266 — davarocr/davar_common/datasets/pipelines/davar_loading.py:266-313 | davarocr/davar_common/datasets/pipelines/transforms.py:363-500 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:136-194 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:126-184 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:187-227 — These 5 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 5 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 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) davarocr/davar_rcg/models/backbones/ResNet32.py:38 — davarocr/davar_rcg/models/backbones/ResNet32.py:38-59 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:114-135 | davarocr/davar_rcg/models/backbones/VGG7.py:77-98 | davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:39-59 | davarocr/davar_spotting/models/backbone/light_crnn.py:77-84 — These 5 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 5 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 5 times.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×2
  • Edited copy of a member (61 corresponding lines) davarocr/davar_rcg/models/recognizors/general.py:224 — davarocr/davar_rcg/models/recognizors/general.py:224-284 | davarocr/davar_videotext/models/recognizors/text_recommender.py:148-210 — These two members are one piece of code written twice and then edited apart: 61 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.
  • Edited copy of a member (61 corresponding lines) davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:305 — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:305-365 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:74-156 — These two members are one piece of code written twice and then edited apart: 61 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 · Edited copy of a member (58 corresponding lines) · ×2
  • Edited copy of a member (58 corresponding lines) davarocr/davar_rcg/models/recognizors/general.py:153 — davarocr/davar_rcg/models/recognizors/general.py:153-217 | davarocr/davar_videotext/models/recognizors/text_recommender.py:85-142 — These two members are one piece of code written twice and then edited apart: 58 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.
  • Edited copy of a member (58 corresponding lines) davarocr/davar_table/datasets/pipelines/ctunet_loading.py:34 — davarocr/davar_table/datasets/pipelines/ctunet_loading.py:34-91 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:66-123 — These two members are one piece of code written twice and then edited apart: 58 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 · Edited copy of a member (33 corresponding lines) · ×2
  • Edited copy of a member (33 corresponding lines) davarocr/davar_det/core/post_processing/post_mask_rcnn.py:36 — davarocr/davar_det/core/post_processing/post_mask_rcnn.py:36-68 | davarocr/davar_spotting/core/post_processing/post_mask_rcnn_spot.py:38-72 — These two members are one piece of code written twice and then edited apart: 33 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.
  • Edited copy of a member (33 corresponding lines) davarocr/davar_rcg/core/converters/att_converter.py:99 — davarocr/davar_rcg/core/converters/att_converter.py:99-133 | davarocr/davar_rcg/core/converters/bert_converter.py:100-132 — These two members are one piece of code written twice and then edited apart: 33 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 · Edited copy of a member (42 corresponding lines) · ×2
  • Edited copy of a member (42 corresponding lines) davarocr/davar_spotting/models/seg_heads/grid_category_head.py:40 — davarocr/davar_spotting/models/seg_heads/grid_category_head.py:40-81 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:40-83 — These two members are one piece of code written twice and then edited apart: 42 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.
  • Edited copy of a member (42 corresponding lines) davarocr/davar_rcg/models/recognizors/general.py:56 — davarocr/davar_rcg/models/recognizors/general.py:56-97 | davarocr/davar_rcg/models/recognizors/rf_learning.py:35-93 — These two members are one piece of code written twice and then edited apart: 42 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 · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:273 — davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:273-297 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:227-251 — These two members are one piece of code written twice and then edited apart: 25 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.
  • Edited copy of a member (25 corresponding lines) davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:172 — davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:172-196 | davarocr/davar_table/models/roi_heads/lgpma_roi_head.py:149-181 — These two members are one piece of code written twice and then edited apart: 25 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 · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) davarocr/mmcv/runner/hooks/davar_checkpoint.py:101 — davarocr/mmcv/runner/hooks/davar_checkpoint.py:101-127 | davarocr/mmcv/runner/hooks/davar_checkpoint.py:130-157 — These two members are one piece of code written twice and then edited apart: 27 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.
  • Edited copy of a member (27 corresponding lines) davarocr/davar_common/core/evaluation/davar_eval_hook.py:95 — davarocr/davar_common/core/evaluation/davar_eval_hook.py:95-122 | davarocr/davar_common/core/evaluation/davar_eval_hook.py:125-151 — These two members are one piece of code written twice and then edited apart: 27 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 · Edited copy of a member (17 corresponding lines) · ×2
  • Edited copy of a member (17 corresponding lines) davarocr/davar_ie/datasets/wildreceipt_dataset.py:31 — davarocr/davar_ie/datasets/wildreceipt_dataset.py:31-48 | davarocr/davar_table/datasets/ctunet_dataset.py:35-51 — These two members are one piece of code written twice and then edited apart: 17 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.
  • Edited copy of a member (17 corresponding lines) davarocr/davar_spotting/models/roi_extractors/masked_roi_extractor.py:34 — davarocr/davar_spotting/models/roi_extractors/masked_roi_extractor.py:34-50 | davarocr/davar_spotting/models/roi_extractors/tps_roi_extractor.py:33-53 — These two members are one piece of code written twice and then edited apart: 17 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 · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) davarocr/davar_common/datasets/davar_custom.py:266 — davarocr/davar_common/datasets/davar_custom.py:266-281 | davarocr/davar_layout/datasets/mm_layout_dataset.py:172-189 | davarocr/davar_videotext/datasets/multi_frame_dataset.py:252-276 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) davarocr/davar_distill/models/connect/resolution_selector.py:95 — davarocr/davar_distill/models/connect/resolution_selector.py:95-117 | davarocr/davar_rcg/models/backbones/ResNet32.py:115-137 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:388-403 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×2
  • Edited copy of a member (15 corresponding lines) davarocr/davar_ie/models/infor_extrators/trie/trie.py:132 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:132-146 | davarocr/davar_table/models/understanding_detectors/ctunet.py:152-168 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) davarocr/davar_layout/models/heads/gcn_head.py:97 — davarocr/davar_layout/models/heads/gcn_head.py:97-111 | davarocr/davar_spotting/models/sequence_heads/multi_recog_seq_head.py:76-92 — These two members are one piece of code written twice and then edited apart: 15 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 · Edited copies of one member (3 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) davarocr/davar_common/datasets/pipelines/davar_loading.py:865 — davarocr/davar_common/datasets/pipelines/davar_loading.py:865-872 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:503-508 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:311-319 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) demo/text_spotting/mango/tools/show_masks.py:70 — demo/text_spotting/mango/tools/show_masks.py:70-75 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:70-75 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:70-75 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×2
  • Duplicated block (35 lines × 2) davarocr/davar_rcg/models/backbones/ResNet32.py:154 — davarocr/davar_rcg/models/backbones/ResNet32.py:154-188 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:199-233 — before extracting anything, compare `davarocr/davar_rcg/models/backbones/ResNet32.py` and `davarocr/davar_rcg/models/backbones/ResNetRFL.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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 (35 lines × 2) davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:63 — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:63-97 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:81-115 — before extracting anything, compare `davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 151 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 (28 lines × 2) · ×2
  • Duplicated block (28 lines × 2) davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:347 — davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:347-374 | davarocr/davar_rcg/datasets/pipelines/davar_loading_lmdb.py:255-282 — 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 (28 lines × 2) davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:345 — davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:345-372 | davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py:59-86 — before extracting anything, compare `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py` and `davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) davarocr/davar_det/core/post_processing/post_mask_rcnn.py:36 — davarocr/davar_det/core/post_processing/post_mask_rcnn.py:36-60 | davarocr/davar_spotting/core/post_processing/post_mask_rcnn_spot.py:38-62 — 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 `davarocr/davar_det/core/post_processing/post_mask_rcnn.py:36` 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. 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 (25 lines × 2) tools/test.py:198 — tools/test.py:198-222 | tools/train.py:204-228 — 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 (18–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) davarocr/davar_common/datasets/pipelines/transforms.py:173 — davarocr/davar_common/datasets/pipelines/transforms.py:173-191 | davarocr/davar_common/datasets/pipelines/transforms.py:221-238 — 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 (18–19 lines × 2) davarocr/davar_det/core/post_processing/post_east.py:138 — davarocr/davar_det/core/post_processing/post_east.py:138-155 | davarocr/davar_det/core/post_processing/post_east.py:159-177 — 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 (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) davarocr/davar_layout/models/vsr/vsr.py:181 — davarocr/davar_layout/models/vsr/vsr.py:181-194 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:181-195 | davarocr/davar_spotting/models/spotters/mango.py:146-160 — 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.
  • Duplicated block (14 lines × 3) demo/text_spotting/mango/tools/show_masks.py:53 — demo/text_spotting/mango/tools/show_masks.py:53-66 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:53-66 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:53-66 — before extracting anything, compare `demo/text_spotting/mango/tools/show_masks.py` and `demo/text_spotting/mask_rcnn_spot/tools/show_masks.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) davarocr/davar_det/core/evaluation/hmean.py:51 — davarocr/davar_det/core/evaluation/hmean.py:51-63 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:51-63 | demo/text_spotting/evaluation/script.py:115-123 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) davarocr/davar_rcg/models/recognizors/general.py:89 — davarocr/davar_rcg/models/recognizors/general.py:89-97 | davarocr/davar_rcg/models/recognizors/rf_learning.py:84-92 | davarocr/davar_videotext/models/recognizors/text_recommender.py:71-79 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_rcg/models/recognizors/rf_learning.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 94 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 (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) davarocr/davar_det/core/evaluation/hmean.py:256 — davarocr/davar_det/core/evaluation/hmean.py:256-264 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:288-297 | demo/text_detection/evaluation/script.py:341-348 | demo/text_spotting/evaluation/script.py:381-389 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 4) davarocr/davar_det/core/evaluation/hmean.py:287 — davarocr/davar_det/core/evaluation/hmean.py:287-294 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:314-321 | demo/text_detection/evaluation/script.py:376-383 | demo/text_spotting/evaluation/script.py:409-416 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×2
  • Duplicated block (6–8 lines × 2) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:329 — davarocr/davar_rcg/datasets/davar_rcg_dataset.py:329-336 | davarocr/davar_rcg/datasets/davar_rcg_dataset.py:390-395 — 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 `davarocr/davar_rcg/datasets/davar_rcg_dataset.py:329` 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 (6–8 lines × 2) davarocr/davar_table/core/post_processing/generate_html.py:175 — davarocr/davar_table/core/post_processing/generate_html.py:175-182 | davarocr/davar_table/utils/format.py:15-20 — 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. 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 (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) davarocr/davar_layout/datasets/publaynet_dataset.py:230 — davarocr/davar_layout/datasets/publaynet_dataset.py:230-235 | davarocr/davar_layout/datasets/publaynet_dataset.py:247-252 | davarocr/davar_layout/datasets/publaynet_dataset.py:266-271 — 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.
  • Duplicated block (6 lines × 3) demo/text_spotting/mango/tools/show_masks.py:25 — demo/text_spotting/mango/tools/show_masks.py:25-30 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:25-30 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:25-30 — before extracting anything, compare `demo/text_spotting/mango/tools/show_masks.py` and `demo/text_spotting/mask_rcnn_spot/tools/show_masks.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) davarocr/davar_ie/models/infor_extrators/trie/trie.py:270 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:270-274 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:211-215 | davarocr/davar_table/models/understanding_detectors/ctunet.py:264-268 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 175 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 (5 lines × 3) davarocr/davar_ie/models/necks/chargrid_neck.py:27 — davarocr/davar_ie/models/necks/chargrid_neck.py:27-31 | davarocr/davar_ie/models/necks/chargrid_neck.py:33-37 | davarocr/davar_ie/models/necks/chargrid_neck.py:39-43 — 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 `davarocr/davar_ie/models/necks/chargrid_neck.py:27` 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.
D1 · Cyclomatic Complexity · NERLoader._load (cyclomatic 50) · ×1
  • NERLoader._load (cyclomatic 50) davarocr/davar_ner/datasets/loaders/ner_loader.py:69 — NERLoader._load 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 · generate_html.area_to_html (cyclomatic 40) · ×1
  • generate_html.area_to_html (cyclomatic 40) davarocr/davar_table/core/post_processing/generate_html.py:16 — generate_html.area_to_html 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 · DavarRCGDataset._filter_file_to_list (cyclomatic 34) · ×1
  • DavarRCGDataset._filter_file_to_list (cyclomatic 34) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:367 — DavarRCGDataset._filter_file_to_list 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 · davar_loading_json.rcg_json_dataload (cyclomatic 34) · ×1
  • davar_loading_json.rcg_json_dataload (cyclomatic 34) davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:24 — davar_loading_json.rcg_json_dataload 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 · hmean.evaluate_method (cyclomatic 30) · ×1
  • hmean.evaluate_method (cyclomatic 30) davarocr/davar_det/core/evaluation/hmean.py:15 — hmean.evaluate_method 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 · davar_loading_lmdb.rcg_lmdb_dataload (cyclomatic 28) · ×1
  • davar_loading_lmdb.rcg_lmdb_dataload (cyclomatic 28) davarocr/davar_rcg/datasets/pipelines/davar_loading_lmdb.py:23 — davar_loading_lmdb.rcg_lmdb_dataload 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 · DavarRCGDataset.evaluate (cyclomatic 27) · ×1
  • DavarRCGDataset.evaluate (cyclomatic 27) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:490 — DavarRCGDataset.evaluate 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 · TableRcgDataset.evaluate (cyclomatic 26) · ×1
  • TableRcgDataset.evaluate (cyclomatic 26) davarocr/davar_table/datasets/table_rcg_dataset.py:57 — TableRcgDataset.evaluate 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 · DavarLoadAnnotations._load_labels (cyclomatic 25) · ×1
  • DavarLoadAnnotations._load_labels (cyclomatic 25) davarocr/davar_common/datasets/pipelines/davar_loading.py:532 — DavarLoadAnnotations._load_labels 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 · DavarLoadAnnotations._load_multi_labels (cyclomatic 25) · ×1
  • DavarLoadAnnotations._load_multi_labels (cyclomatic 25) davarocr/davar_common/datasets/pipelines/davar_loading.py:628 — DavarLoadAnnotations._load_multi_labels 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 · MMLALoadAnnotations._load_labels (cyclomatic 25) · ×1
  • MMLALoadAnnotations._load_labels (cyclomatic 25) davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:234 — MMLALoadAnnotations._load_labels 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 · bbox_process.recon_noncell (cyclomatic 25) · ×1
  • bbox_process.recon_noncell (cyclomatic 25) davarocr/davar_table/core/bbox/bbox_process.py:15 — bbox_process.recon_noncell 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 · CTCLabelConverter.ctc_beam_search_decoder (cyclomatic 22) · ×1
  • CTCLabelConverter.ctc_beam_search_decoder (cyclomatic 22) davarocr/davar_rcg/core/converters/ctc_converter.py:210 — CTCLabelConverter.ctc_beam_search_decoder 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 · train.train_model (cyclomatic 21) · ×1
  • train.train_model (cyclomatic 21) davarocr/davar_common/apis/train.py:27 — train.train_model 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 · DocBankDataset.pre_prepare (cyclomatic 21) · ×1
  • DocBankDataset.pre_prepare (cyclomatic 21) davarocr/davar_layout/datasets/docbank_dataset.py:79 — DocBankDataset.pre_prepare 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 · builder.parameter_align (cyclomatic 20) · ×1
  • builder.parameter_align (cyclomatic 20) davarocr/davar_common/datasets/builder.py:234 — builder.parameter_align has cyclomatic complexity 20 (threshold 15). 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.
D1 · Cyclomatic Complexity · RandomRotate._rotate_img (cyclomatic 20) · ×1
  • RandomRotate._rotate_img (cyclomatic 20) davarocr/davar_common/datasets/pipelines/transforms.py:362 — RandomRotate._rotate_img 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 · ChargridDataGeneration.__call__ (cyclomatic 20) · ×1
  • ChargridDataGeneration.__call__ (cyclomatic 20) davarocr/davar_ie/datasets/pipelines/chargrid_data.py:95 — ChargridDataGeneration.__call__ 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 · TransformersConverter._labels_convert (cyclomatic 20) · ×1
  • TransformersConverter._labels_convert (cyclomatic 20) davarocr/davar_ner/core/converters/transformers_converter.py:149 — TransformersConverter._labels_convert 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 · DavarRandomCrop.__call__ (cyclomatic 19) · ×1
  • DavarRandomCrop.__call__ (cyclomatic 19) davarocr/davar_common/datasets/pipelines/transforms.py:690 — DavarRandomCrop.__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 · ConvFCBBoxHeadWGCN.forward (cyclomatic 17) · ×1
  • ConvFCBBoxHeadWGCN.forward (cyclomatic 17) davarocr/davar_layout/models/heads/convfc_bbox_head_w_gcn.py:73 — ConvFCBBoxHeadWGCN.forward 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 · SpotResolutionDistillation.generate_lr_pair (cyclomatic 16) · ×1
  • SpotResolutionDistillation.generate_lr_pair (cyclomatic 16) davarocr/davar_distill/models/distillation/spot_res_distill.py:189 — SpotResolutionDistillation.generate_lr_pair 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 · PublaynetDataset.evaluate (cyclomatic 16) · ×1
  • PublaynetDataset.evaluate (cyclomatic 16) davarocr/davar_layout/datasets/publaynet_dataset.py:351 — PublaynetDataset.evaluate 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 · TransformersConverter._labels_convert_ori (cyclomatic 16) · ×1
  • TransformersConverter._labels_convert_ori (cyclomatic 16) davarocr/davar_ner/core/converters/transformers_converter.py:231 — TransformersConverter._labels_convert_ori 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.
D16 · Bus Factor · bus factor 1 · ×1
  • bus factor 1 — one contributor carries this repository — 5 contributor(s) have commits in this repository (automation and bot accounts excluded), but the commits of a single one of them cover most of its history — 80% of the 132 commit(s) sampled — so the number of people who actually carry it is 1. This is not the ambient state of a solo project: there ARE other contributors, and if the one who carries the repository becomes unavailable, the knowledge behind most of its history goes with them. Spread the next changes deliberately — have a second contributor review or pair on them — and write down the parts only one person can currently change.
D2 · Cognitive Complexity · NERLoader._load (cognitive 212) · ×1
  • NERLoader._load (cognitive 212) davarocr/davar_ner/datasets/loaders/ner_loader.py:69 — NERLoader._load has cognitive complexity 212 (threshold 15). Drivers by points: if/else 38 (150 pts), loops 13 (58 pts), boolean chains 4 (nesting depth added 157). 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 · DavarRCGDataset._filter_file_to_list (cognitive 114) · ×1
  • DavarRCGDataset._filter_file_to_list (cognitive 114) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:367 — DavarRCGDataset._filter_file_to_list has cognitive complexity 114 (threshold 15). Drivers by points: if/else 25 (94 pts), loops 4 (12 pts), error handling 1 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 82). 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 · generate_html.area_to_html (cognitive 84) · ×1
  • generate_html.area_to_html (cognitive 84) davarocr/davar_table/core/post_processing/generate_html.py:16 — generate_html.area_to_html has cognitive complexity 84 (threshold 15). Drivers by points: if/else 13 (44 pts), loops 6 (19 pts), ternaries 4 (16 pts), boolean chains 5 (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 · TableRcgDataset.evaluate (cognitive 75) · ×1
  • TableRcgDataset.evaluate (cognitive 75) davarocr/davar_table/datasets/table_rcg_dataset.py:57 — TableRcgDataset.evaluate has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (57 pts), loops 5 (14 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 48). 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 · hmean.evaluate_method (cognitive 73) · ×1
  • hmean.evaluate_method (cognitive 73) davarocr/davar_det/core/evaluation/hmean.py:15 — hmean.evaluate_method has cognitive complexity 73 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 10 (27 pts), ternaries 8 (13 pts), boolean chains 2 (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 · DocBankDataset.pre_prepare (cognitive 66) · ×1
  • DocBankDataset.pre_prepare (cognitive 66) davarocr/davar_layout/datasets/docbank_dataset.py:79 — DocBankDataset.pre_prepare has cognitive complexity 66 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 6 (25 pts), boolean chains 2 (nesting depth added 42). 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 · TransformersConverter._labels_convert (cognitive 66) · ×1
  • TransformersConverter._labels_convert (cognitive 66) davarocr/davar_ner/core/converters/transformers_converter.py:149 — TransformersConverter._labels_convert has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 7 (23 pts), boolean chains 1 (nesting depth added 43). 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 · DavarLoadAnnotations._load_multi_labels (cognitive 63) · ×1
  • DavarLoadAnnotations._load_multi_labels (cognitive 63) davarocr/davar_common/datasets/pipelines/davar_loading.py:628 — DavarLoadAnnotations._load_multi_labels has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (53 pts), loops 5 (7 pts), boolean chains 2, ternaries 1 (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 · MMLALoadAnnotations._load_labels (cognitive 56) · ×1
  • MMLALoadAnnotations._load_labels (cognitive 56) davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:234 — MMLALoadAnnotations._load_labels has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (45 pts), boolean chains 6, loops 3 (5 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 · davar_loading_json.rcg_json_dataload (cognitive 53) · ×1
  • davar_loading_json.rcg_json_dataload (cognitive 53) davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:24 — davar_loading_json.rcg_json_dataload has cognitive complexity 53 (threshold 15). Drivers by points: if/else 28 (44 pts), boolean chains 5, loops 1 (4 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 · davar_loading_lmdb.rcg_lmdb_dataload (cognitive 53) · ×1
  • davar_loading_lmdb.rcg_lmdb_dataload (cognitive 53) davarocr/davar_rcg/datasets/pipelines/davar_loading_lmdb.py:23 — davar_loading_lmdb.rcg_lmdb_dataload has cognitive complexity 53 (threshold 15). Drivers by points: if/else 26 (47 pts), loops 1 (4 pts), boolean chains 1, error handling 1 (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 · DavarLoadAnnotations._load_labels (cognitive 51) · ×1
  • DavarLoadAnnotations._load_labels (cognitive 51) davarocr/davar_common/datasets/pipelines/davar_loading.py:532 — DavarLoadAnnotations._load_labels has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 6, loops 3 (5 pts), ternaries 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 · CTCLabelConverter.ctc_beam_search_decoder (cognitive 49) · ×1
  • CTCLabelConverter.ctc_beam_search_decoder (cognitive 49) davarocr/davar_rcg/core/converters/ctc_converter.py:210 — CTCLabelConverter.ctc_beam_search_decoder has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 4 (8 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 29). 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 · PostMango.post_processing (cognitive 49) · ×1
  • PostMango.post_processing (cognitive 49) davarocr/davar_spotting/core/post_processing/post_mango.py:107 — PostMango.post_processing has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 5 (17 pts) (nesting depth added 33). 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 · bbox_process.recon_noncell (cognitive 49) · ×1
  • bbox_process.recon_noncell (cognitive 49) davarocr/davar_table/core/bbox/bbox_process.py:15 — bbox_process.recon_noncell has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 5 (13 pts), boolean chains 4 (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 · ChargridDataGeneration.__call__ (cognitive 46) · ×1
  • ChargridDataGeneration.__call__ (cognitive 46) davarocr/davar_ie/datasets/pipelines/chargrid_data.py:95 — ChargridDataGeneration.__call__ has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 3 (7 pts), ternaries 2 (3 pts), boolean chains 2 (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 · DavarRCGDataset.evaluate (cognitive 46) · ×1
  • DavarRCGDataset.evaluate (cognitive 46) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:490 — DavarRCGDataset.evaluate has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 5 (8 pts), boolean chains 3, ternaries 1 (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 · SpotResolutionDistillation.generate_lr_pair (cognitive 44) · ×1
  • SpotResolutionDistillation.generate_lr_pair (cognitive 44) davarocr/davar_distill/models/distillation/spot_res_distill.py:189 — SpotResolutionDistillation.generate_lr_pair has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 7 (13 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 · RandomRotate._rotate_img (cognitive 43) · ×1
  • RandomRotate._rotate_img (cognitive 43) davarocr/davar_common/datasets/pipelines/transforms.py:362 — RandomRotate._rotate_img has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 10 (21 pts), boolean chains 1 (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 · DavarRCGDataset.lmdb_file_load (cognitive 42) · ×1
  • DavarRCGDataset.lmdb_file_load (cognitive 42) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:113 — DavarRCGDataset.lmdb_file_load has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 2 (6 pts), ternaries 1 (4 pts) (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 · post_lgpma.ocr_result_matching (cognitive 40) · ×1
  • post_lgpma.ocr_result_matching (cognitive 40) davarocr/davar_table/core/post_processing/post_lgpma.py:241 — post_lgpma.ocr_result_matching has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 4 (11 pts), boolean chains 1 (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 · DavarRandomCrop.__call__ (cognitive 39) · ×1
  • DavarRandomCrop.__call__ (cognitive 39) davarocr/davar_common/datasets/pipelines/transforms.py:690 — DavarRandomCrop.__call__ has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 7 (10 pts), ternaries 1 (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 · davar_sampler.batch_sampler (cognitive 39) · ×1
  • davar_sampler.batch_sampler (cognitive 39) davarocr/davar_common/datasets/sampler/davar_sampler.py:22 — davar_sampler.batch_sampler has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 21). 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 · CascadeRoIHeadWGCN.simple_test (cognitive 32) · ×1
  • CascadeRoIHeadWGCN.simple_test (cognitive 32) davarocr/davar_layout/models/heads/cascade_roi_head_w_gcn.py:165 — CascadeRoIHeadWGCN.simple_test has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (8 pts), ternaries 1 (3 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 · CascadeRoIHeadWGCN.forward_train (cognitive 31) · ×1
  • CascadeRoIHeadWGCN.forward_train (cognitive 31) davarocr/davar_layout/models/heads/cascade_roi_head_w_gcn.py:74 — CascadeRoIHeadWGCN.forward_train has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (10 pts), ternaries 2 (8 pts), boolean chains 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 · TransformersConverter._labels_convert_ori (cognitive 31) · ×1
  • TransformersConverter._labels_convert_ori (cognitive 31) davarocr/davar_ner/core/converters/transformers_converter.py:231 — TransformersConverter._labels_convert_ori has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (5 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 · beam_search.beam_decode (cognitive 30) · ×1
  • beam_search.beam_decode (cognitive 30) davarocr/davar_distill/core/beam_search.py:50 — beam_search.beam_decode has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 5 (13 pts), boolean chains 1 (nesting depth added 17). 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 · PostLGPMA.post_processing (cognitive 30) · ×1
  • PostLGPMA.post_processing (cognitive 30) davarocr/davar_table/core/post_processing/post_lgpma.py:321 — PostLGPMA.post_processing has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (11 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 · CTUNet.forward_train (cognitive 30) · ×1
  • CTUNet.forward_train (cognitive 30) davarocr/davar_table/models/understanding_detectors/ctunet.py:170 — CTUNet.forward_train has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 8 (12 pts) (nesting depth added 16). 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 · filter.filter_operate (cognitive 30) · ×1
  • filter.filter_operate (cognitive 30) davarocr/davar_videotext/tools/filter.py:41 — filter.filter_operate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (4 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 · PublaynetDataset.evaluate (cognitive 29) · ×1
  • PublaynetDataset.evaluate (cognitive 29) davarocr/davar_layout/datasets/publaynet_dataset.py:351 — PublaynetDataset.evaluate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (9 pts), ternaries 1 (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 · builder.multi_frame_collate (cognitive 28) · ×1
  • builder.multi_frame_collate (cognitive 28) davarocr/davar_common/datasets/builder.py:292 — builder.multi_frame_collate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (10 pts) (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 · MetricSampler.generate_apn (cognitive 28) · ×1
  • MetricSampler.generate_apn (cognitive 28) davarocr/davar_videotext/datasets/samplers/metric_sampler.py:87 — MetricSampler.generate_apn has cognitive complexity 28 (threshold 15). Drivers by points: loops 5 (18 pts), if/else 3 (10 pts) (nesting depth added 20). 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 · DocBankDataset.evaluate (cognitive 27) · ×1
  • DocBankDataset.evaluate (cognitive 27) davarocr/davar_layout/datasets/docbank_dataset.py:167 — DocBankDataset.evaluate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (11 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 · train.train_model (cognitive 26) · ×1
  • train.train_model (cognitive 26) davarocr/davar_common/apis/train.py:27 — train.train_model has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 2 (3 pts), loops 1 (2 pts), 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 · builder.parameter_align (cognitive 26) · ×1
  • builder.parameter_align (cognitive 26) davarocr/davar_common/datasets/builder.py:234 — builder.parameter_align has cognitive complexity 26 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 6 (7 pts), boolean chains 3 (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 · PostEAST.post_processing (cognitive 26) · ×1
  • PostEAST.post_processing (cognitive 26) davarocr/davar_det/core/post_processing/post_east.py:117 — PostEAST.post_processing has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (7 pts), boolean chains 1 (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 · AttnLabelConverter.__init__ (cognitive 25) · ×1
  • AttnLabelConverter.__init__ (cognitive 25) davarocr/davar_rcg/core/converters/att_converter.py:26 — AttnLabelConverter.__init__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (11 pts), boolean chains 1 (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 · BertLabelConverter.__init__ (cognitive 25) · ×1
  • BertLabelConverter.__init__ (cognitive 25) davarocr/davar_rcg/core/converters/bert_converter.py:23 — BertLabelConverter.__init__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (11 pts), boolean chains 1 (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 · CTCLabelConverter.__init__ (cognitive 25) · ×1
  • CTCLabelConverter.__init__ (cognitive 25) davarocr/davar_rcg/core/converters/ctc_converter.py:28 — CTCLabelConverter.__init__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (11 pts), boolean chains 1 (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 · CTCLabelConverter.decode (cognitive 25) · ×1
  • CTCLabelConverter.decode (cognitive 25) davarocr/davar_rcg/core/converters/ctc_converter.py:127 — CTCLabelConverter.decode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (8 pts), boolean chains 4 (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 · TextualEmbedding.forward (cognitive 24) · ×1
  • TextualEmbedding.forward (cognitive 24) davarocr/davar_ie/models/embedding/text_embedding.py:87 — TextualEmbedding.forward has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (24 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 · ConvFCBBoxHeadWGCN.forward (cognitive 24) · ×1
  • ConvFCBBoxHeadWGCN.forward (cognitive 24) davarocr/davar_layout/models/heads/convfc_bbox_head_w_gcn.py:73 — ConvFCBBoxHeadWGCN.forward has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 6 (8 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 · TextSpotDataset.evaluate (cognitive 24) · ×1
  • TextSpotDataset.evaluate (cognitive 24) davarocr/davar_spotting/datasets/text_spot_dataset.py:59 — TextSpotDataset.evaluate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4 (7 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 · LGPMARoIHead.simple_test_mask (cognitive 24) · ×1
  • LGPMARoIHead.simple_test_mask (cognitive 24) davarocr/davar_table/models/roi_heads/lgpma_roi_head.py:183 — LGPMARoIHead.simple_test_mask has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts), ternaries 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 · CTUNetDataset.evaluate (cognitive 23) · ×1
  • CTUNetDataset.evaluate (cognitive 23) davarocr/davar_table/datasets/ctunet_dataset.py:136 — CTUNetDataset.evaluate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 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 · DavarLoadAnnotations.__init__ (cognitive 22) · ×1
  • DavarLoadAnnotations.__init__ (cognitive 22) davarocr/davar_common/datasets/pipelines/davar_loading.py:125 — DavarLoadAnnotations.__init__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 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 · EASTDataGeneration._parse_east_data_cpp (cognitive 22) · ×1
  • EASTDataGeneration._parse_east_data_cpp (cognitive 22) davarocr/davar_det/datasets/pipelines/east_data.py:110 — EASTDataGeneration._parse_east_data_cpp has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 3 (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 · RFLLabelConverter.__init__ (cognitive 21) · ×1
  • RFLLabelConverter.__init__ (cognitive 21) davarocr/davar_rcg/core/converters/rfl_converter.py:27 — RFLLabelConverter.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (11 pts), if/else 6 (9 pts), boolean chains 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 · bbox_process.bbox2adj (cognitive 21) · ×1
  • bbox_process.bbox2adj (cognitive 21) davarocr/davar_table/core/bbox/bbox_process.py:217 — bbox_process.bbox2adj has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (5 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 · builder.davar_build_dataloader (cognitive 20) · ×1
  • builder.davar_build_dataloader (cognitive 20) davarocr/davar_common/datasets/builder.py:56 — builder.davar_build_dataloader has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 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 · DavarCustomDataset.__init__ (cognitive 20) · ×1
  • DavarCustomDataset.__init__ (cognitive 20) davarocr/davar_common/datasets/davar_custom.py:67 — DavarCustomDataset.__init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 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 · DavarCustomDataset.evaluate (cognitive 20) · ×1
  • DavarCustomDataset.evaluate (cognitive 20) davarocr/davar_common/datasets/davar_custom.py:336 — DavarCustomDataset.evaluate has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 5 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 8). 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 · TextDetDataset.evaluate (cognitive 20) · ×1
  • TextDetDataset.evaluate (cognitive 20) davarocr/davar_det/datasets/text_det_dataset.py:53 — TextDetDataset.evaluate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (6 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 · loading_utils.wordmap_loader (cognitive 20) · ×1
  • loading_utils.wordmap_loader (cognitive 20) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:20 — loading_utils.wordmap_loader has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (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 · RFLRecognizor.simple_test (cognitive 20) · ×1
  • RFLRecognizor.simple_test (cognitive 20) davarocr/davar_rcg/models/recognizors/rf_learning.py:260 — RFLRecognizor.simple_test has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (20 pts) (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 · post_lgpma.softmasks_refine_bboxes (cognitive 20) · ×1
  • post_lgpma.softmasks_refine_bboxes (cognitive 20) davarocr/davar_table/core/post_processing/post_lgpma.py:76 — post_lgpma.softmasks_refine_bboxes has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 1 (3 pts), loops 2 (3 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 · YORORCGDataset._file_to_list (cognitive 20) · ×1
  • YORORCGDataset._file_to_list (cognitive 20) davarocr/davar_videotext/datasets/yoro_rcg_dataset.py:147 — YORORCGDataset._file_to_list has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), ternaries 1 (3 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 · filter.load_data (cognitive 20) · ×1
  • filter.load_data (cognitive 20) davarocr/davar_videotext/tools/filter.py:116 — filter.load_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 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 · DistBatchBalancedSampler.__init__ (cognitive 19) · ×1
  • DistBatchBalancedSampler.__init__ (cognitive 19) davarocr/davar_common/datasets/sampler/davar_sampler.py:248 — DistBatchBalancedSampler.__init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (8 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 · SpotResolutionDistillation.forward_train (cognitive 19) · ×1
  • SpotResolutionDistillation.forward_train (cognitive 19) davarocr/davar_distill/models/distillation/spot_res_distill.py:70 — SpotResolutionDistillation.forward_train has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 4 (5 pts) (nesting depth added 9). 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 · TRIE.simple_test (cognitive 19) · ×1
  • TRIE.simple_test (cognitive 19) davarocr/davar_ie/models/infor_extrators/trie/trie.py:304 — TRIE.simple_test has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), loops 1 (2 pts), boolean chains 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 · davar_rcg_dataset.loose_tight_to_list (cognitive 19) · ×1
  • davar_rcg_dataset.loose_tight_to_list (cognitive 19) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:597 — davar_rcg_dataset.loose_tight_to_list has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), loops 2 (3 pts), error handling 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 · DavarLoadAnnotations._load_poly_bboxes (cognitive 18) · ×1
  • DavarLoadAnnotations._load_poly_bboxes (cognitive 18) davarocr/davar_common/datasets/pipelines/davar_loading.py:315 — DavarLoadAnnotations._load_poly_bboxes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), 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 · DavarLoadAnnotations._load_polymasks (cognitive 18) · ×1
  • DavarLoadAnnotations._load_polymasks (cognitive 18) davarocr/davar_common/datasets/pipelines/davar_loading.py:473 — DavarLoadAnnotations._load_polymasks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), 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 · DistillFormatBundle.__call__ (cognitive 18) · ×1
  • DistillFormatBundle.__call__ (cognitive 18) davarocr/davar_distill/dataset/pipelines/distill_formating.py:30 — DistillFormatBundle.__call__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (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 · TransformersConverter.convert_text2id (cognitive 18) · ×1
  • TransformersConverter.convert_text2id (cognitive 18) davarocr/davar_ner/core/converters/transformers_converter.py:286 — TransformersConverter.convert_text2id has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 7 (8 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 · BatchBalancedSampler.__init__ (cognitive 17) · ×1
  • BatchBalancedSampler.__init__ (cognitive 17) davarocr/davar_common/datasets/sampler/davar_sampler.py:138 — BatchBalancedSampler.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (8 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 · CharPadTokenize.__call__ (cognitive 17) · ×1
  • CharPadTokenize.__call__ (cognitive 17) davarocr/davar_ie/datasets/pipelines/tokenizer.py:50 — CharPadTokenize.__call__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), ternaries 1 (3 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 · TRIE.forward_train (cognitive 17) · ×1
  • TRIE.forward_train (cognitive 17) davarocr/davar_ie/models/infor_extrators/trie/trie.py:148 — TRIE.forward_train has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 2 (3 pts), boolean chains 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 · PublaynetDataset._segm2json (cognitive 17) · ×1
  • PublaynetDataset._segm2json (cognitive 17) davarocr/davar_layout/datasets/publaynet_dataset.py:257 — PublaynetDataset._segm2json has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (8 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 · GCNHead.forward (cognitive 17) · ×1
  • GCNHead.forward (cognitive 17) davarocr/davar_layout/models/heads/gcn_head.py:246 — GCNHead.forward has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 4 (6 pts) (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, 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 · VSR.__init__ (cognitive 17) · ×1
  • VSR.__init__ (cognitive 17) davarocr/davar_layout/models/vsr/vsr.py:30 — VSR.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 2 (4 pts), 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 · VSR.forward_train (cognitive 17) · ×1
  • VSR.forward_train (cognitive 17) davarocr/davar_layout/models/vsr/vsr.py:224 — VSR.forward_train has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (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 · VSR.simple_test (cognitive 17) · ×1
  • VSR.simple_test (cognitive 17) davarocr/davar_layout/models/vsr/vsr.py:353 — VSR.simple_test has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (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, 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 · BaseNER.aug_test (cognitive 17) · ×1
  • BaseNER.aug_test (cognitive 17) davarocr/davar_ner/models/ner_models/base_ner.py:49 — BaseNER.aug_test has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (8 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 · TPSRoIExtractor.get_fiducial_points (cognitive 17) · ×1
  • TPSRoIExtractor.get_fiducial_points (cognitive 17) davarocr/davar_spotting/models/roi_extractors/tps_roi_extractor.py:123 — TPSRoIExtractor.get_fiducial_points has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (8 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 · builder._concat_dataset (cognitive 16) · ×1
  • builder._concat_dataset (cognitive 16) davarocr/davar_common/datasets/builder.py:149 — builder._concat_dataset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), 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 · KDTwoStageEndToEnd.forward_train (cognitive 16) · ×1
  • KDTwoStageEndToEnd.forward_train (cognitive 16) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:70 — KDTwoStageEndToEnd.forward_train has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), 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 · MaskRoIExtractor.forward (cognitive 16) · ×1
  • MaskRoIExtractor.forward (cognitive 16) davarocr/davar_spotting/models/roi_extractors/mask_roi_extractor.py:40 — MaskRoIExtractor.forward has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts) (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, 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 · ConsistCollect.__call__ (cognitive 16) · ×1
  • ConsistCollect.__call__ (cognitive 16) davarocr/davar_videotext/datasets/pipelines/formating.py:42 — ConsistCollect.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 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 · davar_checkpoint.save_best_checkpoint (cognitive 16) · ×1
  • davar_checkpoint.save_best_checkpoint (cognitive 16) davarocr/mmcv/runner/hooks/davar_checkpoint.py:207 — davar_checkpoint.save_best_checkpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1 (nesting depth added 8). 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.
D4 · Code Duplication · Near-duplicate member family (4 members, 21 shared lines) · ×1
  • Near-duplicate member family (4 members, 21 shared lines) davarocr/davar_det/core/evaluation/hmean.py:16 — davarocr/davar_det/core/evaluation/hmean.py:16-349 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:16-359 | demo/text_detection/evaluation/script.py:87-507 | demo/text_spotting/evaluation/script.py:83-510 — These 4 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them 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 · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) davarocr/davar_rcg/models/transformations/gaspin_transformation.py:40 — davarocr/davar_rcg/models/transformations/gaspin_transformation.py:40-145 | davarocr/davar_rcg/models/transformations/spin_transformation.py:114-253 — These two members are variants of one another: 44 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 · Near-duplicate member pair (34 shared lines) · ×1
  • Near-duplicate member pair (34 shared lines) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:217 — davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:217-294 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:382-459 — These two members are variants of one another: 34 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 · Near-duplicate member pair (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) davarocr/davar_ie/models/connects/multimodal_context_module.py:97 — davarocr/davar_ie/models/connects/multimodal_context_module.py:97-183 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:136-246 — These two members are variants of one another: 28 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 · Near-duplicate member pair (26 shared lines) · ×1
  • Near-duplicate member pair (26 shared lines) davarocr/davar_rcg/models/sequence_heads/att_head.py:131 — davarocr/davar_rcg/models/sequence_heads/att_head.py:131-187 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:129-221 — These two members are variants of one another: 26 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 (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:118 — davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:118-215 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:224-291 — These two members are one piece of code written twice and then edited apart: 50 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 · Edited copy of a member (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) davarocr/davar_common/datasets/pipelines/davar_loading.py:533 — davarocr/davar_common/datasets/pipelines/davar_loading.py:533-626 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:235-327 — These two members are one piece of code written twice and then edited apart: 62 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 · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) davarocr/davar_common/datasets/pipelines/davar_formating.py:84 — davarocr/davar_common/datasets/pipelines/davar_formating.py:84-106 | davarocr/davar_table/datasets/pipelines/ctunet_formating.py:31-53 — These two members are one piece of code written twice and then edited apart: 23 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 · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) davarocr/davar_table/core/bbox/bbox_process.py:16 — davarocr/davar_table/core/bbox/bbox_process.py:16-123 | davarocr/davar_table/core/bbox/bbox_process.py:127-151 — These two members are one piece of code written twice and then edited apart: 6 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 (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:81 — davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:81-187 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:159-302 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:141-242 | davarocr/davar_layout/models/vsr/vsr.py:240-351 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:118-215 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:240-337 | davarocr/davar_table/models/detectors/lgpma.py:88-144 | davarocr/davar_table/models/understanding_detectors/ctunet.py:184-376 — These 8 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 8 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 8 times.
D4 · Code Duplication · Edited copy of a member (88 corresponding lines) · ×1
  • Edited copy of a member (88 corresponding lines) davarocr/davar_ie/models/backbones/chargrid_backbone.py:22 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:22-118 | davarocr/davar_ie/models/necks/chargrid_neck.py:26-113 — These two members are one piece of code written twice and then edited apart: 88 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 · Edited copy of a member (104 corresponding lines) · ×1
  • Edited copy of a member (104 corresponding lines) davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:345 — davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:345-450 | davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py:59-162 — These two members are one piece of code written twice and then edited apart: 104 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 · Edited copy of a member (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) davarocr/davar_common/datasets/sampler/davar_sampler.py:139 — davarocr/davar_common/datasets/sampler/davar_sampler.py:139-213 | davarocr/davar_common/datasets/sampler/davar_sampler.py:252-341 — These two members are one piece of code written twice and then edited apart: 75 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 · Edited copy of a member (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) davarocr/davar_det/datasets/text_det_dataset.py:58 — davarocr/davar_det/datasets/text_det_dataset.py:58-138 | davarocr/davar_spotting/datasets/text_spot_dataset.py:64-158 — These two members are one piece of code written twice and then edited apart: 81 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 · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) davarocr/davar_common/datasets/pipelines/davar_loading.py:316 — davarocr/davar_common/datasets/pipelines/davar_loading.py:316-367 | davarocr/davar_common/datasets/pipelines/davar_loading.py:474-530 — These two members are one piece of code written twice and then edited apart: 52 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 · Edited copy of a member (72 corresponding lines) · ×1
  • Edited copy of a member (72 corresponding lines) davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:50 — davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:50-121 | davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:124-202 — These two members are one piece of code written twice and then edited apart: 72 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 · Edited copy of a member (83 corresponding lines) · ×1
  • Edited copy of a member (83 corresponding lines) davarocr/davar_rcg/models/recognizors/rf_learning.py:176 — davarocr/davar_rcg/models/recognizors/rf_learning.py:176-258 | davarocr/davar_rcg/models/recognizors/rf_learning.py:265-350 — These two members are one piece of code written twice and then edited apart: 83 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 · Edited copy of a member (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) davarocr/davar_rcg/models/backbones/ResNetRFL.py:138 — davarocr/davar_rcg/models/backbones/ResNetRFL.py:138-182 | davarocr/davar_videotext/models/backbones/ResNet32.py:48-94 — These two members are one piece of code written twice and then edited apart: 45 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 · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) davarocr/davar_common/datasets/pipelines/davar_loading.py:764 — davarocr/davar_common/datasets/pipelines/davar_loading.py:764-806 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:330-367 — These two members are one piece of code written twice and then edited apart: 38 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 · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) davarocr/davar_common/core/evaluation/davar_eval_hook.py:154 — davarocr/davar_common/core/evaluation/davar_eval_hook.py:154-184 | davarocr/davar_common/core/evaluation/davar_eval_hook.py:187-220 — These two members are one piece of code written twice and then edited apart: 31 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 · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) davarocr/davar_common/datasets/pipelines/transforms.py:62 — davarocr/davar_common/datasets/pipelines/transforms.py:62-83 | davarocr/davar_common/datasets/pipelines/transforms.py:86-110 — These two members are one piece of code written twice and then edited apart: 22 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 · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) davarocr/davar_table/datasets/pipelines/ctunet_loading.py:109 — davarocr/davar_table/datasets/pipelines/ctunet_loading.py:109-144 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:269-308 — These two members are one piece of code written twice and then edited apart: 36 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 · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) davarocr/davar_rcg/models/sequence_heads/att_head.py:279 — davarocr/davar_rcg/models/sequence_heads/att_head.py:279-306 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:327-363 — These two members are one piece of code written twice and then edited apart: 28 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 · Edited copy of a member (11 corresponding lines) · ×1
  • Edited copy of a member (11 corresponding lines) davarocr/davar_ie/models/backbones/chargrid_backbone.py:121 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:121-137 | davarocr/davar_ie/models/necks/chargrid_neck.py:116-126 — These two members are one piece of code written twice and then edited apart: 11 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 · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) davarocr/davar_common/core/evaluation/davar_eval_hook.py:41 — davarocr/davar_common/core/evaluation/davar_eval_hook.py:41-74 | davarocr/davar_common/core/evaluation/davar_eval_hook.py:237-272 — These two members are one piece of code written twice and then edited apart: 34 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 · Edited copy of a member (14 corresponding lines) · ×1
  • Edited copy of a member (14 corresponding lines) davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:371 — davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:371-385 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:411-424 — These two members are one piece of code written twice and then edited apart: 14 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 · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) davarocr/davar_rcg/models/sequence_heads/ctc_head.py:114 — davarocr/davar_rcg/models/sequence_heads/ctc_head.py:114-137 | davarocr/davar_rcg/models/sequence_heads/warpctc_head.py:130-154 — These two members are one piece of code written twice and then edited apart: 24 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 · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) davarocr/davar_common/datasets/davar_custom.py:155 — davarocr/davar_common/datasets/davar_custom.py:155-180 | davarocr/davar_layout/datasets/mm_layout_dataset.py:109-135 | davarocr/davar_videotext/datasets/multi_frame_dataset.py:157-183 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) davarocr/davar_rcg/models/connects/stack_block.py:29 — davarocr/davar_rcg/models/connects/stack_block.py:29-48 | davarocr/davar_rcg/models/connects/stack_block.py:112-131 — These two members are one piece of code written twice and then edited apart: 20 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 · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:239 — davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:239-262 | davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:311-332 | davarocr/davar_rcg/datasets/pipelines/davar_loading_json.py:385-407 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:62 — davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:62-80 | davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:112-132 — These two members are one piece of code written twice and then edited apart: 19 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 · Edited copy of a member (12 corresponding lines) · ×1
  • Edited copy of a member (12 corresponding lines) davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:25 — davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:25-36 | davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:87-102 — These two members are one piece of code written twice and then edited apart: 12 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 · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) davarocr/davar_det/models/seg_heads/tp_head.py:133 — davarocr/davar_det/models/seg_heads/tp_head.py:133-142 | davarocr/davar_spotting/models/seg_heads/centerline_seg_head.py:98-102 — These two members are one piece of code written twice and then edited apart: 5 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 · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) davarocr/davar_spotting/models/connect_modules/att_fuse_module.py:59 — davarocr/davar_spotting/models/connect_modules/att_fuse_module.py:59-75 | davarocr/davar_spotting/models/seg_heads/centerline_seg_head.py:126-140 | davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:173-188 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (75 lines × 2) · ×1
  • Duplicated block (75 lines × 2) davarocr/davar_ie/models/losses/crf.py:264 — davarocr/davar_ie/models/losses/crf.py:264-338 | davarocr/davar_ner/models/decoders/layers/crf.py:260-334 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (49–50 lines × 2) · ×1
  • Duplicated block (49–50 lines × 2) davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:30 — davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:30-79 | davarocr/davar_table/models/roi_heads/lgpma_roi_head.py:37-85 — 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 `davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:30` 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 first that the copies are not typed on the same thing: `StandardRoIHead` names `mmdet.models.roi_heads` in one and `mmdet.models.roi_heads.standard_roi_head` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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 (78 lines × 2) · ×1
  • Duplicated block (78 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:16 — davarocr/davar_det/core/evaluation/hmean.py:16-93 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:16-93 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_det/core/evaluation/hmean.py:16` 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 (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) davarocr/davar_ie/models/losses/crf.py:71 — davarocr/davar_ie/models/losses/crf.py:71-115 | davarocr/davar_ner/models/decoders/layers/crf.py:67-111 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. 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 (42–43 lines × 2) · ×1
  • Duplicated block (42–43 lines × 2) davarocr/davar_ie/models/infor_extrators/trie/trie.py:260 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:260-302 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:201-242 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 175 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 `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 (80 lines × 2) · ×1
  • Duplicated block (80 lines × 2) davarocr/davar_ie/models/losses/crf.py:347 — davarocr/davar_ie/models/losses/crf.py:347-426 | davarocr/davar_ner/models/decoders/layers/crf.py:343-422 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) davarocr/davar_ie/models/losses/crf.py:216 — davarocr/davar_ie/models/losses/crf.py:216-256 | davarocr/davar_ner/models/decoders/layers/crf.py:212-252 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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–39 lines × 2) · ×1
  • Duplicated block (25–39 lines × 2) davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:116 — davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:116-140 | davarocr/davar_table/models/roi_heads/lgpma_roi_head.py:94-132 — 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 `davarocr/davar_layout/models/heads/standard_roi_head_w_gcn.py:116` 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 (32–38 lines × 3) · ×1
  • Duplicated block (32–38 lines × 3) davarocr/davar_ie/models/infor_extrators/trie/trie.py:159 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:159-192 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:141-172 | davarocr/davar_table/models/understanding_detectors/ctunet.py:184-221 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 175 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 `davarocr/davar_ie/models/infor_extrators/trie/trie.py:159` 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 (35–37 lines × 2) · ×1
  • Duplicated block (35–37 lines × 2) davarocr/davar_ie/models/infor_extrators/trie/trie.py:48 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:48-84 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:46-80 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_order/models/reading_order_detectors/gcn_pn.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (33–34 lines × 3) · ×1
  • Duplicated block (33–34 lines × 3) davarocr/davar_distill/models/distillation/base.py:115 — davarocr/davar_distill/models/distillation/base.py:115-148 | davarocr/davar_nlp_common/models/models/encoder_decoder.py:98-130 | davarocr/davar_rcg/models/recognizors/base.py:149-182 — 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. 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 (32–34 lines × 3) · ×1
  • Duplicated block (32–34 lines × 3) davarocr/davar_rcg/core/converters/att_converter.py:47 — davarocr/davar_rcg/core/converters/att_converter.py:47-78 | davarocr/davar_rcg/core/converters/bert_converter.py:45-76 | davarocr/davar_rcg/core/converters/rfl_converter.py:45-78 — before extracting anything, compare `davarocr/davar_rcg/core/converters/att_converter.py` and `davarocr/davar_rcg/core/converters/bert_converter.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) davarocr/davar_ie/models/losses/crf.py:121 — davarocr/davar_ie/models/losses/crf.py:121-151 | davarocr/davar_ner/models/decoders/layers/crf.py:117-147 — before extracting anything, compare `davarocr/davar_ie/models/losses/crf.py` and `davarocr/davar_ner/models/decoders/layers/crf.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 337 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. 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–30 lines × 2) · ×1
  • Duplicated block (23–30 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:217 — davarocr/davar_det/core/evaluation/hmean.py:217-246 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:244-266 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:85 — davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:85-113 | davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:167-196 — 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 `davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:85` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:162` calls `score_map_sigmoid`, `score_map` and `davarocr/davar_videotext/models/seg_heads/spatial_tempo_east_head.py:82` 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 (23–29 lines × 5) · ×1
  • Duplicated block (23–29 lines × 5) davarocr/davar_ie/models/infor_extrators/trie/trie.py:181 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:181-207 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:161-187 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:140-162 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:262-290 | davarocr/davar_table/models/understanding_detectors/ctunet.py:210-236 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 175 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 `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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:135` calls `deepcopy` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:258` 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 (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) davarocr/davar_common/datasets/sampler/davar_sampler.py:157 — davarocr/davar_common/datasets/sampler/davar_sampler.py:157-184 | davarocr/davar_common/datasets/sampler/davar_sampler.py:281-309 — 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 (27–28 lines × 3) · ×1
  • Duplicated block (27–28 lines × 3) davarocr/davar_rcg/models/backbones/ResNet32.py:215 — davarocr/davar_rcg/models/backbones/ResNet32.py:215-241 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:85-111 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:236-263 — before extracting anything, compare `davarocr/davar_rcg/models/backbones/ResNet32.py` and `davarocr/davar_rcg/models/backbones/ResNetRFL.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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 `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 (26–28 lines × 3) · ×1
  • Duplicated block (26–28 lines × 3) davarocr/davar_rcg/models/backbones/ResNet32.py:244 — davarocr/davar_rcg/models/backbones/ResNet32.py:244-269 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:266-291 | davarocr/davar_videotext/models/backbones/ResNet32.py:48-75 — before extracting anything, compare `davarocr/davar_rcg/models/backbones/ResNet32.py` and `davarocr/davar_rcg/models/backbones/ResNetRFL.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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 (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) davarocr/davar_common/datasets/pipelines/davar_loading.py:764 — davarocr/davar_common/datasets/pipelines/davar_loading.py:764-791 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:330-355 — before extracting anything, compare `davarocr/davar_common/datasets/pipelines/davar_loading.py` and `davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22–28 lines × 2) · ×1
  • Duplicated block (22–28 lines × 2) davarocr/davar_rcg/models/sequence_heads/att_head.py:279 — davarocr/davar_rcg/models/sequence_heads/att_head.py:279-300 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:327-354 — 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 (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) davarocr/davar_common/datasets/pipelines/davar_loading.py:832 — davarocr/davar_common/datasets/pipelines/davar_loading.py:832-858 | davarocr/davar_table/datasets/pipelines/ctunet_loading.py:109-135 — 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 (20–26 lines × 5) · ×1
  • Duplicated block (20–26 lines × 5) davarocr/davar_ie/models/infor_extrators/trie/trie.py:363 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:363-382 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:330-354 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:406-431 | davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py:118-143 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:201-225 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) davarocr/davar_common/datasets/davar_custom.py:183 — davarocr/davar_common/datasets/davar_custom.py:183-207 | davarocr/davar_videotext/datasets/multi_frame_dataset.py:125-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. 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 (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) davarocr/davar_rcg/models/transformations/gaspin_transformation.py:122 — davarocr/davar_rcg/models/transformations/gaspin_transformation.py:122-145 | davarocr/davar_rcg/models/transformations/spin_transformation.py:228-253 — before extracting anything, compare `davarocr/davar_rcg/models/transformations/gaspin_transformation.py` and `davarocr/davar_rcg/models/transformations/spin_transformation.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 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. 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) davarocr/davar_layout/models/vsr/vsr.py:282 — davarocr/davar_layout/models/vsr/vsr.py:282-306 | davarocr/davar_layout/models/vsr/vsr.py:393-416 — 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 (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:245 — davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:245-269 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:201-223 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py` and `davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 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 `davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:245` 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. 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) davarocr/davar_rcg/models/recognizors/rf_learning.py:191 — davarocr/davar_rcg/models/recognizors/rf_learning.py:191-214 | davarocr/davar_rcg/models/recognizors/rf_learning.py:282-305 — 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 (16–23 lines × 3) · ×1
  • Duplicated block (16–23 lines × 3) davarocr/davar_det/models/seg_heads/tp_head.py:94 — davarocr/davar_det/models/seg_heads/tp_head.py:94-109 | davarocr/davar_spotting/models/seg_heads/centerline_seg_head.py:66-88 | davarocr/davar_table/models/seg_heads/gpma_mask_head.py:67-82 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_det/models/seg_heads/tp_head.py:94` 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 (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:164 — davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:164-211 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:240-287 — 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 (21–22 lines × 5) · ×1
  • Duplicated block (21–22 lines × 5) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:150 — davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:150-171 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:222-242 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:249-270 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:304-325 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:120-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:172` calls `update` and `davarocr/davar_ie/models/infor_extrators/trie/trie.py:244` does not — after which the two agree again for 4 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–21 lines × 6) · ×1
  • Duplicated block (17–21 lines × 6) davarocr/davar_ie/models/infor_extrators/trie/trie.py:183 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:183-202 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:163-182 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:142-158 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:265-285 | davarocr/davar_table/models/detectors/lgpma.py:115-133 | davarocr/davar_table/models/understanding_detectors/ctunet.py:212-231 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 175 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–21 lines × 3) · ×1
  • Duplicated block (20–21 lines × 3) davarocr/davar_common/datasets/pipelines/davar_loading.py:280 — davarocr/davar_common/datasets/pipelines/davar_loading.py:280-300 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:154-173 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:145-165 — before extracting anything, compare `davarocr/davar_common/datasets/pipelines/davar_loading.py` and `davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_common/datasets/pipelines/davar_loading.py:278` calls `get` and `davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:152` 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–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) davarocr/davar_ie/models/infor_extrators/trie/trie.py:209 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:209-229 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:353-369 — 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 (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) davarocr/davar_table/core/post_processing/post_lgpma.py:160 — davarocr/davar_table/core/post_processing/post_lgpma.py:160-180 | davarocr/davar_table/core/post_processing/post_lgpma.py:184-204 — 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 (18–19 lines × 4) · ×1
  • Duplicated block (18–19 lines × 4) davarocr/davar_rcg/models/backbones/ResNet32.py:38 — davarocr/davar_rcg/models/backbones/ResNet32.py:38-56 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:114-132 | davarocr/davar_rcg/models/backbones/VGG7.py:77-95 | davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:39-56 — before extracting anything, compare `davarocr/davar_rcg/models/backbones/ResNet32.py` and `davarocr/davar_rcg/models/backbones/ResNetRFL.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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 (14–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:143 — davarocr/davar_rcg/datasets/davar_rcg_dataset.py:143-156 | davarocr/davar_rcg/datasets/davar_rcg_dataset.py:170-188 — 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–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) davarocr/davar_rcg/models/recognizors/general.py:245 — davarocr/davar_rcg/models/recognizors/general.py:245-263 | davarocr/davar_videotext/models/recognizors/text_recommender.py:169-184 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_videotext/models/recognizors/text_recommender.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) davarocr/davar_rcg/models/sequence_heads/ace_head.py:60 — davarocr/davar_rcg/models/sequence_heads/ace_head.py:60-77 | davarocr/davar_rcg/models/sequence_heads/att_head.py:76-93 | davarocr/davar_rcg/models/sequence_heads/counting_head.py:64-81 | davarocr/davar_rcg/models/sequence_heads/warpctc_head.py:69-86 — 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 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9–18 lines × 4) · ×1
  • Duplicated block (9–18 lines × 4) davarocr/davar_rcg/models/transformations/gaspin_transformation.py:78 — davarocr/davar_rcg/models/transformations/gaspin_transformation.py:78-88 | davarocr/davar_rcg/models/transformations/gaspin_transformation.py:94-102 | davarocr/davar_rcg/models/transformations/spin_transformation.py:157-174 | davarocr/davar_rcg/models/transformations/spin_transformation.py:200-215 — before extracting anything, compare `davarocr/davar_rcg/models/transformations/gaspin_transformation.py` and `davarocr/davar_rcg/models/transformations/spin_transformation.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 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 `davarocr/davar_rcg/models/transformations/gaspin_transformation.py:78` 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, `davarocr/davar_rcg/models/transformations/gaspin_transformation.py:102` calls `Conv2d` and `davarocr/davar_rcg/models/transformations/gaspin_transformation.py:88` 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 lines × 3) · ×1
  • Duplicated block (18 lines × 3) davarocr/davar_det/core/evaluation/hmean.py:183 — davarocr/davar_det/core/evaluation/hmean.py:183-200 | demo/text_detection/evaluation/script.py:219-236 | demo/text_spotting/evaluation/script.py:167-184 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `demo/text_detection/evaluation/script.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (15–17 lines × 5) · ×1
  • Duplicated block (15–17 lines × 5) davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:241 — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:241-255 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:322-336 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:397-413 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:112-126 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:193-207 — before extracting anything, compare `davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 151 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:231` calls `get_target`, `loss`, `update` and `davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:318` 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 (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) davarocr/davar_rcg/core/converters/ace_converter.py:50 — davarocr/davar_rcg/core/converters/ace_converter.py:50-66 | davarocr/davar_rcg/core/converters/att_converter.py:79-94 | davarocr/davar_rcg/core/converters/bert_converter.py:77-93 — before extracting anything, compare `davarocr/davar_rcg/core/converters/att_converter.py` and `davarocr/davar_rcg/core/converters/bert_converter.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) davarocr/davar_rcg/models/recognizors/general.py:187 — davarocr/davar_rcg/models/recognizors/general.py:187-203 | davarocr/davar_rcg/models/recognizors/general.py:256-270 | davarocr/davar_rcg/models/recognizors/rf_learning.py:311-325 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_rcg/models/recognizors/rf_learning.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 94 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 `davarocr/davar_rcg/models/recognizors/general.py:187` 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) davarocr/davar_rcg/models/transformations/gaspin_transformation.py:148 — davarocr/davar_rcg/models/transformations/gaspin_transformation.py:148-163 | davarocr/davar_rcg/models/transformations/spin_transformation.py:256-272 — before extracting anything, compare `davarocr/davar_rcg/models/transformations/gaspin_transformation.py` and `davarocr/davar_rcg/models/transformations/spin_transformation.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 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 (13–16 lines × 7) · ×1
  • Duplicated block (13–16 lines × 7) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:113 — davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:113-127 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:184-199 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:164-179 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:143-155 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:266-281 | davarocr/davar_table/models/detectors/lgpma.py:116-130 | davarocr/davar_table/models/understanding_detectors/ctunet.py:213-228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:113` 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 (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) davarocr/davar_common/core/evaluation/davar_eval_hook.py:283 — davarocr/davar_common/core/evaluation/davar_eval_hook.py:283-298 | davarocr/davar_common/core/evaluation/davar_eval_hook.py:331-346 — 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. 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 (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) davarocr/davar_det/models/detectors/seg_based_det.py:56 — davarocr/davar_det/models/detectors/seg_based_det.py:56-69 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:154-169 — 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 (30–33 lines × 2) · ×1
  • Duplicated block (30–33 lines × 2) davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:110 — davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py:110-142 | davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py:92-121 — before extracting anything, compare `davarocr/davar_spotting/models/seg_heads/character_mask_att_head.py` and `davarocr/davar_spotting/models/seg_heads/instance_mask_att_head.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 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 (13–14 lines × 8) · ×1
  • Duplicated block (13–14 lines × 8) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:145 — davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:145-157 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:244-256 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:325-337 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:299-311 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:401-414 | davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py:113-126 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:115-127 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:196-208 — there are 8 copies across 5 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 8 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, `davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:142` calls `update` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:296` does not — after which the two agree again for 4 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 (19–27 lines × 4) · ×1
  • Duplicated block (19–27 lines × 4) davarocr/davar_common/datasets/pipelines/davar_loading.py:563 — davarocr/davar_common/datasets/pipelines/davar_loading.py:563-589 | davarocr/davar_common/datasets/pipelines/davar_loading.py:598-616 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:260-286 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:295-313 — before extracting anything, compare `davarocr/davar_common/datasets/pipelines/davar_loading.py` and `davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) davarocr/davar_layout/datasets/docbank_dataset.py:149 — davarocr/davar_layout/datasets/docbank_dataset.py:149-162 | davarocr/davar_layout/datasets/mm_layout_dataset.py:156-167 | davarocr/davar_layout/datasets/publaynet_dataset.py:186-198 — 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. 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 (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) davarocr/davar_rcg/models/backbones/ResNet32.py:271 — davarocr/davar_rcg/models/backbones/ResNet32.py:271-283 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:167-180 | davarocr/davar_videotext/models/backbones/ResNet32.py:79-92 — before extracting anything, compare `davarocr/davar_rcg/models/backbones/ResNet32.py` and `davarocr/davar_rcg/models/backbones/ResNetRFL.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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 (3–14 lines × 6) · ×1
  • Duplicated block (3–14 lines × 6) davarocr/davar_det/core/post_processing/post_east.py:54 — davarocr/davar_det/core/post_processing/post_east.py:54-56 | davarocr/davar_det/core/post_processing/post_tp_det.py:39-54 | davarocr/davar_det/datasets/pipelines/east_data.py:48-51 | davarocr/davar_det/datasets/pipelines/tp_data.py:46-48 | davarocr/davar_spotting/core/post_processing/post_mango.py:39-52 | davarocr/davar_table/datasets/pipelines/gpma_data.py:43-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. 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, `davarocr/davar_det/core/post_processing/post_tp_det.py:54` calls `realpath` and `davarocr/davar_det/core/post_processing/post_east.py:56` 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 (10–14 lines × 2) · ×1
  • Duplicated block (10–14 lines × 2) davarocr/davar_rcg/models/recognizors/general.py:174 — davarocr/davar_rcg/models/recognizors/general.py:174-187 | davarocr/davar_videotext/models/recognizors/text_recommender.py:110-119 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_videotext/models/recognizors/text_recommender.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) davarocr/davar_rcg/models/sequence_heads/att_head.py:164 — davarocr/davar_rcg/models/sequence_heads/att_head.py:164-175 | davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.py:189-202 — 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 (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) davarocr/davar_videotext/models/recognizors/text_recommender.py:101 — davarocr/davar_videotext/models/recognizors/text_recommender.py:101-114 | davarocr/davar_videotext/models/recognizors/text_recommender.py:161-173 — 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 (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) davarocr/davar_rcg/models/recognizors/general.py:186 — davarocr/davar_rcg/models/recognizors/general.py:186-198 | davarocr/davar_rcg/models/recognizors/general.py:255-266 | davarocr/davar_rcg/models/recognizors/rf_learning.py:219-231 | davarocr/davar_rcg/models/recognizors/rf_learning.py:310-322 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_rcg/models/recognizors/rf_learning.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 94 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_rcg/models/recognizors/rf_learning.py:232` calls `get_target` and `davarocr/davar_rcg/models/recognizors/general.py:202` 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 (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) davarocr/davar_table/core/post_processing/generate_html.py:46 — davarocr/davar_table/core/post_processing/generate_html.py:46-58 | davarocr/davar_table/core/post_processing/generate_html.py:71-83 | davarocr/davar_table/core/post_processing/generate_html.py:96-108 | davarocr/davar_table/core/post_processing/generate_html.py:127-139 — all 4 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–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) davarocr/davar_det/datasets/text_det_dataset.py:116 — davarocr/davar_det/datasets/text_det_dataset.py:116-127 | davarocr/davar_table/datasets/table_rcg_dataset.py:175-187 — before extracting anything, compare `davarocr/davar_det/datasets/text_det_dataset.py` and `davarocr/davar_table/datasets/table_rcg_dataset.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) davarocr/davar_layout/models/vsr/vsr.py:108 — davarocr/davar_layout/models/vsr/vsr.py:108-118 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:67-79 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_layout/models/vsr/vsr.py:104` calls `build_roi_extractor`, `build_head` and `davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:65` 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 (11–12 lines × 5) · ×1
  • Duplicated block (11–12 lines × 5) davarocr/davar_common/datasets/pipelines/davar_loading.py:295 — davarocr/davar_common/datasets/pipelines/davar_loading.py:295-306 | davarocr/davar_common/datasets/pipelines/transforms.py:453-463 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:169-179 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:160-171 | davarocr/davar_table/datasets/pipelines/davar_loading_table.py:210-220 — before extracting anything, compare `davarocr/davar_common/datasets/pipelines/davar_loading.py` and `davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×1
  • Duplicated block (11–12 lines × 4) davarocr/davar_rcg/core/converters/att_converter.py:44 — davarocr/davar_rcg/core/converters/att_converter.py:44-54 | davarocr/davar_rcg/core/converters/bert_converter.py:42-53 | davarocr/davar_rcg/core/converters/ctc_converter.py:45-56 | davarocr/davar_rcg/core/converters/rfl_converter.py:42-53 — before extracting anything, compare `davarocr/davar_rcg/core/converters/att_converter.py` and `davarocr/davar_rcg/core/converters/bert_converter.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) davarocr/davar_rcg/core/converters/ace_converter.py:57 — davarocr/davar_rcg/core/converters/ace_converter.py:57-68 | davarocr/davar_rcg/core/converters/att_converter.py:85-96 | davarocr/davar_rcg/core/converters/rfl_converter.py:82-93 — before extracting anything, compare `davarocr/davar_rcg/core/converters/att_converter.py` and `davarocr/davar_rcg/core/converters/rfl_converter.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 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 (4–12 lines × 3) · ×1
  • Duplicated block (4–12 lines × 3) davarocr/davar_ie/models/backbones/chargrid_backbone.py:72 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:72-75 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:79-90 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:96-107 — 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 `davarocr/davar_ie/models/backbones/chargrid_backbone.py:79` 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.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) davarocr/davar_ner/datasets/loaders/ner_loader.py:154 — davarocr/davar_ner/datasets/loaders/ner_loader.py:154-176 | davarocr/davar_ner/datasets/loaders/ner_loader.py:198-219 — 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–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) davarocr/davar_rcg/models/connects/stack_block.py:37 — davarocr/davar_rcg/models/connects/stack_block.py:37-48 | davarocr/davar_rcg/models/connects/stack_block.py:121-131 — 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 (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) davarocr/davar_det/datasets/text_det_dataset.py:120 — davarocr/davar_det/datasets/text_det_dataset.py:120-129 | davarocr/davar_spotting/datasets/text_spot_dataset.py:135-144 | davarocr/davar_table/datasets/table_rcg_dataset.py:179-189 — before extracting anything, compare `davarocr/davar_det/datasets/text_det_dataset.py` and `davarocr/davar_spotting/datasets/text_spot_dataset.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) davarocr/davar_rcg/datasets/davar_rcg_dataset.py:223 — davarocr/davar_rcg/datasets/davar_rcg_dataset.py:223-232 | davarocr/davar_videotext/datasets/yoro_rcg_dataset.py:135-145 — 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.
D4 · Code Duplication · Duplicated block (1–11 lines × 3) · ×1
  • Duplicated block (1–11 lines × 3) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:106 — davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:106-116 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:149-162 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:167-167 — 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 (10 lines × 8) · ×1
  • Duplicated block (10 lines × 8) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:112 — davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:112-124 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:183-195 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:163-175 | davarocr/davar_layout/models/vsr/vsr.py:330-342 | davarocr/davar_order/models/reading_order_detectors/gcn_pn.py:142-151 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:265-277 | davarocr/davar_table/models/detectors/lgpma.py:115-127 | davarocr/davar_table/models/understanding_detectors/ctunet.py:212-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times.
D4 · Code Duplication · Duplicated block (8–10 lines × 8) · ×1
  • Duplicated block (8–10 lines × 8) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:156 — davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:156-165 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:228-236 | davarocr/davar_rcg/models/recognizors/general.py:180-189 | davarocr/davar_rcg/models/recognizors/rf_learning.py:213-222 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:255-264 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:310-319 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:126-135 | davarocr/davar_videotext/models/recognizors/text_recommender.py:113-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_rcg/models/recognizors/general.py:174` calls `backbone`, `neck` and `davarocr/davar_rcg/models/recognizors/rf_learning.py:211` 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–10 lines × 8) · ×1
  • Duplicated block (7–10 lines × 8) davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:210 — davarocr/davar_distill/models/spotters/kd_two_stage_ete.py:210-218 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:368-374 | davarocr/davar_rcg/models/recognizors/general.py:251-257 | davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:336-345 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:413-422 | davarocr/davar_spotting/models/spotters/mask_rcnn_spot.py:125-134 | davarocr/davar_spotting/models/spotters/text_perceptron_spot.py:207-216 | davarocr/davar_videotext/models/recognizors/text_recommender.py:172-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) davarocr/davar_common/datasets/pipelines/davar_loading.py:582 — davarocr/davar_common/datasets/pipelines/davar_loading.py:582-591 | davarocr/davar_common/datasets/pipelines/davar_loading.py:609-618 | davarocr/davar_common/datasets/pipelines/davar_loading.py:688-697 | davarocr/davar_common/datasets/pipelines/davar_loading.py:716-725 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:279-288 | davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py:306-315 — before extracting anything, compare `davarocr/davar_common/datasets/pipelines/davar_loading.py` and `davarocr/davar_layout/datasets/pipelines/mm_layout_loading.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) davarocr/davar_ie/models/infor_extrators/trie/trie.py:284 — davarocr/davar_ie/models/infor_extrators/trie/trie.py:284-293 | davarocr/davar_ie/models/infor_extrators/trie/trie.py:411-419 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:224-233 | davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:306-314 — before extracting anything, compare `davarocr/davar_ie/models/infor_extrators/trie/trie.py` and `davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 175 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 (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) davarocr/davar_rcg/models/recognizors/general.py:184 — davarocr/davar_rcg/models/recognizors/general.py:184-195 | davarocr/davar_rcg/models/recognizors/rf_learning.py:217-228 | davarocr/davar_rcg/models/recognizors/rf_learning.py:308-319 | davarocr/davar_videotext/models/recognizors/text_recommender.py:117-126 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_rcg/models/recognizors/rf_learning.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 94 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_rcg/models/recognizors/rf_learning.py:232` calls `get_target` and `davarocr/davar_rcg/models/recognizors/general.py:202` 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 (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) davarocr/davar_rcg/models/recognizors/general.py:186 — davarocr/davar_rcg/models/recognizors/general.py:186-195 | davarocr/davar_rcg/models/recognizors/general.py:255-263 | davarocr/davar_rcg/models/recognizors/rf_learning.py:219-228 | davarocr/davar_rcg/models/recognizors/rf_learning.py:310-319 | davarocr/davar_videotext/models/recognizors/text_recommender.py:118-126 | davarocr/davar_videotext/models/recognizors/text_recommender.py:176-184 — before extracting anything, compare `davarocr/davar_rcg/models/recognizors/general.py` and `davarocr/davar_rcg/models/recognizors/rf_learning.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 94 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_rcg/models/recognizors/rf_learning.py:232` calls `get_target` and `davarocr/davar_rcg/models/recognizors/general.py:202` 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 (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) davarocr/davar_det/core/evaluation/hmean.py:266 — davarocr/davar_det/core/evaluation/hmean.py:266-274 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:299-306 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_det/core/evaluation/hmean.py:276` calls `empty` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py:308` 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–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) davarocr/davar_videotext/tools/filter.py:141 — davarocr/davar_videotext/tools/filter.py:141-147 | demo/videotext/evaluation/evaluate_utils.py:236-242 | demo/videotext/evaluation/evaluate_utils.py:474-481 — 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 (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) davarocr/davar_rcg/models/backbones/ResNet32.py:51 — davarocr/davar_rcg/models/backbones/ResNet32.py:51-57 | davarocr/davar_rcg/models/backbones/ResNetRFL.py:127-133 | davarocr/davar_rcg/models/connects/single_block/RFAdaptor.py:51-57 | davarocr/davar_spotting/models/backbone/light_crnn.py:78-84 — before extracting anything, compare `davarocr/davar_rcg/models/backbones/ResNet32.py` and `davarocr/davar_rcg/models/backbones/ResNetRFL.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_rcg/models/backbones/ResNet32.py:59` calls `TypeError` and `davarocr/davar_spotting/models/backbone/light_crnn.py:86` 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) davarocr/davar_ie/models/backbones/chargrid_backbone.py:78 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:78-84 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:95-101 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:112-118 — 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 `davarocr/davar_ie/models/backbones/chargrid_backbone.py:78` 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) davarocr/davar_ie/datasets/wildreceipt_dataset.py:107 — davarocr/davar_ie/datasets/wildreceipt_dataset.py:107-112 | davarocr/davar_table/datasets/ctunet_dataset.py:172-178 — 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 (5–8 lines × 3) · ×1
  • Duplicated block (5–8 lines × 3) davarocr/davar_ie/models/connects/multimodal_context_module.py:225 — davarocr/davar_ie/models/connects/multimodal_context_module.py:225-229 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:317-324 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:336-343 — before extracting anything, compare `davarocr/davar_ie/models/connects/multimodal_context_module.py` and `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 `davarocr/davar_ie/models/connects/multimodal_context_module.py:225` 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 (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) davarocr/davar_ie/models/backbones/chargrid_backbone.py:38 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:38-42 | davarocr/davar_ie/models/necks/chargrid_neck.py:84-88 | davarocr/davar_ie/models/necks/chargrid_neck.py:92-96 | davarocr/davar_ie/models/necks/chargrid_neck.py:100-104 | davarocr/davar_ie/models/necks/chargrid_neck.py:108-112 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. 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 (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) davarocr/davar_det/core/evaluation/hmean.py:270 — davarocr/davar_det/core/evaluation/hmean.py:270-274 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:302-306 | demo/text_detection/evaluation/script.py:356-360 | demo/text_spotting/evaluation/script.py:397-401 — before extracting anything, compare `davarocr/davar_det/core/evaluation/hmean.py` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `davarocr/davar_det/core/evaluation/hmean.py:276` calls `empty` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py:308` 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 (4–5 lines × 4) · ×1
  • Duplicated block (4–5 lines × 4) davarocr/davar_ie/models/backbones/chargrid_backbone.py:55 — davarocr/davar_ie/models/backbones/chargrid_backbone.py:55-58 | davarocr/davar_ie/models/backbones/chargrid_backbone.py:61-66 | davarocr/davar_ie/models/necks/chargrid_neck.py:52-56 | davarocr/davar_ie/models/necks/chargrid_neck.py:65-69 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_ie/models/backbones/chargrid_backbone.py:61` 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 before the matched lines, `davarocr/davar_ie/models/backbones/chargrid_backbone.py:60` calls `ReLU`, `Conv2d` and `davarocr/davar_ie/models/backbones/chargrid_backbone.py:55` 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 (3–5 lines × 4) · ×1
  • Duplicated block (3–5 lines × 4) davarocr/davar_ie/models/connects/multimodal_context_module.py:222 — davarocr/davar_ie/models/connects/multimodal_context_module.py:222-225 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:313-317 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:332-336 | davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py:347-349 — before extracting anything, compare `davarocr/davar_ie/models/connects/multimodal_context_module.py` and `davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 (13 lines × 13) · ×1
  • Duplicated block (13 lines × 13) davarocr/davar_common/models/heads/cls_head.py:40 — davarocr/davar_common/models/heads/cls_head.py:40-52 | davarocr/davar_ie/models/connects/multimodal_context_module.py:77-89 | davarocr/davar_ie/models/connects/multimodal_feature_merge.py:85-97 | davarocr/davar_ie/models/embedding/embedding.py:37-49 | davarocr/davar_ie/models/embedding/node_embedding.py:60-72 | davarocr/davar_ie/models/embedding/position_embedding.py:52-64 | davarocr/davar_ie/models/embedding/sentence_embedding.py:51-63 | davarocr/davar_ie/models/heads/ner_head.py:41-53 | davarocr/davar_layout/models/embedding/bertgrid_embedding.py:45-57 | davarocr/davar_layout/models/embedding/chargrid_embedding.py:42-54 | davarocr/davar_layout/models/embedding/sentencegrid_embedding.py:49-61 | davarocr/davar_layout/models/heads/gcn_head.py:114-126 | davarocr/davar_table/models/cls_heads/table_cls_head.py:59-71 — before extracting anything, compare `davarocr/davar_common/models/heads/cls_head.py` and `davarocr/davar_table/models/cls_heads/table_cls_head.py` as WHOLE FILES: 84% 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 2 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `davarocr/davar_ie/models/connects/multimodal_feature_merge.py:82` calls `AdaptiveAvgPool2d` and `davarocr/davar_ie/models/embedding/node_embedding.py:57` 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 (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) davarocr/davar_det/datasets/text_det_dataset.py:32 — davarocr/davar_det/datasets/text_det_dataset.py:32-51 | davarocr/davar_spotting/datasets/text_spot_dataset.py:33-57 — before extracting anything, compare `davarocr/davar_det/datasets/text_det_dataset.py` and `davarocr/davar_spotting/datasets/text_spot_dataset.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) davarocr/davar_det/models/detectors/east.py:30 — davarocr/davar_det/models/detectors/east.py:30-40 | davarocr/davar_det/models/detectors/text_perceptron_det.py:30-41 | davarocr/davar_layout/models/connects/mm_layout_feature_merge.py:27-44 — 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. 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 (13 lines × 6) · ×1
  • Duplicated block (13 lines × 6) davarocr/davar_distill/models/distillation/base.py:151 — davarocr/davar_distill/models/distillation/base.py:151-183 | davarocr/davar_distill/models/distillation/base.py:186-208 | davarocr/davar_nlp_common/models/models/encoder_decoder.py:133-165 | davarocr/davar_nlp_common/models/models/encoder_decoder.py:168-180 | davarocr/davar_rcg/models/recognizors/base.py:185-217 | davarocr/davar_rcg/models/recognizors/base.py:220-242 — there are 6 copies across 3 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 6 sites; resolving a subset leaves the remainder to drift apart. 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 (18 lines × 7) · ×1
  • Duplicated block (18 lines × 7) davarocr/davar_videotext/datasets/pipelines/formating.py:80 — davarocr/davar_videotext/datasets/pipelines/formating.py:80-100 | davarocr/davar_videotext/datasets/pipelines/loading.py:22-42 | davarocr/davar_videotext/datasets/pipelines/loading.py:51-72 | davarocr/davar_videotext/datasets/pipelines/transforms.py:192-211 | davarocr/davar_videotext/datasets/pipelines/transforms.py:233-250 | davarocr/davar_videotext/datasets/pipelines/transforms.py:263-283 | davarocr/davar_videotext/datasets/pipelines/transforms.py:296-315 — there are 7 copies across 3 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 7 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 (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:250 — davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:250-260 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:278-288 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:413-423 | davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:443-453 — all 4 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 · Edited copy of a member (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) demo/text_detection/evaluation/rrc_evaluation_funcs.py:252 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:252-308 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:348-404 — These two members are one piece of code written twice and then edited apart: 57 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 · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:38 — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:38-97 | davarocr/davar_spotting/models/spotters/base/two_stage_e2e.py:43-115 — These two members are one piece of code written twice and then edited apart: 60 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 · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) demo/text_detection/evaluation/rrc_evaluation_funcs.py:184 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:184-187 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:265-268 — These two members are one piece of code written twice and then edited apart: 4 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 · Duplicated block (70–77 lines × 2) · ×1
  • Duplicated block (70–77 lines × 2) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:126 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:126-202 | demo/text_spotting/evaluation/script.py:189-258 — before extracting anything, compare `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_spotting/core/evaluation/e2e_hmean.py:126` 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) demo/text_detection/evaluation/rrc_evaluation_funcs.py:272 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:272-308 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:368-404 — before extracting anything, compare `demo/text_detection/evaluation/rrc_evaluation_funcs.py` and `demo/text_spotting/evaluation/rrc_evaluation_funcs.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `demo/text_detection/evaluation/rrc_evaluation_funcs.py:272` 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. 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) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:204 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:204-234 | demo/text_spotting/evaluation/script.py:260-285 — before extracting anything, compare `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `davarocr/davar_spotting/core/evaluation/e2e_hmean.py:204` 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 (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:304 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:304-333 | demo/text_spotting/evaluation/script.py:399-428 — before extracting anything, compare `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `demo/text_spotting/evaluation/script.py:394` calls `str` and `davarocr/davar_spotting/core/evaluation/e2e_hmean.py:300` 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 (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) demo/videotext/evaluation/evaluate_mot.py:193 — demo/videotext/evaluation/evaluate_mot.py:193-217 | demo/videotext/evaluation/evaluate_mot.py:236-256 — 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 (19–24 lines × 2) · ×1
  • Duplicated block (19–24 lines × 2) demo/text_detection/evaluation/script.py:267 — demo/text_detection/evaluation/script.py:267-290 | demo/text_spotting/evaluation/script.py:312-330 — before extracting anything, compare `demo/text_detection/evaluation/script.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21–22 lines × 4) · ×1
  • Duplicated block (21–22 lines × 4) demo/text_detection/evaluation/rrc_evaluation_funcs.py:19 — demo/text_detection/evaluation/rrc_evaluation_funcs.py:19-39 | demo/text_detection/evaluation/rrc_evaluation_funcs.py:46-67 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:18-38 | demo/text_spotting/evaluation/rrc_evaluation_funcs.py:45-66 — before extracting anything, compare `demo/text_detection/evaluation/rrc_evaluation_funcs.py` and `demo/text_spotting/evaluation/rrc_evaluation_funcs.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–21 lines × 4) · ×1
  • Duplicated block (15–21 lines × 4) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:159 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:159-179 | davarocr/davar_spotting/core/evaluation/e2e_hmean.py:212-232 | demo/text_spotting/evaluation/script.py:222-236 | demo/text_spotting/evaluation/script.py:268-283 — before extracting anything, compare `davarocr/davar_spotting/core/evaluation/e2e_hmean.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) demo/text_detection/evaluation/script.py:65 — demo/text_detection/evaluation/script.py:65-81 | demo/text_spotting/evaluation/script.py:62-76 — before extracting anything, compare `demo/text_detection/evaluation/script.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–14 lines × 3) · ×1
  • Duplicated block (9–14 lines × 3) davarocr/davar_spotting/core/evaluation/e2e_hmean.py:343 — davarocr/davar_spotting/core/evaluation/e2e_hmean.py:343-351 | demo/text_detection/evaluation/script.py:476-489 | demo/text_spotting/evaluation/script.py:489-497 — 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 (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) demo/text_detection/evaluation/script.py:314 — demo/text_detection/evaluation/script.py:314-323 | demo/text_spotting/evaluation/script.py:360-368 — before extracting anything, compare `demo/text_detection/evaluation/script.py` and `demo/text_spotting/evaluation/script.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) demo/text_spotting/mango/tools/show_masks.py:38 — demo/text_spotting/mango/tools/show_masks.py:38-43 | demo/text_spotting/mango/tools/show_masks.py:85-90 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:38-43 | demo/text_spotting/mask_rcnn_spot/tools/show_masks.py:85-90 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:38-43 | demo/text_spotting/text_perceptron_spot/tools/show_masks.py:85-90 — before extracting anything, compare `demo/text_spotting/mango/tools/show_masks.py` and `demo/text_spotting/mask_rcnn_spot/tools/show_masks.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
P1 · CI/CD gates · No CI pipeline · ×1
  • No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
Minor — 235 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×169
  • Orphaned file davarocr/davar_rcg/datasets/davar_rcg_dataset.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 davarocr/davar_table/models/understanding_detectors/ctunet.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 davarocr/davar_layout/datasets/pipelines/mm_layout_loading.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 davarocr/davar_layout/models/vsr/vsr.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 davarocr/davar_ie/models/losses/crf.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 davarocr/davar_ner/models/decoders/layers/crf.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 davarocr/davar_ner/core/converters/transformers_converter.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 davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.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 davarocr/davar_spotting/models/seg_heads/grid_category_head.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 davarocr/davar_videotext/tools/merge_seq.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 davarocr/davar_layout/datasets/publaynet_dataset.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 davarocr/davar_common/datasets/sampler/davar_sampler.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 davarocr/davar_ie/models/infor_extrators/trie/trie.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 davarocr/davar_distill/models/distillation/spot_res_distill.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 davarocr/davar_table/core/post_processing/post_lgpma.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 davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_rcg/datasets/pipelines/davar_loading_json.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 davarocr/davar_common/datasets/davar_custom.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 davarocr/davar_videotext/models/seg_heads/yoro_recommender_head.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 davarocr/davar_spotting/core/evaluation/e2e_hmean.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 davarocr/davar_table/datasets/pipelines/davar_loading_table.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 davarocr/davar_rcg/models/transformations/spin_transformation.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 davarocr/davar_ie/models/infor_extrators/trie/trie_gt.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 davarocr/davar_spotting/models/spotters/mango.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 davarocr/davar_common/core/evaluation/davar_eval_hook.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.
  • + 144 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×35
  • Duplicated predicate davarocr/davar_rcg/core/converters/ace_converter.py:62 — `".json" in character or ".txt" in character` appears character-identically in 5 files — davarocr/davar_rcg/core/converters/ace_converter.py, davarocr/davar_rcg/core/converters/att_converter.py, davarocr/davar_rcg/core/converters/bert_converter.py, davarocr/davar_rcg/core/converters/ctc_converter.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 davarocr/davar_common/datasets/davar_custom.py:202 — `'bboxes' in ann and len(ann['bboxes']) == 0` appears character-identically in 2 files — davarocr/davar_common/datasets/davar_custom.py, davarocr/davar_videotext/datasets/multi_frame_dataset.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 davarocr/davar_common/datasets/davar_custom.py:202 — `'cares' in ann and 1 not in ann['cares']` appears character-identically in 2 files — davarocr/davar_common/datasets/davar_custom.py, davarocr/davar_videotext/datasets/multi_frame_dataset.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 davarocr/davar_common/datasets/pipelines/davar_loading.py:572 — `'classes' in results['classes_config'] or 'classes_0' in results['classes_config']` appears character-identically in 2 files — davarocr/davar_common/datasets/pipelines/davar_loading.py, davarocr/davar_layout/datasets/pipelines/mm_layout_loading.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 davarocr/davar_common/datasets/pipelines/davar_loading.py:582 — `('NotLabeled' in classes_config) or ('NoLabel' in classes_config)` appears character-identically in 2 files — davarocr/davar_common/datasets/pipelines/davar_loading.py, davarocr/davar_layout/datasets/pipelines/mm_layout_loading.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 davarocr/davar_common/datasets/davar_custom.py:201 — `ann is not None and self.filter_empty_gt` appears character-identically in 2 files — davarocr/davar_common/datasets/davar_custom.py, davarocr/davar_videotext/datasets/multi_frame_dataset.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 davarocr/davar_distill/models/distillation/base.py:143 — `dist.is_available() and dist.is_initialized()` appears character-identically in 3 files — davarocr/davar_distill/models/distillation/base.py, davarocr/davar_nlp_common/models/models/encoder_decoder.py, davarocr/davar_rcg/models/recognizors/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 davarocr/davar_det/datasets/text_det_dataset.py:84 — `eval_func_params is not None and isinstance(eval_func_params, dict)` appears character-identically in 3 files — davarocr/davar_det/datasets/text_det_dataset.py, davarocr/davar_spotting/datasets/text_spot_dataset.py, davarocr/davar_table/datasets/table_rcg_dataset.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 davarocr/davar_det/core/evaluation/hmean.py:289 — `gtRectMat[gtNum] == 0 and detRectMat[detNum] == 0 and gtNum not in gtDontCarePolsNum and detNum not in detDontCarePolsNum` appears character-identically in 2 files — davarocr/davar_det/core/evaluation/hmean.py, davarocr/davar_spotting/core/evaluation/e2e_hmean.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 davarocr/davar_ie/models/infor_extrators/trie/trie.py:102 — `hasattr(self, 'infor_context_module') and self.infor_context_module is not None` appears character-identically in 3 files — davarocr/davar_ie/models/infor_extrators/trie/trie.py, davarocr/davar_order/models/reading_order_detectors/gcn_pn.py, davarocr/davar_table/models/understanding_detectors/ctunet.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 davarocr/davar_ie/models/infor_extrators/trie/trie.py:111 — `hasattr(self, 'infor_node_cls_head') and self.infor_node_cls_head is not None` appears character-identically in 3 files — davarocr/davar_ie/models/infor_extrators/trie/trie.py, davarocr/davar_order/models/reading_order_detectors/gcn_pn.py, davarocr/davar_table/models/understanding_detectors/ctunet.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 davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:118 — `hasattr(self, 'infor_roi_extractor') and self.infor_roi_extractor is not None` appears character-identically in 3 files — davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py, davarocr/davar_order/models/reading_order_detectors/gcn_pn.py, davarocr/davar_table/models/understanding_detectors/ctunet.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 davarocr/davar_rcg/models/recognizors/general.py:117 — `hasattr(self, 'neck') and self.neck is not None` appears character-identically in 3 files — davarocr/davar_rcg/models/recognizors/general.py, davarocr/davar_rcg/models/recognizors/rf_learning.py, davarocr/davar_spotting/models/spotters/base/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 davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py:127 — `hasattr(self, 'raw_text_embedding') and self.raw_text_embedding is not None` appears character-identically in 2 files — davarocr/davar_ie/models/infor_extrators/trie/trie_gt.py, davarocr/davar_table/models/understanding_detectors/ctunet.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 davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:151 — `hasattr(self, 'recog_backbone') and self.recog_backbone is not None` appears character-identically in 2 files — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py, davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:142 — `hasattr(self, 'recog_neck') and self.recog_neck is not None` appears character-identically in 2 files — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py, davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:106 — `hasattr(self, 'recog_roi_extractor') and self.recog_roi_extractor is not None` appears character-identically in 2 files — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py, davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:115 — `hasattr(self, 'recog_sequence_head') and self.recog_sequence_head is not None` appears character-identically in 2 files — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py, davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py:124 — `hasattr(self, 'recog_sequence_module') and self.recog_sequence_module is not None` appears character-identically in 2 files — davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py, davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_spotting/models/spotters/base/base.py:33 — `hasattr(self, 'recog_transformation') and self.recog_transformation is not None` appears character-identically in 3 files — davarocr/davar_spotting/models/spotters/base/base.py, davarocr/davar_spotting/models/spotters/base/seg_based_e2e.py, davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_layout/models/vsr/vsr.py:173 — `hasattr(self, 'rpn_head') and self.rpn_head is not None` appears character-identically in 2 files — davarocr/davar_layout/models/vsr/vsr.py, davarocr/davar_spotting/models/spotters/base/two_stage_e2e.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 davarocr/davar_rcg/models/recognizors/general.py:126 — `hasattr(self, 'sequence_module') and self.sequence_module is not None` appears character-identically in 2 files — davarocr/davar_rcg/models/recognizors/general.py, davarocr/davar_rcg/models/recognizors/rf_learning.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 davarocr/davar_ie/models/connects/multimodal_context_module.py:74 — `hasattr(self, 'textual_relation_module') and self.textual_relation_module is not None` appears character-identically in 2 files — davarocr/davar_ie/models/connects/multimodal_context_module.py, davarocr/davar_ie/models/connects/multimodal_context_module_plusplus.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 davarocr/davar_rcg/models/recognizors/base.py:39 — `hasattr(self, 'transformation') and self.transformation is not None` appears character-identically in 3 files — davarocr/davar_rcg/models/recognizors/base.py, davarocr/davar_rcg/models/recognizors/general.py, davarocr/davar_rcg/models/recognizors/rf_learning.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 davarocr/davar_common/datasets/pipelines/davar_loading.py:570 — `len(gt_labels) > 0 and isinstance(gt_labels[0], str)` appears character-identically in 2 files — davarocr/davar_common/datasets/pipelines/davar_loading.py, davarocr/davar_layout/datasets/pipelines/mm_layout_loading.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.
  • + 10 more in this group — see findings.md.
M4 · Documentation accuracy · README/code drift · ×14
  • README/code drift demo/ner/BERT/readme.md:32 — demo/ner/BERT/readme.md links to `./configs/bert_softmax.py`, but `demo/ner/BERT/configs/bert_softmax.py` does not exist. 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 demo/ner/BERT/readme.md:33 — demo/ner/BERT/readme.md links to `./configs/bert_span.py`, but `demo/ner/BERT/configs/bert_span.py` does not exist. 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 demo/ner/BERT/readme.md:34 — demo/ner/BERT/readme.md links to `./configs/bert_crf.py`, but `demo/ner/BERT/configs/bert_crf.py` does not exist. 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 demo/ner/bilstm_crf/readme.md:30 — demo/ner/bilstm_crf/readme.md links to `./configs/bilstm_crf.py`, but `demo/ner/bilstm_crf/configs/bilstm_crf.py` does not exist. 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 demo/text_detection/east/readme.md:33 — demo/text_detection/east/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist. 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 demo/text_detection/mask_rcnn_det/readme.md:33 — demo/text_detection/mask_rcnn_det/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist. 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 demo/text_detection/text_perceptron_det/readme.md:36 — demo/text_detection/text_perceptron_det/readme.md links to `../evalution/`, but `demo/text_detection/evalution` does not exist. 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 demo/text_spotting/dld/readme.md:40 — demo/text_spotting/dld/readme.md links to `../evalution/`, but `demo/text_spotting/evalution` does not exist. 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 demo/text_spotting/mango/readme.md:43 — demo/text_spotting/mango/readme.md links to `../evalution/`, but `demo/text_spotting/evalution` does not exist. 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 demo/text_spotting/mask_rcnn_spot/readme.md:41 — demo/text_spotting/mask_rcnn_spot/readme.md links to `../evalution/`, but `demo/text_spotting/evalution` does not exist. 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 demo/videotext/yoro/readme.md:126 — demo/videotext/yoro/readme.md links to `demo/text_detection/evaluation/`, but `demo/videotext/yoro/demo/text_detection/evaluation` does not exist. 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 demo/videotext/yoro/readme.md:129 — demo/videotext/yoro/readme.md links to `demo/videotext/evaluation/`, but `demo/videotext/yoro/demo/videotext/evaluation` does not exist. 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 demo/videotext/yoro/readme.md:144 — demo/videotext/yoro/readme.md links to `config/yoro_east.py`, but `demo/videotext/yoro/config/yoro_east.py` does not exist. 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 demo/videotext/yoro/readme.md:153 — demo/videotext/yoro/readme.md links to `demo/videotext/yoro/rcg/config/ic15_qscore_rgb_res32_bilstm_attn.py`, but `demo/videotext/yoro/demo/videotext/yoro/rcg/config/ic15_qscore_rgb_res32_bilstm_attn.py` does not exist. 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 in catch · ×8
  • Silent fallback default in catch davarocr/davar_det/core/evaluation/hmean.py:93 — `get_intersection_over_union` (in `evaluate_method`) swallows every exception into `return 0` — 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.
  • Silent fallback default in catch davarocr/davar_det/core/evaluation/hmean.py:116 — `get_text_intersection_over_union_recall` (in `evaluate_method`) swallows every exception into `return 0` — 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.
  • Silent fallback default in catch davarocr/davar_det/core/evaluation/hmean.py:164 — `get_text_intersection_over_union_precision` (in `evaluate_method`) swallows every exception into `return 0` — 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.
  • Silent fallback default in catch davarocr/davar_table/core/post_processing/post_lgpma.py:179 — `refine_x` (in `softmasks_refine_bboxes`) 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.
  • Silent fallback default in catch davarocr/davar_table/core/post_processing/post_lgpma.py:203 — `refine_y` (in `softmasks_refine_bboxes`) 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.
  • Silent fallback default in catch demo/text_detection/evaluation/script.py:140 — `get_intersection_over_union` (in `evaluate_method`) swallows every exception into `return 0` — 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.
  • Silent fallback default in catch demo/text_detection/evaluation/script.py:158 — `get_text_intersection_over_union_recall` (in `evaluate_method`) swallows every exception into `return 0` — 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.
  • Silent fallback default in catch demo/text_detection/evaluation/script.py:201 — `get_text_intersection_over_union_precision` (in `evaluate_method`) swallows every exception into `return 0` — 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.
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file davarocr/davar_common/datasets/pipelines/davar_loading.py:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file davarocr/davar_common/datasets/pipelines/transforms.py:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file davarocr/davar_rcg/datasets/pipelines/utils/loading_utils.py:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (48798 LoC, 286 module-visible types across 123 directories) overshoots its size bounds. 1 of 2 build unit(s) (Python) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
D34 · Knowledge Freshness · Dormant codebase · ×1
  • Dormant codebase — 172 of 172 significant files have no living knowledge — the codebase as a whole is dormant, not 172 separate risks. Counted over 172 of the 352 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. Re-engage owners or document before change.
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.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
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 — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation requirements/build.txt:2 — `requirements/build.txt` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.

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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-294388f0d1e84266a28d66f10550d7e8/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-294388f0d1e84266a28d66f10550d7e8/tree.json --exit-code 0 --source .0artifacts/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/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .1artifacts/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 .2artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
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—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.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 01a1e9b0-0182-700e-93d9-5e81ce3f0078 · 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