Public report of PaddlePaddle/PaddleSeg, 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, 00:49 UTC · Survey ID cd_56c7b33ce3b7481cb34d9289b0e65230

PaddlePaddle/PaddleSeg

Measured 17 November 2026, 00:48 UTC, at code version 3c4db66

Bus factor is not measured: No living knowledge left to concentrate.

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 45.8out of 100 Weak
CriticalWeakAdequateStrongExemplary

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 large codebase: 135,273 lines of product code in 12 projects, tests not counted · Estimated rebuild effort: about 0.8 person-years · Weakest lens: Maturity, 40.3

Findings by how serious they are

102 critical 1970 serious 690 minor

13 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, 00:48 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.

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 ▸

51of 51 dimensions measured by tools.
2753of 2762 findings point to an exact file and line, so you can open each one in the code. The other 9 concern the repository as a whole, such as missing documentation.
51dimensions across 6 lenses, read from 135,273 lines of product code in 12 projects.
Chapters

Executive summary

PaddlePaddle/PaddleSeg falls short of our standard for production because 578 files are no longer known to anyone active in the project and the project keeps no record of its design decisions. It scores 45.8 out of 100 and is rated Weak, and all 102 of its critical findings are security problems.

Maturity, at 40.3, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step is recording design decisions, worth about 5.5 points. Replacing the four exposed passwords or keys and switching the old ones off comes next, worth about 5.1 points.

Seventy-six pipeline steps run downloads nobody checks. Fourteen places in the code run text as code, which an attacker could use, and five passwords or keys in the code's history and four in the code are open to anyone who can read the repository. Checking each download against a checksum, replacing text run as code with direct calls and replacing each exposed password or key would close these risks. Updating the vulnerable packages would fix the three packages with a known security hole.

The product code is 135,273 lines, about €120,000 to rebuild. The check for the health of its packages couldn't finish, so that result is missing, not a clean pass.

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 40.3 · counts for 46%Code Health 40.8 · counts for 25%Production Readiness 41.6 · counts for 14%Security and Compliance 62.5 · counts for 8%Architecture 90.4 · counts for 4%Performance 100.0 · counts for 2%

The weakest lenses score close to each other, so improving any of them moves the score.

Code composition: what the lines of code are
Product code 100%Tests 0%
Rebuild cost: about €120,000 · Estimate
Cost to rebuild€40,000 to €200,000, for 671 to 2,128 hours of work, about 0.8 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 46. 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.
SizeLarge: 135,273 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
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.
Raises the score by about 5.5 points · Low effort · ADR Quality
2
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED (2).
Raises the score by about 5.1 points · Low effort · REDACTED Scanning
3
Resolve the 1 `ConvBnReLU2D` spells `Bn` where 27 names in the project spell it `BN` finding(s) in Naming Consistency — start with unet_3plus.py.
Raises the score by about 1.9 points · Low effort · Naming Consistency

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 €120,000 to build again, about 0.8 person-years of work. Its weakest lens is Maturity, at 40.3 (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
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 5.5 points for low effort, because it clears the 1 ADR Quality findings. 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 4.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 18% on every change.
How this is estimated: It rests on an assumption 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. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4)
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.

536 modules, with 69 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; 496 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 EISeg.eiseg.inference.transforms.base2 EISeg.eiseg.plugin.remotesensing.raster3 EISeg.eiseg.ui4 Matting.ppmatting.datasets.matting_dataset5 com.baidu.paddle.fastdeploy.app.ui.view.model6 contrib.CrossPseudoSupervision.batch_transforms.mask_gen7 contrib.CrossPseudoSupervision.datasets.basedataset8 contrib.DomainAdaptation.datasets.cityscapes_noconfig9 contrib.MedicalSeg.medicalseg.datasets.dataset10 contrib.MedicalSeg.medicalseg.inference_helpers.inference_helper11 contrib.MedicalSeg.tools.prepare12 contrib.PanopticSeg.paddlepanseg.core.runner13 contrib.PanopticSeg.paddlepanseg.datasets.base_dataset14 contrib.PanopticSeg.paddlepanseg.models.param_init15 contrib.PanopticSeg.paddlepanseg.postprocessors.base_pp16 contrib.PanopticSeg.paddlepanseg.utils.evaluation.evaluator17 contrib.SegmentAnything.segment_anything.modeling.sam18 deploy.python.infer19 paddleseg.cvlibs.config20 paddleseg.datasets.dataset21 EISeg.eiseg.app22 EISeg.eiseg.inference.transforms.crops23 EISeg.eiseg.inference.transforms.flip24 EISeg.eiseg.inference.transforms.zoom_in25 EISeg.eiseg.plugin.n2grid.rs_grid26 Matting.ppmatting.datasets.composition_1k27 Matting.ppmatting.datasets.distinctions_64628 com.baidu.paddle.fastdeploy.app.ui.view.adapter29 contrib.CrossPseudoSupervision.datasets.cityscapes_cps30 contrib.DomainAdaptation.datasets.gta5_noconfig31 contrib.DomainAdaptation.datasets.synthia32 contrib.MedicalSeg.medicalseg.datasets.abdomen33 contrib.MedicalSeg.medicalseg.datasets.lung_coronavirus34 contrib.MedicalSeg.medicalseg.datasets.mri_spine_seg35 contrib.SegmentAnything.segment_anything.automatic_mask_generator36 paddleseg.cvlibs.builder37 EISeg.eiseg.inference.transforms.limit_longest_side38 Matting.ppmatting.utils.config39 contrib.CrossPseudoSupervision.cvlibs.builder40 contrib.PanopticSeg.paddlepanseg.cvlibs.config
1 EISeg.eiseg.inference.transforms.base
2 EISeg.eiseg.plugin.remotesensing.raster
3 EISeg.eiseg.ui
4 Matting.ppmatting.datasets.matting_dataset
5 com.baidu.paddle.fastdeploy.app.ui.view.model
6 contrib.CrossPseudoSupervision.batch_transforms.mask_gen
7 contrib.CrossPseudoSupervision.datasets.basedataset
8 contrib.DomainAdaptation.datasets.cityscapes_noconfig
9 contrib.MedicalSeg.medicalseg.datasets.dataset
10 contrib.MedicalSeg.medicalseg.inference_helpers.inference_helper
11 contrib.MedicalSeg.tools.prepare
12 contrib.PanopticSeg.paddlepanseg.core.runner
13 contrib.PanopticSeg.paddlepanseg.datasets.base_dataset
14 contrib.PanopticSeg.paddlepanseg.models.param_init
15 contrib.PanopticSeg.paddlepanseg.postprocessors.base_pp
16 contrib.PanopticSeg.paddlepanseg.utils.evaluation.evaluator
17 contrib.SegmentAnything.segment_anything.modeling.sam
18 deploy.python.infer
19 paddleseg.cvlibs.config
20 paddleseg.datasets.dataset
21 EISeg.eiseg.app1
22 EISeg.eiseg.inference.transforms.crops1
23 EISeg.eiseg.inference.transforms.flip1
24 EISeg.eiseg.inference.transforms.zoom_in1
25 EISeg.eiseg.plugin.n2grid.rs_grid1
26 Matting.ppmatting.datasets.composition_1k1
27 Matting.ppmatting.datasets.distinctions_6461
28 com.baidu.paddle.fastdeploy.app.ui.view.adapter1
29 contrib.CrossPseudoSupervision.datasets.cityscapes_cps1
30 contrib.DomainAdaptation.datasets.gta5_noconfig1
31 contrib.DomainAdaptation.datasets.synthia1
32 contrib.MedicalSeg.medicalseg.datasets.abdomen1
33 contrib.MedicalSeg.medicalseg.datasets.lung_coronavirus1
34 contrib.MedicalSeg.medicalseg.datasets.mri_spine_seg1
35 contrib.SegmentAnything.segment_anything.automatic_mask_generator1
36 paddleseg.cvlibs.builder1
37 EISeg.eiseg.inference.transforms.limit_longest_side1
38 Matting.ppmatting.utils.config11
39 contrib.CrossPseudoSupervision.cvlibs.builder11
40 contrib.PanopticSeg.paddlepanseg.cvlibs.config11
Uses a module listed above itPart of a loopThe module itself
1 EISeg.eiseg.inference.transforms.base2 EISeg.eiseg.plugin.remotesensing.raster3 EISeg.eiseg.ui4 Matting.ppmatting.datasets.matting_dataset5 com.baidu.paddle.fastdeploy.app.ui.view.model6 contrib.CrossPseudoSupervision.batch_transforms.mask_gen7 contrib.CrossPseudoSupervision.datasets.basedataset8 contrib.DomainAdaptation.datasets.cityscapes_noconfig9 contrib.MedicalSeg.medicalseg.datasets.dataset10 contrib.MedicalSeg.medicalseg.inference_helpers.inference_helper11 contrib.MedicalSeg.tools.prepare12 contrib.PanopticSeg.paddlepanseg.core.runner13 contrib.PanopticSeg.paddlepanseg.datasets.base_dataset14 contrib.PanopticSeg.paddlepanseg.models.param_init15 contrib.PanopticSeg.paddlepanseg.postprocessors.base_pp16 contrib.PanopticSeg.paddlepanseg.utils.evaluation.evaluator17 contrib.SegmentAnything.segment_anything.modeling.sam18 deploy.python.infer19 paddleseg.cvlibs.config20 paddleseg.datasets.dataset21 EISeg.eiseg.app22 EISeg.eiseg.inference.transforms.crops23 EISeg.eiseg.inference.transforms.flip24 EISeg.eiseg.inference.transforms.zoom_in25 EISeg.eiseg.plugin.n2grid.rs_grid26 Matting.ppmatting.datasets.composition_1k27 Matting.ppmatting.datasets.distinctions_64628 com.baidu.paddle.fastdeploy.app.ui.view.adapter29 contrib.CrossPseudoSupervision.datasets.cityscapes_cps30 contrib.DomainAdaptation.datasets.gta5_noconfig31 contrib.DomainAdaptation.datasets.synthia32 contrib.MedicalSeg.medicalseg.datasets.abdomen33 contrib.MedicalSeg.medicalseg.datasets.lung_coronavirus34 contrib.MedicalSeg.medicalseg.datasets.mri_spine_seg35 contrib.SegmentAnything.segment_anything.automatic_mask_generator36 paddleseg.cvlibs.builder37 EISeg.eiseg.inference.transforms.limit_longest_side38 Matting.ppmatting.utils.config39 contrib.CrossPseudoSupervision.cvlibs.builder40 contrib.PanopticSeg.paddlepanseg.cvlibs.configEISeg.eiseg.inference.transforms.base1EISeg.eiseg.plugin.remotesensing.raster2EISeg.eiseg.ui3Matting.ppmatting.datasets.matting_dataset4com.baidu.paddle.fastdeploy.app.ui.view.model5contrib.CrossPseudoSupervision.batch_transforms.mask_gen6contrib.CrossPseudoSupervision.datasets.basedataset7contrib.DomainAdaptation.datasets.cityscapes_noconfig8contrib.MedicalSeg.medicalseg.datasets.dataset9contrib.MedicalSeg.medicalseg.inference_helpers.inference_helper10contrib.MedicalSeg.tools.prepare11contrib.PanopticSeg.paddlepanseg.core.runner12contrib.PanopticSeg.paddlepanseg.datasets.base_dataset13contrib.PanopticSeg.paddlepanseg.models.param_init14contrib.PanopticSeg.paddlepanseg.postprocessors.base_pp15contrib.PanopticSeg.paddlepanseg.utils.evaluation.evaluator16contrib.SegmentAnything.segment_anything.modeling.sam17deploy.python.infer18paddleseg.cvlibs.config19paddleseg.datasets.dataset20EISeg.eiseg.app21EISeg.eiseg.inference.transforms.crops22EISeg.eiseg.inference.transforms.flip23EISeg.eiseg.inference.transforms.zoom_in24EISeg.eiseg.plugin.n2grid.rs_grid25Matting.ppmatting.datasets.composition_1k26Matting.ppmatting.datasets.distinctions_64627com.baidu.paddle.fastdeploy.app.ui.view.adapter28contrib.CrossPseudoSupervision.datasets.cityscapes_cps29contrib.DomainAdaptation.datasets.gta5_noconfig30contrib.DomainAdaptation.datasets.synthia31contrib.MedicalSeg.medicalseg.datasets.abdomen32contrib.MedicalSeg.medicalseg.datasets.lung_coronavirus33contrib.MedicalSeg.medicalseg.datasets.mri_spine_seg34contrib.SegmentAnything.segment_anything.automatic_mask_generator35paddleseg.cvlibs.builder36EISeg.eiseg.inference.transforms.limit_longest_side37Matting.ppmatting.utils.config38contrib.CrossPseudoSupervision.cvlibs.builder39contrib.PanopticSeg.paddlepanseg.cvlibs.config4011111111111111111111111+496 more modules (most-connected shown)

At a glance — Code Health · 40.8 · Weak · gated by D2, D4, X4, X5 ·

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

At a glance — Maturity · 40.3 · Weak · gated by D34, M1, M2 ·

At a glance — Readiness · 41.6 · Weak · gated by D8, D13, P3 ·

At a glance — Security · 62.5 · Adequate · gated by D29 ·

At a glance — Performance · 100.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection97High / Critical
A07:2025 — Authentication Failures10High / Critical
A03:2025 — Software Supply Chain Failures3High / Critical

Roadmap

Top priorities: Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle; Resolve the 578 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (29), val.py (27), predict.py (21); Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED (2).

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

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.+5.5 ptsLowADR Quality
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED (2).+5.1 ptsLowREDACTED Scanning
Resolve the 1 `ConvBnReLU2D` spells `Bn` where 27 names in the project spell it `BN` finding(s) in Naming Consistency — start with unet_3plus.py.+1.9 ptsLowNaming Consistency
Resolve the 1 `ConvertRGBToID` spells `ID` where 13 names in the project spell it `Id` finding(s) in Naming Consistency — start with transforms.py.+1.9 ptsLowNaming Consistency
Resolve the 578 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (29), val.py (27), predict.py (21).+5.5 ptsHighKnowledge Freshness
Expand the README with getting-started, architecture overview and a project map.+2.5 ptsMediumDocumentation (README)
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.+2.5 ptsMediumSecurity & performance tooling
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.+2.4 ptsMediumArchitecture documentation

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.9SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED1.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
paddleseg/models/backbones/lite_hrnet.py5.5MixedCognitive Complexity: LiteHRNetModule.forward (cognitive 22)
paddleseg/models/backbones/seaformer.py5.5MixedCode Duplication: Near-duplicate member pair (29 shared lines)
paddleseg/models/backbones/mix_transformer.py5.5MixedCode Duplication: Members sharing a duplicated core (6 members, 50+ identical tokens)
contrib/MedicalSeg/nnunet/utils/static_predictor.py5.5MixedCyclomatic Complexity: StaticBasePredictor._internal_maybe_mirror_and_pred_3D (cyclomatic 19)
paddleseg/models/u2net.py5.5MixedCode Duplication: Members sharing a duplicated core (5 members, 50+ identical tokens)
paddleseg/models/encnet.py5.5MixedCode Duplication: Edited copy of a member (35 corresponding lines)
paddleseg/transforms/transforms.py5.5MixedCyclomatic Complexity: Compose.__call__ (cyclomatic 19)
paddleseg/models/backbones/efficientformerv2.py5.5MixedGod Classes: FileTooLong: backbones/efficientformerv2.py
paddleseg/models/backbones/strideformer.py5.5MixedGod Classes: FileTooLong: backbones/strideformer.py

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

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

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

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

Could not be resolved — 13

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 51 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, 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 — 51 dimensions across the health lenses
D1D2D3D4D5D6D8D10D11D13D14D15D17D20D21D26D27D28D29D30D31D34D35D43D44AX10AX3AX4AX6M1M2M3M4P1P10P2P3P4P6PF3X12X19X23X24X25X27X28X3X30X4X5

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, 2753 of 2762 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 · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1e6f9-e4c0-7d28-93c0-354ab084a838.

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.

  • D10 Test Quality — 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. The 1 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 9 test source file(s) (.py, .java) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • 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 manifests WERE read and their pinning discipline assessed; what went unanswered is the currency half, because jcenter.bintray.com — the registry that answers it — was asked and did not reply (the build stopped because jcenter.bintray.com, a repository this project declares, refused it with HTTP 403 — what this scan's egress allowlist returns for a host that is not on it, so the dependency graph was not resolved). This is OUR side and it is an ENVIRONMENT fault, not a missing collector: the collector exists and ran. An HTTP 403 here is what this scan's egress allowlist returns for a host that is not on it, so the remedy is to add jcenter.bintray.com to the allowlist and re-run — not to build anything.
  • D14 License Compliance — 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. This repository declares a Python pyproject.toml/REDACTED (pip/uv/Poetry), but the licence verdict published here was taken over its JVM dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — 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. All 581 significant source file(s) were last meaningfully changed so long ago that no living knowledge remains — nothing since has been substantial enough to re-establish ownership (a broad, mechanical sweep that touches many files shallowly does not count, and neither does no activity at all). There is no concentration to measure, so the bus factor is not scored. This is not a clean bill: nobody currently holds working knowledge of this code (see D34 Knowledge Freshness). Counted over 555 of the 830 production source files in this repository: 249 are under the ~2,400-byte size floor this dimension measures over, and the remaining 26 have no attributable history left to measure.
  • D19 Documentation Quality — 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — 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 kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — 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. 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's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — 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. `EISeg/tool/ts/Arabic.ts`, `EISeg/tool/ts/English.ts` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AXB2 Runtime readiness — 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. `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. (rule: no-root-manifest). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
  • AXR1 Runtime accessibility — 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. Boot via AndroidApp (deploy/fastdeploy/semantic_segmentation/android/app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: .tools.build:apkzlib:7.2.2 > Could not resolve com.google.code.findbugs:jsr305:3.0.2. > Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.2/jsr305-…; runtime evidence skipped (launch chosen because deploy/fastdeploy/semantic_segmentation/android/app/build.gradle applies the Android application plugin and deploy/fastdeploy/semantic_segmentation/android/gradlew builds it).
  • 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 this repository's Python, c, cpp is most of its product and 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 this repository's Python, c, cpp is most of its product and 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.
  • P1 CI/CD gates — 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. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • 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.
  • X10 Duplicated predicate — 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. 39 further occurrence(s) are not listed individually; the score already reflects all 79.
  • 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X2 Cancellation propagation — 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, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • 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.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • 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.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: 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.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

68 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was train.train at 79.

val.evaluate (cyclomatic 19) · ×3Matting/ppmatting/core/val.py:55
train.train (cyclomatic 43) · ×2contrib/LaneSeg/core/train.py:55
train.train (cyclomatic 38) · ×2contrib/CrossPseudoSupervision/core/train.py:100
train.train (cyclomatic 36) · ×2contrib/AutoNUE/scripts/train.py:52
Progbar.update (cyclomatic 32) · ×2contrib/MedicalSeg/medicalseg/utils/progbar.py:68

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

What to do

  1. Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with train.train (cyclomatic 79). — Refactoring it lifts Cyclomatic Complexity from 6.3 to about 6.5/10.

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

D2 · Cognitive Complexity3.5 / 10Weak✓ 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 3.5 / 10 · rule-coverage 100% · ceiling Prevented

198 method(s) exceeded the cognitive complexity threshold of 15; the worst was train.train at 230.

Config._prepare_loss (cognitive 26) · ×3contrib/DomainAdaptation/cvlibs/config.py:247
train.train (cognitive 97) · ×2contrib/AutoNUE/scripts/train.py:52
Progbar.update (cognitive 74) · ×2contrib/MedicalSeg/medicalseg/utils/progbar.py:68
functional.augment_contrast (cognitive 38) · ×2contrib/MedicalSeg/medicalseg/transforms/functional.py:248
val.evaluate (cognitive 37) · ×2contrib/RSSegBenchmark/c2fnet/core/val.py:28

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

What to do

  1. Bring the 6 bodies over 120 down to 120 or less in Cognitive Complexity — start with train.train (cognitive 230), train.train (cognitive 152), Trainer.train (cognitive 134). — 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 6 together lifts Cognitive Complexity from 3.5 to about 4.5/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

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

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

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

31 god class(es) detected.

FileTooLong: REDACTED · ×29REDACTED
TooManyMethods: APP_EISeg · ×2REDACTED:57

What to do

  1. Resolve the 29 FileTooLong finding(s) in God Classes — start with transforms.py (2), hrnet.py (2), hrnet_nv.py (2). — One of this dimension's main actionable groups (29 warning-level).
  2. Resolve the 2 TooManyMethods finding(s) in God Classes — start with REDACTED, EISegMed3D.py. — One of this dimension's main actionable groups (2 warning-level).

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

D4 · Code Duplication0.0 / 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 0.0 / 10 · rule-coverage 100% · ceiling Verified

906 duplicated block group(s) detected. 27.9 % of the production lines (37,718 of 135,273) are in a reported copy. A further 383 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 41 of the 1289 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 (8 lines × 2) · ×34EISeg/eiseg/plugin/video/load_model.py:87
Duplicated block (7 lines × 2) · ×31REDACTED:645
Duplicated block (10 lines × 2) · ×29REDACTED:1138
Duplicated block (9 lines × 2) · ×28EISeg/eiseg/plugin/video/load_model.py:57
Duplicated block (6 lines × 2) · ×28EISeg/eiseg/util/coco/cocoeval.py:546

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

What to do

  1. Resolve the 34 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with visualize.py (2), labelme2seg.py (2), predict.py (2). — One of this dimension's main actionable groups (34 warning-level).
  2. Resolve the 31 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with medical2video.py (2), infer.py (2), functional.py (2). — One of this dimension's main actionable groups (31 warning-level).
  3. Resolve the 29 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), val.py (2), hrnet.py (2). — One of this dimension's main actionable groups (29 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

12 production modules (Gradle+Python+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 0 module(s) off the main sequence, with abstractness counted on 3 of the 12 (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.8 / 10Stronggated by 5 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.8 / 10 · rule-coverage 100% · ceiling Verified

5 of 369 classes have LCOM4 above 3.

Low cohesion: APP_EISeg (LCOM4 7) · ×5REDACTED:57

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with REDACTED, patchcore.py, EISegMed3D.py. — One of this dimension's main actionable groups (5 warning-level).

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

D8 · Code Coverage1.0 / 10Critical✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

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

Line coverage 0.0% — 244 file(s) below 50%. Measured from the Python suite (repository root: `coverage run -m pytest`, the 3 run(s) test reliability made; contrib/PanopticSeg: `coverage run -m pytest`, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it.

Low coverage: contrib/PanopticSeg/paddlepanseg/__init__.py · ×244contrib/PanopticSeg/paddlepanseg/__init__.py:1

What to do

  1. Resolve the 244 Low coverage finding(s) in Code Coverage — start with __init__.py (25), export.py (5), REDACTED (4). — One of this dimension's main actionable groups (244 warning-level).

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

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1 tests. Measured on the JavaScript/TypeScript suite only — at least 9 test source file(s) (.py, .java) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

0 flaky across 1 measured tier(s). Python (2 distributions): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

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 0.0 / 10 · rule-coverage 100% · ceiling Prevented

4 secret(s) detected.

REDACTED

What to do

  1. Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 issue-level).

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

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

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

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

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

0 of 2 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 6 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. A further 3 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's JVM dependencies and nothing else. The repository also declares a Python pyproject.toml/REDACTED (pip/uv/Poetry), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_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 Debt9.8 / 10Stronggated by 106 serious findings✓ Tool-verified

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

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

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

106 deducted task-comment markers across 135273 LoC (0.1/KLoC) → score 9.8. 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 · ×92tools/train.py:200
XxxComment · ×9contrib/PanopticSeg/tools/analyze_model.py:77
FixmeComment · ×4contrib/QualityInspector/tools/det/train.py:184
HackCommentpaddleseg/utils/utils.py:281

What to do

  1. Resolve the 92 TodoComment finding(s) in Explicit Debt — start with REDACTED (13), EISegMed3D.py (10), infer.py (7). — One of this dimension's main actionable groups (92 warning-level).
  2. Resolve the 9 XxxComment finding(s) in Explicit Debt — start with analyze_model.py, visualize.py, maskformer_runner.py. — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 4 FixmeComment finding(s) in Explicit Debt — start with REDACTED (2), REDACTED, visualize.py. — One of this dimension's main actionable groups (4 warning-level).

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

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

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

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs founddeploy/fastdeploy/semantic_segmentation/android/app/build.gradle:1

What to do

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

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

D21 · Naming Consistency5.2 / 10Adequate✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

2 naming inconsistencies among 42 declarations measured against a convention their peers follow.

`ConvertRGBToID` spells `ID` where 13 names in the project spell it `Id`contrib/PanopticSeg/paddlepanseg/transforms/transforms.py:43
`ConvBnReLU2D` spells `Bn` where 27 names in the project spell it `BN`paddleseg/models/unet_3plus.py:256

What to do

  1. Resolve the 1 `ConvertRGBToID` spells `ID` where 13 names in the project spell it `Id` finding(s) in Naming Consistency — start with transforms.py. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `ConvBnReLU2D` spells `Bn` where 27 names in the project spell it `BN` finding(s) in Naming Consistency — start with unet_3plus.py. — One of this dimension's main actionable groups (1 recommendation-level).

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

6 of 11 build units (Gradle, Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×6setup.py:1

What to do

  1. Resolve the 6 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with setup.py (3), REDACTED (3). — One of this dimension's main actionable groups (6 recommendation-level).

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

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

70 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)5.0 / 10Adequate✓ Tool-verified

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

Method: REDACTED 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

5 finding(s): 0 critical, 5 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 5 REDACTED finding(s) in Secrets (history) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

97 finding(s): 0 critical, 90 high, 4 medium, 3 low. semgrep hit a parse error in 5 file(s) — `.github/ISSUE_TEMPLATE/2_feature-request.yml`, `EISeg/tool/ts/Arabic.ts` (line 1, line 2, line 3, …), `EISeg/tool/ts/English.ts` (line 1, line 2, line 3, …), `contrib/DomainAdaptation/run-DA_src.sh` (line 13), `contrib/MedicalSeg/visualize.ipynb` — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 76 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (71), REDACTED, REDACTED. — One of this dimension's main actionable groups (76 issue-level).
  2. Resolve the 14 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (14 issue-level).
  3. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).

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

D30 · Dependency Vulnerabilities8.8 / 10Adequategated by 3 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.8 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

  1. Resolve the 2 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 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.

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

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

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

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

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

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

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

Orphaned file · ×578REDACTED:1
Most significant orphaned file · ×3REDACTED:1
Dormant codebase

What to do

  1. Resolve the 578 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (29), val.py (27), predict.py (21). — One of this dimension's main actionable groups (578 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with REDACTED, EISegMed3D.py, transforms.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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.7 / 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)1.8 / 10Critical✓ 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.

  • The root README is 0 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers. — README.md:1

What to do

  • Expand the README with getting-started, architecture overview and a project map.
  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation2.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.

What to do

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

  • Matting/README.md links to `../configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml`, but `configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml` 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. — Matting/README.md:68
  • Matting/README.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_512.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_512.yml` 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. — Matting/README.md:69
  • Matting/README.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml` 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. — Matting/README.md:70
  • Matting/README.md links to `../configs/human_matting/human_matting-resnet34_vd.yml`, but `configs/human_matting/human_matting-resnet34_vd.yml` 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. — Matting/README.md:71
  • Matting/README.md links to `../configs/modnet/modnet-mobilenetv2.yml`, but `configs/modnet/modnet-mobilenetv2.yml` 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. — Matting/README.md:72
  • Matting/README.md links to `../configs/modnet/modnet-resnet50_vd.yml`, but `configs/modnet/modnet-resnet50_vd.yml` 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. — Matting/README.md:73
  • Matting/README.md links to `../configs/modnet/modnet-hrnet_w18.yml`, but `configs/modnet/modnet-hrnet_w18.yml` 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. — Matting/README.md:74
  • Matting/README.md links to `../configs/dim/dim-vgg16.yml`, but `configs/dim/dim-vgg16.yml` 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. — Matting/README.md:75
  • Matting/README_CN.md links to `../configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml`, but `configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml` 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. — Matting/README_CN.md:66
  • Matting/README_CN.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_512.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_512.yml` 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. — Matting/README_CN.md:67
  • Matting/README_CN.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml` 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. — Matting/README_CN.md:68
  • Matting/README_CN.md links to `../configs/human_matting/human_matting-resnet34_vd.yml`, but `configs/human_matting/human_matting-resnet34_vd.yml` 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. — Matting/README_CN.md:69
  • Matting/README_CN.md links to `../configs/modnet/modnet-mobilenetv2.yml`, but `configs/modnet/modnet-mobilenetv2.yml` 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. — Matting/README_CN.md:70
  • Matting/README_CN.md links to `../configs/modnet/modnet-resnet50_vd.yml`, but `configs/modnet/modnet-resnet50_vd.yml` 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. — Matting/README_CN.md:71
  • Matting/README_CN.md links to `../configs/modnet/modnet-hrnet_w18.yml`, but `configs/modnet/modnet-hrnet_w18.yml` 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. — Matting/README_CN.md:72
  • Matting/README_CN.md links to `../configs/dim/dim-vgg16.yml`, but `configs/dim/dim-vgg16.yml` 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. — Matting/README_CN.md:73
  • configs/pp_liteseg/README.md links to `../../docs/evaluation/evaluate/evaluate.md`, but `docs/evaluation/evaluate/evaluate.md` 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. — configs/pp_liteseg/README.md:74
  • configs/pssl/README.md links to `./pp_liteseg_stdc2_cityscapes_1024x512_scale1.0_160k.yml`, but `configs/pssl/pp_liteseg_stdc2_cityscapes_1024x512_scale1.0_160k.yml` 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. — configs/pssl/README.md:128
  • contrib/MedicalSeg/README.md links to `../medicalseg/datasets/lung_coronavirus.py`, but `contrib/medicalseg/datasets/lung_coronavirus.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. — contrib/MedicalSeg/README.md:211
  • contrib/MedicalSeg/README.md links to `../tools/prepare_lung_coronavirus.py`, but `contrib/tools/prepare_lung_coronavirus.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. — contrib/MedicalSeg/README.md:211
  • contrib/MedicalSeg/README_CN.md links to `../run-vnet.sh`, but `contrib/run-vnet.sh` 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. — contrib/MedicalSeg/README_CN.md:172
  • contrib/MedicalSeg/README_CN.md links to `../medicalseg/datasets/lung_coronavirus.py`, but `contrib/medicalseg/datasets/lung_coronavirus.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. — contrib/MedicalSeg/README_CN.md:218
  • contrib/MedicalSeg/README_CN.md links to `../tools/prepare_lung_coronavirus.py`, but `contrib/tools/prepare_lung_coronavirus.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. — contrib/MedicalSeg/README_CN.md:218
  • contrib/PP-HumanSeg/README.md links to `../../docs/evaluation/evaluate/evaluate.md`, but `docs/evaluation/evaluate/evaluate.md` 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. — contrib/PP-HumanSeg/README.md:367
  • contrib/PP-HumanSeg/README_cn.md links to `../../docs/evaluation/evaluate/evaluate_cn.md`, but `docs/evaluation/evaluate/evaluate_cn.md` 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. — contrib/PP-HumanSeg/README_cn.md:369
  • contrib/RSSegBenchmark/README.md links to `./configs/ssl/upernet_pixpro_millionaid_resnet50_isaid_512x512.yml`, but `contrib/RSSegBenchmark/configs/ssl/upernet_pixpro_millionaid_resnet50_isaid_512x512.yml` 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. — contrib/RSSegBenchmark/README.md:87
  • contrib/RSSegBenchmark/README_CN.md links to `./configs/ssl/upernet_pixpro_millionaid_resnet50_isaid_512x512.yml`, but `contrib/RSSegBenchmark/configs/ssl/upernet_pixpro_millionaid_resnet50_isaid_512x512.yml` 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. — contrib/RSSegBenchmark/README_CN.md:87
  • deploy/fastdeploy/README.md links to `cpu-gpu/cpp/`, but `deploy/fastdeploy/cpu-gpu/cpp` 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. — deploy/fastdeploy/README.md:123

What to do

  • Reconcile the README with reality: Matting/README.md links to `../configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml`, but `configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml` does not exist; Matting/README.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_512.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_512.yml` does not exist; Matting/README.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml` does not exist; Matting/README.md links to `../configs/human_matting/human_matting-resnet34_vd.yml`, but `configs/human_matting/human_matting-resnet34_vd.yml` does not exist; Matting/README.md links to `../configs/modnet/modnet-mobilenetv2.yml`, but `configs/modnet/modnet-mobilenetv2.yml` does not exist.
P1 · CI/CD gates6.5 / 10Adequate✓ 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.

  • A CI pipeline exists but no build step was matched — changes may merge without the build ever running. A build step may be invoked directly as a command, or declared as a task that a runner named in the pipeline resolves.

What to do

  • Run the test suite in CI via an explicit runner step (`pytest` for the toolchain this pipeline already uses) and gate merges on it.
  • Add an explicit build step to your CI pipeline — your stack's own build command, or, if the pipeline delegates to a task runner, a build task that runner executes in CI — so every change is built before merge.
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.

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

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

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

What to do

  • Add a health-check endpoint (a /health route) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 1 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.
  • `deploy/web/example/package.json` 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`. — deploy/web/example/package.json:11

What to do

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

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

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

  • Deployment automation exists but no readiness/liveness probes, rolling-update strategy, lifecycle hooks or migration job were evidenced — a bad release is harder to detect and reverse.

What to do

  • Add readiness/liveness probes and a rolling-update (or blue/green) strategy so a bad release is caught and rolled back automatically.
  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
P6 · Release Hygiene5.0 / 10Adequate✓ 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.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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.

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

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

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

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

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

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

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 an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. 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.8 / 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. (×12) — REDACTED:82, contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:92, contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py:76, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×12) — REDACTED:121, contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py:115, REDACTED:87, …

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 logging3.6 / 10Weak✓ Tool-verified

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

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

  • `debug` at line 38 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/paddleseg_grpc_client.py:38
  • `info` at line 46 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/paddleseg_grpc_client.py:46
  • `info` at line 47 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/paddleseg_grpc_client.py:47
  • `info` at line 438 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:438
  • `info` at line 519 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:519
  • `info` at line 584 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:584
  • `info` at line 815 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:815
  • `info` at line 952 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:952
  • `info` at line 1070 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:1070
  • `info` at line 1079 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:1079
  • `info` at line 1145 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:1145
  • `info` at line 1199 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:1199
  • `info` at line 1288 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:1288
  • `info` at line 1293 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:1293
  • `info` at line 1546 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/med3d/EISegMed3D/EISegMed3D.py:1546
  • `info` at line 1097 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:1097
  • `info` at line 111 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/eiseg/controller.py:111
  • `info` at line 118 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — EISeg/eiseg/controller.py:118

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 0/6 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

What to do

  • Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).

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 Health40.8Weak — gated by D2, D4, X4, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture90.4Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity40.3Weak — gated by D34, M1, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness41.6Weak — gated by D8, D13, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security62.5Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplaryStrongest 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.

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 64 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 Java 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; 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; this repository's TypeScript 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 class in this Java code is a Spring, JSR-330 or CDI singleton bean. 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. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • 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
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: .tools.build:apkzlib:7.2.2 > Could not resolve com.google.code.findbugs:jsr305:3.0.2. > Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.2/jsr305-…; runtime evidence skipped (launch chosen because deploy/fastdeploy/semantic_segmentation/android/app/build.gradle applies the Android application plugin and deploy/fastdeploy/semantic_segmentation/android/gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
  • 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.
  • D12 Dependency Hygiene — Dependency currency not established — jcenter.bintray.com did not answer
  • D16 Bus Factor — dormant codebase — no living knowledge left to concentrate
  • 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.
  • D19 Documentation Quality — D19 reads .NET projects and npm packages as units; 11 folder(s) declared by build.gradle, pyproject.toml, setup.py were not judged for an overview, an example or the map.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Python surface was not measured.
  • 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. 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; comments in this repository's .java, .py source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • 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.
  • 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
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (a Domain/Aggregates/ValueObjects layer)
  • 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 — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, 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 data present for 244 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • 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.
  • 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 — X16 reached only 3% of this repository's production lines — python (131,548 lines), cpp (2,295 lines), c (842 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 — X18 reached only 3% of this repository's production lines — python (131,548 lines), cpp (2,295 lines), c (842 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X2 Cancellation propagation — 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
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • 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 applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — 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 — 102 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 51 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
Serious — 1970 finding(s)
D8 · Code Coverage · Low coverage · ×244
  • Low coverage: contrib/PanopticSeg/paddlepanseg/__init__.py contrib/PanopticSeg/paddlepanseg/__init__.py:1 — 40.0% line coverage (2/5).
  • Low coverage: contrib/PanopticSeg/paddlepanseg/core/__init__.py contrib/PanopticSeg/paddlepanseg/core/__init__.py:1 — 20.0% line coverage (1/5).
  • Low coverage: contrib/PanopticSeg/paddlepanseg/core/train.py contrib/PanopticSeg/paddlepanseg/core/train.py:1 — 3.4% line coverage (5/145).
  • Low coverage: paddleseg/__init__.py paddleseg/__init__.py:1 — 0.0% line coverage (0/2).
  • Low coverage: paddleseg/core/__init__.py paddleseg/core/__init__.py:1 — 0.0% line coverage (0/6).
  • Low coverage: paddleseg/core/analyse.py paddleseg/core/analyse.py:1 — 0.0% line coverage (0/81).
  • Low coverage: paddleseg/core/export.py paddleseg/core/export.py:1 — 0.0% line coverage (0/72).
  • Low coverage: paddleseg/core/infer.py paddleseg/core/infer.py:1 — 0.0% line coverage (0/126).
  • Low coverage: paddleseg/core/predict.py paddleseg/core/predict.py:1 — 0.0% line coverage (0/58).
  • Low coverage: paddleseg/core/train.py paddleseg/core/train.py:1 — 0.0% line coverage (0/257).
  • Low coverage: paddleseg/core/val.py paddleseg/core/val.py:1 — 0.0% line coverage (0/93).
  • Low coverage: paddleseg/cvlibs/__init__.py paddleseg/cvlibs/__init__.py:1 — 0.0% line coverage (0/4).
  • Low coverage: paddleseg/cvlibs/builder.py paddleseg/cvlibs/builder.py:1 — 0.0% line coverage (0/177).
  • Low coverage: paddleseg/cvlibs/config.py paddleseg/cvlibs/config.py:1 — 0.0% line coverage (0/124).
  • Low coverage: paddleseg/cvlibs/config_checker.py paddleseg/cvlibs/config_checker.py:1 — 0.0% line coverage (0/130).
  • Low coverage: paddleseg/cvlibs/manager.py paddleseg/cvlibs/manager.py:1 — 0.0% line coverage (0/43).
  • Low coverage: paddleseg/cvlibs/param_init.py paddleseg/cvlibs/param_init.py:1 — 0.0% line coverage (0/41).
  • Low coverage: paddleseg/datasets/__init__.py paddleseg/datasets/__init__.py:1 — 0.0% line coverage (0/19).
  • Low coverage: paddleseg/datasets/ade.py paddleseg/datasets/ade.py:1 — 0.0% line coverage (0/67).
  • Low coverage: paddleseg/datasets/chase_db1.py paddleseg/datasets/chase_db1.py:1 — 0.0% line coverage (0/46).
  • Low coverage: paddleseg/datasets/cityscapes.py paddleseg/datasets/cityscapes.py:1 — 0.0% line coverage (0/30).
  • Low coverage: paddleseg/datasets/cocostuff.py paddleseg/datasets/cocostuff.py:1 — 0.0% line coverage (0/30).
  • Low coverage: paddleseg/datasets/dataset.py paddleseg/datasets/dataset.py:1 — 0.0% line coverage (0/77).
  • Low coverage: paddleseg/datasets/drive.py paddleseg/datasets/drive.py:1 — 0.0% line coverage (0/46).
  • Low coverage: paddleseg/datasets/eg1800.py paddleseg/datasets/eg1800.py:1 — 0.0% line coverage (0/73).
  • + 219 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×92
  • TodoComment tools/train.py:200 — # TODO refactor — 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 tools/train.py:215 — # TODO refactor — 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 tools/val.py:137 — # TODO refactor — 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 contrib/QualityInspector/tools/seg/train.py:148 — # TODO refactor — 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 contrib/QualityInspector/tools/seg/train.py:163 — # TODO refactor — 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 contrib/QualityInspector/tools/seg/val.py:129 — # TODO refactor — 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 contrib/CrossPseudoSupervision/train.py:125 — # TODO refactor — 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 contrib/CrossPseudoSupervision/val.py:130 — # TODO refactor — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:94 — # TODO is_compiled_with_cuda() has not been moved — 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 contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py:88 — # TODO is_compiled_with_cuda() has not been moved — 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 paddleseg/models/espnet.py:349 — # TODO(wanghuancoder): _no_check_dy2st_diff is used to turn off the checking of behavior — 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 paddleseg/models/layers/tensor_fusion_helper.py:37 — # TODO(pjc): when axis=[2, 3], the paddle.max api has bug for training. — 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 paddleseg/cvlibs/builder.py:91 — # TODO: should we define a protocol (see https://peps.python.org/pep-0544/#defining-a-protocol)
  • TodoComment paddleseg/cvlibs/config.py:126 — # TODO merge test_config into val_dataset — 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 contrib/CrossPseudoSupervision/cvlibs/config.py:136 — # TODO merge test_config into val_dataset — 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 paddleseg/cvlibs/config.py:201 — # TODO: If the items to update are marked as anchors in the yaml file, — 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 contrib/CrossPseudoSupervision/cvlibs/config.py:208 — # TODO: If the items to update are marked as anchors in the yaml file, — 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 paddleseg/core/export.py:86 — # TODO add test config — 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 contrib/QualityInspector/tools/seg/export.py:87 — # TODO add test config — 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 paddleseg/core/infer.py:114 — # TODO 'Tensor' object does not support item assignment. If support, use tensor to calculation. — 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 contrib/RSSegBenchmark/c2fnet/core/infer.py:103 — # TODO 'Tensor' object does not support item assignment. If support, use tensor to calculation. — 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 contrib/AutoNUE/core/infer.py:134 — # TODO 'Tensor' object does not support item assignment. If support, use tensor to calculation. — 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 contrib/AutoNUE/core/infer_crop.py:134 — # TODO 'Tensor' object does not support item assignment. If support, use tensor to calculation. — 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 contrib/AutoNUE/core/infer_generate_autolabel.py:134 — # TODO 'Tensor' object does not support item assignment. If support, use tensor to calculation. — 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 contrib/SegmentAnything/segment_anything/utils/transforms.py:190 — # todo: missing this flag antialias=True — 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.
  • + 67 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×34
  • Duplicated block (8 lines × 2) EISeg/eiseg/plugin/video/load_model.py:87 — EISeg/eiseg/plugin/video/load_model.py:87-94 | EISeg/eiseg/plugin/video/load_model.py:105-112 — 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, `EISeg/eiseg/plugin/video/load_model.py:113` calls `copy_from_cpu` and `EISeg/eiseg/plugin/video/load_model.py:95` 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.
  • Duplicated block (8 lines × 2) Matting/ppmatting/models/backbone/gca_enc.py:134 — Matting/ppmatting/models/backbone/gca_enc.py:134-141 | Matting/ppmatting/models/backbone/gca_enc.py:275-282 — 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) Matting/ppmatting/utils/utils.py:40 — Matting/ppmatting/utils/utils.py:40-47 | paddleseg/utils/utils.py:226-233 — before extracting anything, compare `Matting/ppmatting/utils/utils.py` and `paddleseg/utils/utils.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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 × 2) contrib/CityscapesSOTA/export.py:71 — contrib/CityscapesSOTA/export.py:71-78 | paddleseg/deploy/export.py:27-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) contrib/DomainAdaptation/script/train.py:427 — contrib/DomainAdaptation/script/train.py:427-436 | deploy/slim/distill/distill_utils.py:267-274 — 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 `contrib/DomainAdaptation/script/train.py:427` 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 (8 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:626 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:626-633 | paddleseg/models/backbones/swin_transformer.py:621-628 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py` and `paddleseg/models/backbones/swin_transformer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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 `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:626` 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 × 2) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:142 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:142-149 | paddleseg/models/losses/binary_cross_entropy_loss.py:143-150 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py` and `paddleseg/models/losses/binary_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:876 — contrib/MedicalSeg/medicalseg/models/nnformer.py:876-883 | paddleseg/models/backbones/swin_transformer.py:619-626 — 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.
  • Duplicated block (8 lines × 2) contrib/MedicalSeg/medicalseg/utils/visualize.py:70 — contrib/MedicalSeg/medicalseg/utils/visualize.py:70-77 | paddleseg/utils/visualize.py:64-71 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/visualize.py` and `paddleseg/utils/visualize.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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 (8 lines × 2) contrib/MedicalSeg/medicalseg/utils/visualize.py:120 — contrib/MedicalSeg/medicalseg/utils/visualize.py:120-127 | paddleseg/utils/visualize.py:120-127 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/visualize.py` and `paddleseg/utils/visualize.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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 (8 lines × 2) contrib/MedicalSeg/nnunet/datasets/dataset.py:370 — contrib/MedicalSeg/nnunet/datasets/dataset.py:370-377 | contrib/MedicalSeg/nnunet/losses/multiple_losses.py:67-74 — 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) contrib/MedicalSeg/nnunet/losses/dice_and_ce_loss.py:203 — contrib/MedicalSeg/nnunet/losses/dice_and_ce_loss.py:203-210 | contrib/MedicalSeg/nnunet/utils/utils.py:184-191 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:447 — contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:447-454 | contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:500-507 — 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) contrib/QualityInspector/tools/dataset/labelme2seg.py:66 — contrib/QualityInspector/tools/dataset/labelme2seg.py:66-73 | tools/data/labelme2seg.py:109-116 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/labelme2seg.py` and `tools/data/labelme2seg.py` as WHOLE FILES: this scan already matched 5 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 after the matched lines, `contrib/QualityInspector/tools/dataset/labelme2seg.py:74` calls `open` and `tools/data/labelme2seg.py:117` 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 (8 lines × 2) contrib/QualityInspector/tools/dataset/labelme2seg.py:91 — contrib/QualityInspector/tools/dataset/labelme2seg.py:91-98 | tools/data/labelme2seg.py:131-139 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/labelme2seg.py` and `tools/data/labelme2seg.py` as WHOLE FILES: this scan already matched 5 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. 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, `contrib/QualityInspector/tools/dataset/labelme2seg.py:88` calls `splitext` and `tools/data/labelme2seg.py:128` 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 (8 lines × 2) contrib/QualityInspector/tools/uad/padim/predict.py:51 — contrib/QualityInspector/tools/uad/padim/predict.py:51-58 | contrib/QualityInspector/tools/uad/patchcore/val.py:57-64 — 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, `contrib/QualityInspector/tools/uad/padim/predict.py:59` calls `add_argument` and `contrib/QualityInspector/tools/uad/patchcore/val.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.
  • Duplicated block (8 lines × 2) contrib/QualityInspector/tools/uad/padim/predict.py:70 — contrib/QualityInspector/tools/uad/padim/predict.py:70-77 | contrib/QualityInspector/tools/uad/padim/train.py:78-85 — 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 (8 lines × 2) contrib/QualityInspector/tools/uad/stfpm/val.py:180 — contrib/QualityInspector/tools/uad/stfpm/val.py:180-187 | contrib/QualityInspector/tools/uad/stfpm/val.py:194-201 — 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 `contrib/QualityInspector/tools/uad/stfpm/val.py:180` 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 (8 lines × 2) deploy/python/infer_onnx_trt.py:433 — deploy/python/infer_onnx_trt.py:433-440 | deploy/python/infer_onnx_trt.py:463-470 — 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) paddleseg/models/ann.py:209 — paddleseg/models/ann.py:209-216 | paddleseg/models/ann.py:256-263 — 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 (8 lines × 2) paddleseg/models/backbones/mix_transformer.py:36 — paddleseg/models/backbones/mix_transformer.py:36-43 | paddleseg/models/layers/vit_adapter_layers.py:86-93 — 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) paddleseg/models/backbones/strideformer.py:693 — paddleseg/models/backbones/strideformer.py:693-700 | paddleseg/models/backbones/strideformer.py:733-740 — 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) paddleseg/models/backbones/xception_deeplab.py:320 — paddleseg/models/backbones/xception_deeplab.py:320-327 | paddleseg/models/backbones/xception_deeplab.py:341-348 — 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 `paddleseg/models/backbones/xception_deeplab.py:320` 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 × 2) paddleseg/models/danet.py:94 — paddleseg/models/danet.py:94-101 | paddleseg/models/layers/attention.py:157-164 — before extracting anything, compare `paddleseg/models/danet.py` and `paddleseg/models/layers/attention.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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 × 2) paddleseg/models/dnlnet.py:154 — paddleseg/models/dnlnet.py:154-161 | paddleseg/models/emanet.py:157-164 — 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.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×31
  • Duplicated block (7 lines × 2) REDACTED:645 — REDACTED:645-651 | REDACTED:733-739 — 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) EISeg/tool/medical2video.py:17 — EISeg/tool/medical2video.py:17-23 | contrib/MedicalSeg/tools/prepare.py:161-167 — 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 (7 lines × 2) EISeg/tool/medical2video.py:25 — EISeg/tool/medical2video.py:25-31 | contrib/MedicalSeg/tools/prepare.py:168-174 — 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 (7 lines × 2) Matting/ppmatting/models/backbone/gca_enc.py:157 — Matting/ppmatting/models/backbone/gca_enc.py:157-163 | Matting/ppmatting/models/backbone/gca_enc.py:221-227 — 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) Matting/ppmatting/transforms/transforms.py:631 — Matting/ppmatting/transforms/transforms.py:631-637 | Matting/ppmatting/transforms/transforms.py:645-651 — 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) contrib/DomainAdaptation/datasets/gta5_noconfig.py:100 — contrib/DomainAdaptation/datasets/gta5_noconfig.py:100-106 | contrib/DomainAdaptation/datasets/synthia.py:99-105 — 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 (7 lines × 2) contrib/LaneSeg/core/infer.py:151 — contrib/LaneSeg/core/infer.py:151-157 | contrib/MedicalSeg/medicalseg/core/infer.py:89-96 — 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 (7 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:320 — contrib/MedicalSeg/medicalseg/transforms/functional.py:320-327 | contrib/MedicalSeg/medicalseg/transforms/functional.py:339-345 — 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 `contrib/MedicalSeg/medicalseg/transforms/functional.py:320` 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) contrib/MedicalSeg/nnunet/datasets/dataloader.py:212 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:212-218 | contrib/MedicalSeg/nnunet/datasets/dataloader.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) contrib/PanopticDeepLab/core/infer.py:159 — contrib/PanopticDeepLab/core/infer.py:159-168 | contrib/PanopticSeg/paddlepanseg/postprocessors/panoptic_deeplab_pp.py:115-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) contrib/PanopticDeepLab/core/train.py:41 — contrib/PanopticDeepLab/core/train.py:41-47 | contrib/PanopticDeepLab/core/train.py:51-57 — 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) contrib/QualityInspector/qinspector/uad/models/patchcore.py:305 — contrib/QualityInspector/qinspector/uad/models/patchcore.py:305-311 | contrib/QualityInspector/qinspector/uad/models/patchcore.py:320-326 — 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) contrib/QualityInspector/tools/dataset/MT_dataset.py:98 — contrib/QualityInspector/tools/dataset/MT_dataset.py:98-104 | contrib/QualityInspector/tools/dataset/MT_dataset.py:106-112 — 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) contrib/QualityInspector/tools/uad/padim/predict.py:144 — contrib/QualityInspector/tools/uad/padim/predict.py:144-150 | contrib/QualityInspector/tools/uad/padim/val.py:219-225 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/predict.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 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 (7 lines × 2) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:103 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:103-109 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:204-210 — 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 `contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:103` 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) REDACTED:186 — REDACTED:186-192 | REDACTED:113-119 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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 (7 lines × 2) paddleseg/models/encnet.py:180 — paddleseg/models/encnet.py:180-186 | paddleseg/models/fastfcn.py:198-204 — before extracting anything, compare `paddleseg/models/encnet.py` and `paddleseg/models/fastfcn.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 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 (7 lines × 2) paddleseg/models/setr.py:147 — paddleseg/models/setr.py:147-153 | paddleseg/models/setr.py:248-254 — 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) paddleseg/transforms/functional.py:54 — paddleseg/transforms/functional.py:54-60 | paddleseg/transforms/functional.py:65-71 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) Matting/ppmatting/models/human_matting.py:79 — Matting/ppmatting/models/human_matting.py:79-85 | Matting/ppmatting/models/human_matting.py:128-134 — 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 `Matting/ppmatting/models/human_matting.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.
  • Duplicated block (7 lines × 2) paddleseg/models/u2net.py:514 — paddleseg/models/u2net.py:514-520 | paddleseg/models/u2net.py:559-565 — 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 before the matched lines, `paddleseg/models/u2net.py:509` calls `MaxPool2D`, `REBNCONV` and `paddleseg/models/u2net.py:558` 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 (7 lines × 2) Matting/ppmatting/models/rvm.py:477 — Matting/ppmatting/models/rvm.py:477-483 | Matting/ppmatting/models/rvm.py:546-552 — 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 `Matting/ppmatting/models/rvm.py:477` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Matting/ppmatting/models/rvm.py:545` calls `flatten` and `Matting/ppmatting/models/rvm.py:476` 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 (7 lines × 2) Matting/ppmatting/models/backbone/resnet_vd.py:59 — Matting/ppmatting/models/backbone/resnet_vd.py:59-65 | paddleseg/models/backbones/resnet_vd.py:68-74 — before extracting anything, compare `Matting/ppmatting/models/backbone/resnet_vd.py` and `paddleseg/models/backbones/resnet_vd.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 (7 lines × 2) contrib/AutoNUE/models/ocrnet_nv.py:189 — contrib/AutoNUE/models/ocrnet_nv.py:189-195 | contrib/CityscapesSOTA/models/ocrnet_nv.py:198-204 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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) contrib/CrossPseudoSupervision/cvlibs/builder.py:263 — contrib/CrossPseudoSupervision/cvlibs/builder.py:263-269 | paddleseg/cvlibs/builder.py:300-306 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/builder.py` and `paddleseg/cvlibs/builder.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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.
  • + 6 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×29
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2912 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2412 over it, 5.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ts/English.ts EISeg/tool/ts/English.ts — FileTooLong — 1357 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 857 over it, 2.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: EISegMed3D/EISegMed3D.py EISeg/med3d/EISegMed3D/EISegMed3D.py — FileTooLong — 987 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 487 over it, 1.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: models/nnformer.py contrib/MedicalSeg/medicalseg/models/nnformer.py — FileTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 408 over it, 1.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/hrformer.py paddleseg/models/backbones/hrformer.py — FileTooLong — 884 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 384 over it, 1.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: transforms/transforms.py paddleseg/transforms/transforms.py — FileTooLong — 834 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 334 over it, 1.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/lite_hrnet.py paddleseg/models/backbones/lite_hrnet.py — FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 324 over it, 1.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 803 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 303 over it, 1.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/uhrnet.py paddleseg/models/backbones/uhrnet.py — FileTooLong — 744 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 244 over it, 1.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: transforms/functional.py contrib/MedicalSeg/nnunet/transforms/functional.py — FileTooLong — 689 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 189 over it, 1.38× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/efficientformerv2.py paddleseg/models/backbones/efficientformerv2.py — FileTooLong — 681 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 181 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/hrnet.py paddleseg/models/backbones/hrnet.py — FileTooLong — 680 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 180 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/hrnet_nv.py contrib/AutoNUE/models/backbones/hrnet_nv.py — FileTooLong — 676 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 176 over it, 1.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbone/hrnet.py Matting/ppmatting/models/backbone/hrnet.py — FileTooLong — 656 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 156 over it, 1.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/swin_transformer.py paddleseg/models/backbones/swin_transformer.py — FileTooLong — 645 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 145 over it, 1.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/hrnet_nv.py contrib/CityscapesSOTA/models/backbones/hrnet_nv.py — FileTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 139 over it, 1.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/strideformer.py paddleseg/models/backbones/strideformer.py — FileTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 135 over it, 1.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: utils/base_predictor.py contrib/MedicalSeg/nnunet/utils/base_predictor.py — FileTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 130 over it, 1.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: python/infer.py Matting/deploy/python/infer.py — FileTooLong — 629 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 129 over it, 1.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: transforms/transform.py contrib/MedicalSeg/nnunet/transforms/transform.py — FileTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 124 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backbones/top_transformer.py paddleseg/models/backbones/top_transformer.py — FileTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 98 over it, 1.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: preprocess_utils/experiment_planner.py contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py — FileTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 90 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: utils/static_predictor.py contrib/MedicalSeg/nnunet/utils/static_predictor.py — FileTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 60 over it, 1.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: transforms/transforms.py Matting/ppmatting/transforms/transforms.py — FileTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 40 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: models/rtformer.py paddleseg/models/rtformer.py — FileTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 39 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×29
  • Duplicated block (10 lines × 2) REDACTED:1138 — REDACTED:1138-1147 | REDACTED:1189-1198 — 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) REDACTED:1287 — REDACTED:1287-1296 | REDACTED:2622-2631 — 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 `REDACTED:1287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) REDACTED:1519 — REDACTED:1519-1528 | REDACTED:1553-1562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) Matting/ppmatting/core/val.py:93 — Matting/ppmatting/core/val.py:93-102 | contrib/MedicalSeg/medicalseg/core/val.py:87-96 — 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.
  • Duplicated block (10 lines × 2) Matting/ppmatting/core/val.py:137 — Matting/ppmatting/core/val.py:137-146 | Matting/ppmatting/core/val_ml.py:124-133 — 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 (10 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:136 — Matting/ppmatting/models/backbone/hrnet.py:136-145 | paddleseg/models/backbones/hrnet.py:137-146 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 `Matting/ppmatting/models/backbone/hrnet.py:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:149 — Matting/ppmatting/models/backbone/hrnet.py:149-158 | paddleseg/models/backbones/hrnet.py:151-160 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 `Matting/ppmatting/models/backbone/hrnet.py:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Matting/ppmatting/models/gca.py:268 — Matting/ppmatting/models/gca.py:268-277 | Matting/ppmatting/models/gca.py:296-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. 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, `Matting/ppmatting/models/gca.py:295` calls `gca` and `Matting/ppmatting/models/gca.py:267` 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 (10 lines × 2) contrib/AutoNUE/models/backbones/hrnet_nv.py:147 — contrib/AutoNUE/models/backbones/hrnet_nv.py:147-157 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:142-151 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 `contrib/AutoNUE/models/backbones/hrnet_nv.py:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) contrib/CityscapesSOTA/scripts/train.py:39 — contrib/CityscapesSOTA/scripts/train.py:39-48 | contrib/MedicalSeg/medicalseg/utils/loss_utils.py:30-39 — before extracting anything, compare `contrib/CityscapesSOTA/scripts/train.py` and `contrib/MedicalSeg/medicalseg/utils/loss_utils.py` as WHOLE FILES: 82% 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.
  • Duplicated block (10 lines × 2) contrib/LaneSeg/core/infer.py:69 — contrib/LaneSeg/core/infer.py:69-78 | contrib/PanopticDeepLab/core/infer.py:49-58 — before extracting anything, compare `contrib/LaneSeg/core/infer.py` and `contrib/PanopticDeepLab/core/infer.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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) contrib/LaneSeg/export.py:59 — contrib/LaneSeg/export.py:59-68 | contrib/MedicalSeg/export.py:97-107 — `contrib/LaneSeg/export.py` and `contrib/MedicalSeg/export.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 42 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: `Config` names `medicalseg.cvlibs` in one and `paddleseg.cvlibs` 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.
  • Duplicated block (10 lines × 2) contrib/MedicalSeg/nnunet/transforms/augmentation.py:45 — contrib/MedicalSeg/nnunet/transforms/augmentation.py:45-54 | contrib/MedicalSeg/nnunet/transforms/augmentation.py:219-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note 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 (10 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:203 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:203-212 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:208-217 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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) contrib/QualityInspector/qinspector/uad/utils/utils.py:303 — contrib/QualityInspector/qinspector/uad/utils/utils.py:303-312 | contrib/QualityInspector/tools/uad/padim/predict.py:167-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) deploy/fastdeploy/semantic_segmentation/rockchip/rknpu2/python/infer.py:20 — deploy/fastdeploy/semantic_segmentation/rockchip/rknpu2/python/infer.py:20-29 | deploy/fastdeploy/semantic_segmentation/sophgo/python/infer.py:7-16 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) paddleseg/models/danet.py:62 — paddleseg/models/danet.py:62-71 | paddleseg/models/ocrnet.py:70-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `paddleseg/models/danet.py:62` 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 (10 lines × 2) paddleseg/models/knet.py:167 — paddleseg/models/knet.py:167-176 | paddleseg/models/knet.py:234-243 — 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 (10 lines × 2) paddleseg/models/pfpnnet.py:178 — paddleseg/models/pfpnnet.py:178-187 | paddleseg/models/pointrend.py:689-698 — 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 (10 lines × 2) paddleseg/models/pp_mobileseg.py:108 — paddleseg/models/pp_mobileseg.py:108-117 | paddleseg/models/topformer.py:102-111 — 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. 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. Note first that the copies are not typed on the same thing: `ConvBNAct` names `paddleseg.models.backbones.strideformer` in one and `paddleseg.models.backbones.top_transformer` 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.
  • Duplicated block (10 lines × 2) paddleseg/models/sinet.py:163 — paddleseg/models/sinet.py:163-172 | paddleseg/models/sinet.py:216-225 — 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 `paddleseg/models/sinet.py:163` 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 after the matched lines, `paddleseg/models/sinet.py:226` calls `SqueezeBlock` and `paddleseg/models/sinet.py:173` 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.
  • Duplicated block (10 lines × 2) contrib/DomainAdaptation/utils/config_check.py:32 — contrib/DomainAdaptation/utils/config_check.py:32-41 | contrib/MedicalSeg/medicalseg/utils/config_check.py:32-41 — before extracting anything, compare `contrib/DomainAdaptation/utils/config_check.py` and `contrib/MedicalSeg/medicalseg/utils/config_check.py` as WHOLE FILES: 96% 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.
  • Duplicated block (10 lines × 2) Matting/ppmatting/models/backbone/gca_enc.py:380 — Matting/ppmatting/models/backbone/gca_enc.py:380-389 | Matting/ppmatting/models/gca.py:73-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) Matting/ppmatting/models/ppmattingv2.py:523 — Matting/ppmatting/models/ppmattingv2.py:523-532 | paddleseg/models/backbones/top_transformer.py:333-342 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) contrib/CrossPseudoSupervision/cvlibs/builder.py:226 — contrib/CrossPseudoSupervision/cvlibs/builder.py:226-235 | paddleseg/cvlibs/builder.py:271-280 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/builder.py` and `paddleseg/cvlibs/builder.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×28
  • Duplicated block (9 lines × 2) EISeg/eiseg/plugin/video/load_model.py:57 — EISeg/eiseg/plugin/video/load_model.py:57-65 | EISeg/eiseg/plugin/video/load_model.py:74-82 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `EISeg/eiseg/plugin/video/load_model.py:73` calls `copy_from_cpu` and `EISeg/eiseg/plugin/video/load_model.py:56` 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 (9 lines × 2) EISeg/med3d/EISegMed3D/inference/models.py:468 — EISeg/med3d/EISegMed3D/inference/models.py:468-476 | contrib/MedicalSeg/medicalseg/models/vnet.py:258-266 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 × 2) Matting/deploy/python/infer.py:331 — Matting/deploy/python/infer.py:331-339 | Matting/deploy/python/infer.py:556-564 — 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) Matting/ppmatting/models/layers/tensor_fusion_helper.py:22 — Matting/ppmatting/models/layers/tensor_fusion_helper.py:22-30 | paddleseg/models/layers/tensor_fusion_helper.py:98-106 — before extracting anything, compare `Matting/ppmatting/models/layers/tensor_fusion_helper.py` and `paddleseg/models/layers/tensor_fusion_helper.py` as WHOLE FILES: 100% 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 (9 lines × 2) Matting/ppmatting/models/layers/tensor_fusion_helper.py:36 — Matting/ppmatting/models/layers/tensor_fusion_helper.py:36-44 | paddleseg/models/layers/tensor_fusion_helper.py:112-120 — before extracting anything, compare `Matting/ppmatting/models/layers/tensor_fusion_helper.py` and `paddleseg/models/layers/tensor_fusion_helper.py` as WHOLE FILES: 100% 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.
  • Duplicated block (9 lines × 2) contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:68 — contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:68-76 | paddleseg/models/losses/ohem_edge_attention_loss.py:87-95 — 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 (9 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:644 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:644-652 | contrib/MedicalSeg/medicalseg/models/swinunet.py:154-162 — 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 (9 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:237 — contrib/MedicalSeg/medicalseg/transforms/functional.py:237-245 | contrib/MedicalSeg/nnunet/transforms/functional.py:351-359 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (9 lines × 2) contrib/MedicalSeg/medicalseg/utils/download.py:148 — contrib/MedicalSeg/medicalseg/utils/download.py:148-156 | paddleseg/utils/download.py:158-166 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `paddleseg/utils/download.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 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 × 2) contrib/MedicalSeg/medicalseg/utils/timer.py:45 — contrib/MedicalSeg/medicalseg/utils/timer.py:45-53 | paddleseg/utils/timer.py:45-53 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/timer.py` and `paddleseg/utils/timer.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (9 lines × 2) contrib/MedicalSeg/nnunet/transforms/functional.py:696 — contrib/MedicalSeg/nnunet/transforms/functional.py:696-704 | contrib/MedicalSeg/nnunet/transforms/functional.py:706-714 — 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) contrib/PanopticDeepLab/core/val.py:137 — contrib/PanopticDeepLab/core/val.py:137-145 | contrib/PanopticSeg/paddlepanseg/core/val.py:132-140 — 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 (9 lines × 2) contrib/QualityInspector/tools/dataset/labelme2seg.py:111 — contrib/QualityInspector/tools/dataset/labelme2seg.py:111-119 | tools/data/labelme2seg.py:66-74 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/labelme2seg.py` and `tools/data/labelme2seg.py` as WHOLE FILES: this scan already matched 5 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. 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 (9 lines × 2) contrib/QualityInspector/tools/seg/model/analyze_model.py:35 — contrib/QualityInspector/tools/seg/model/analyze_model.py:35-43 | tools/model/analyze_model.py:35-43 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/analyze_model.py` and `tools/model/analyze_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 118 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 (9 lines × 2) contrib/QualityInspector/tools/seg/model/analyze_model.py:134 — contrib/QualityInspector/tools/seg/model/analyze_model.py:134-142 | tools/model/analyze_model.py:134-142 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/analyze_model.py` and `tools/model/analyze_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 118 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, `tools/model/analyze_model.py:143` calls `SegBuilder` and `contrib/QualityInspector/tools/seg/model/analyze_model.py:144` 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.
  • Duplicated block (9 lines × 2) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:93 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:93-101 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:194-202 — 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 `contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:93` 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 (9 lines × 2) contrib/SegmentAnything/segment_anything/modeling/tiny_vit_sam.py:384 — contrib/SegmentAnything/segment_anything/modeling/tiny_vit_sam.py:384-392 | paddleseg/models/backbones/efficientformerv2.py:288-296 — 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 (9 lines × 2) paddleseg/models/layers/tensor_fusion.py:98 — paddleseg/models/layers/tensor_fusion.py:98-106 | paddleseg/models/layers/tensor_fusion.py:134-142 — 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 `paddleseg/models/layers/tensor_fusion.py:98` 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 (9 lines × 2) paddleseg/models/losses/cross_entropy_loss.py:75 — paddleseg/models/losses/cross_entropy_loss.py:75-83 | paddleseg/models/losses/cross_entropy_loss.py:212-220 — 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) paddleseg/models/backbones/seaformer.py:478 — paddleseg/models/backbones/seaformer.py:478-486 | paddleseg/models/backbones/seaformer.py:495-503 — 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 `paddleseg/models/backbones/seaformer.py:478` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) contrib/MedicalSeg/medicalseg/core/infer.py:132 — contrib/MedicalSeg/medicalseg/core/infer.py:132-140 | contrib/MedicalSeg/medicalseg/core/infer.py:148-156 — 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) Matting/ppmatting/core/val.py:30 — Matting/ppmatting/core/val.py:30-38 | Matting/ppmatting/core/val_ml.py:32-40 — 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 (9 lines × 2) Matting/ppmatting/models/backbone/mobilenetv3.py:147 — Matting/ppmatting/models/backbone/mobilenetv3.py:147-155 | paddleseg/models/backbones/mobilenetv3.py:128-136 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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) contrib/PanopticSeg/paddlepanseg/models/mask2former/common.py:30 — contrib/PanopticSeg/paddlepanseg/models/mask2former/common.py:30-38 | paddleseg/models/maskformer.py:239-247 — 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 (9 lines × 2) paddleseg/models/backbones/mobilenetv3.py:317 — paddleseg/models/backbones/mobilenetv3.py:317-325 | paddleseg/models/backbones/strideformer.py:315-323 — before extracting anything, compare `paddleseg/models/backbones/mobilenetv3.py` and `paddleseg/models/backbones/strideformer.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×28
  • Duplicated block (6 lines × 2) EISeg/eiseg/util/coco/cocoeval.py:546 — EISeg/eiseg/util/coco/cocoeval.py:546-551 | EISeg/eiseg/util/coco/cocoeval.py:560-565 — 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 `EISeg/eiseg/util/coco/cocoeval.py:546` 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 (6 lines × 2) EISeg/tool/medical2video.py:37 — EISeg/tool/medical2video.py:37-42 | contrib/MedicalSeg/tools/prepare.py:180-185 — 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, `contrib/MedicalSeg/tools/prepare.py:186` calls `transpose` and `EISeg/tool/medical2video.py:43` 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.
  • Duplicated block (6 lines × 2) Matting/ppmatting/models/backbone/gca_enc.py:88 — Matting/ppmatting/models/backbone/gca_enc.py:88-93 | Matting/ppmatting/models/gca.py:195-200 — 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 `Matting/ppmatting/models/backbone/gca_enc.py:88` 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) contrib/MedicalSeg/nnunet/single_fold_eval.py:37 — contrib/MedicalSeg/nnunet/single_fold_eval.py:37-42 | contrib/MedicalSeg/nnunet/utils/predict_utils.py:52-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) contrib/PanopticDeepLab/transforms/target_transforms.py:149 — contrib/PanopticDeepLab/transforms/target_transforms.py:149-154 | contrib/PanopticSeg/paddlepanseg/transforms/generate_targets/panoptic_deeplab.py:98-103 — 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 `contrib/PanopticDeepLab/transforms/target_transforms.py:149` 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 (6 lines × 2) contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:170 — contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:170-175 | paddleseg/models/maskformer.py:589-594 — 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, `paddleseg/models/maskformer.py:596` calls `init_weight`, `th_linear_fill` and `contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.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 (6 lines × 2) contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:53 — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:53-58 | paddleseg/models/pointrend.py:382-388 — 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) contrib/RSSegBenchmark/c2fnet/core/infer.py:41 — contrib/RSSegBenchmark/c2fnet/core/infer.py:41-46 | paddleseg/core/infer.py:42-47 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/infer.py` and `paddleseg/core/infer.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 145 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 `contrib/RSSegBenchmark/c2fnet/core/infer.py:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) contrib/SegmentAnything/scripts/amg_paddle.py:183 — contrib/SegmentAnything/scripts/amg_paddle.py:183-189 | contrib/SegmentAnything/scripts/text_to_sam_clip.py:105-110 — before extracting anything, compare `contrib/SegmentAnything/scripts/amg_paddle.py` and `contrib/SegmentAnything/scripts/text_to_sam_clip.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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.
  • Duplicated block (6 lines × 2) paddleseg/models/losses/cross_entropy_loss.py:147 — paddleseg/models/losses/cross_entropy_loss.py:147-152 | paddleseg/models/losses/point_cross_entropy_loss.py:118-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Matting/deploy/python/infer.py:610 — Matting/deploy/python/infer.py:610-615 | Matting/deploy/python/infer.py:656-661 — 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 before the matched lines, `Matting/deploy/python/infer.py:654` calls `stamp` and `Matting/deploy/python/infer.py:609` 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 (6 lines × 2) contrib/PanopticDeepLab/transforms/target_transforms.py:53 — contrib/PanopticDeepLab/transforms/target_transforms.py:53-58 | contrib/PanopticSeg/paddlepanseg/transforms/generate_targets/panoptic_deeplab.py:38-43 — 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) contrib/QualityInspector/tools/dataset/labelme2seg.py:102 — contrib/QualityInspector/tools/dataset/labelme2seg.py:102-107 | tools/data/labelme2seg.py:57-62 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/labelme2seg.py` and `tools/data/labelme2seg.py` as WHOLE FILES: this scan already matched 5 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) EISeg/eiseg/inference/predictor/base.py:180 — EISeg/eiseg/inference/predictor/base.py:180-185 | EISeg/med3d/EISegMed3D/inference/predictor.py:234-239 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) REDACTED:27 — REDACTED:27-32 | REDACTED:32-37 — 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 (6 lines × 2) Matting/deploy/python/infer.py:171 — Matting/deploy/python/infer.py:171-176 | paddleseg/deploy/infer.py:46-52 — before extracting anything, compare `Matting/deploy/python/infer.py` and `paddleseg/deploy/infer.py` as WHOLE FILES: 85% 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 (6 lines × 2) Matting/ppmatting/models/backbone/mobilenet_v2.py:119 — Matting/ppmatting/models/backbone/mobilenet_v2.py:119-124 | paddleseg/models/backbones/mobilenetv2.py:188-193 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenet_v2.py` and `paddleseg/models/backbones/mobilenetv2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 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 (6 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:431 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:431-436 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:436-441 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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 (6 lines × 2) contrib/QualityInspector/qinspector/uad/models/stfpm.py:39 — contrib/QualityInspector/qinspector/uad/models/stfpm.py:39-44 | paddleseg/models/backbones/resnet_ms3.py:43-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) contrib/QualityInspector/tools/dataset/visualize_annotation.py:78 — contrib/QualityInspector/tools/dataset/visualize_annotation.py:78-83 | tools/data/visualize_annotation.py:69-74 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/visualize_annotation.py` and `tools/data/visualize_annotation.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 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) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:324 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:324-329 | paddleseg/models/fcn.py:129-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) paddleseg/models/attention_unet.py:167 — paddleseg/models/attention_unet.py:167-172 | paddleseg/models/unet.py:96-101 — 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 (6 lines × 2) contrib/MedicalSeg/nnunet/datasets/dataloader.py:94 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:94-99 | contrib/MedicalSeg/nnunet/datasets/dataloader.py:293-298 — 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 `contrib/MedicalSeg/nnunet/datasets/dataloader.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 (6 lines × 2) deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/view/CameraSurfaceView.java:317 — deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/view/CameraSurfaceView.java:317-322 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/view/CameraSurfaceView.java:326-331 — 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 (6 lines × 2) tools/data/convert_cocostuff.py:95 — tools/data/convert_cocostuff.py:95-100 | tools/data/convert_cocostuff.py:102-107 — 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×27
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Matting/deploy/python/infer.py:237 — Matting/deploy/python/infer.py:237-271 | contrib/MedicalSeg/deploy/python/infer.py:282-316 | contrib/PanopticSeg/deploy/python/infer.py:189-236 | deploy/python/infer.py:91-139 — 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) Matting/deploy/python/infer.py:331 — Matting/deploy/python/infer.py:331-421 | Matting/deploy/python/infer.py:486-536 | Matting/deploy/python/infer.py:556-666 | Matting/deploy/python/infer.py:669-739 — 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) Matting/ppmatting/metrics/metric.py:38 — Matting/ppmatting/metrics/metric.py:38-65 | Matting/ppmatting/metrics/metric.py:82-109 | Matting/ppmatting/metrics/metric.py:160-196 | Matting/ppmatting/metrics/metric.py:214-274 — 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) Matting/ppmatting/models/backbone/hrnet.py:164 — Matting/ppmatting/models/backbone/hrnet.py:164-182 | contrib/AutoNUE/models/backbones/hrnet_nv.py:160-189 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:154-183 | paddleseg/models/backbones/hrnet.py:167-196 — 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) Matting/ppmatting/models/backbone/hrnet.py:231 — Matting/ppmatting/models/backbone/hrnet.py:231-257 | contrib/AutoNUE/models/backbones/hrnet_nv.py:234-261 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:230-255 | paddleseg/models/backbones/hrnet.py:245-271 — 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) Matting/ppmatting/models/backbone/hrnet.py:260 — Matting/ppmatting/models/backbone/hrnet.py:260-269 | contrib/AutoNUE/models/backbones/hrnet_nv.py:264-273 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:258-267 | paddleseg/models/backbones/hrnet.py:274-283 — 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) Matting/ppmatting/models/backbone/hrnet.py:436 — Matting/ppmatting/models/backbone/hrnet.py:436-455 | contrib/AutoNUE/models/backbones/hrnet_nv.py:437-456 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:425-444 | paddleseg/models/backbones/hrnet.py:456-475 — 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) Matting/ppmatting/models/backbone/hrnet.py:458 — Matting/ppmatting/models/backbone/hrnet.py:458-467 | contrib/AutoNUE/models/backbones/hrnet_nv.py:459-468 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:447-456 | paddleseg/models/backbones/hrnet.py:478-487 — 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) Matting/ppmatting/models/ppmattingv2.py:549 — Matting/ppmatting/models/ppmattingv2.py:549-564 | paddleseg/models/backbones/seaformer.py:447-463 | paddleseg/models/backbones/strideformer.py:615-631 | paddleseg/models/backbones/top_transformer.py:359-374 — 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) Matting/tools/bg_replace.py:94 — Matting/tools/bg_replace.py:94-123 | Matting/tools/bg_replace_video.py:81-100 | Matting/tools/predict.py:82-109 | Matting/tools/predict_video.py:74-92 — 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) contrib/AutoNUE/predict.py:129 — contrib/AutoNUE/predict.py:129-166 | contrib/CityscapesSOTA/predict.py:132-166 | contrib/LaneSeg/predict.py:72-105 | contrib/PanopticDeepLab/predict.py:103-141 — 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) contrib/CityscapesSOTA/scripts/train.py:37 — contrib/CityscapesSOTA/scripts/train.py:37-57 | contrib/MedicalSeg/medicalseg/utils/loss_utils.py:26-52 | contrib/RSSegBenchmark/c2fnet/core/train.py:38-56 | paddleseg/core/train.py:45-63 — 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) contrib/CrossPseudoSupervision/predict.py:102 — contrib/CrossPseudoSupervision/predict.py:102-116 | contrib/QualityInspector/tools/seg/predict.py:100-114 | tools/analyse.py:113-127 | tools/predict.py:112-130 — 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) contrib/CrossPseudoSupervision/train.py:25 — contrib/CrossPseudoSupervision/train.py:25-104 | contrib/PanopticSeg/tools/val.py:25-57 | contrib/QualityInspector/tools/seg/train.py:28-128 | tools/train.py:31-163 — 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) contrib/LaneSeg/deploy/python/infer.py:105 — contrib/LaneSeg/deploy/python/infer.py:105-140 | contrib/MedicalSeg/deploy/python/infer.py:377-464 | contrib/PanopticSeg/deploy/python/infer.py:296-348 | deploy/python/infer.py:199-250 — 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) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:123 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:123-166 | contrib/MedicalSeg/medicalseg/models/nnformer.py:277-314 | paddleseg/models/backbones/hrformer.py:91-124 | paddleseg/models/backbones/swin_transformer.py:110-150 — 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) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:579 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:579-641 | contrib/MedicalSeg/medicalseg/models/nnformer.py:846-893 | contrib/MedicalSeg/medicalseg/models/nnformer.py:936-968 | paddleseg/models/backbones/swin_transformer.py:573-642 — 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) contrib/MedicalSeg/medicalseg/utils/visualize.py:45 — contrib/MedicalSeg/medicalseg/utils/visualize.py:45-77 | contrib/SegmentAnything/scripts/amg_paddle.py:193-217 | contrib/SegmentAnything/scripts/text_to_sam_clip.py:114-137 | paddleseg/utils/visualize.py:23-71 — 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) contrib/MedicalSeg/nnunet/utils/base_predictor.py:377 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:377-432 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:440-474 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:362-412 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:419-449 — 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) contrib/MedicalSeg/nnunet/utils/base_predictor.py:586 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:586-598 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:612-626 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:560-572 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:586-600 — 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) contrib/MedicalSeg/nnunet/utils/metrics.py:145 — contrib/MedicalSeg/nnunet/utils/metrics.py:145-156 | contrib/MedicalSeg/nnunet/utils/metrics.py:164-175 | contrib/MedicalSeg/nnunet/utils/metrics.py:192-203 | contrib/MedicalSeg/nnunet/utils/metrics.py:241-252 — 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) contrib/MedicalSeg/nnunet/utils/metrics.py:340 — contrib/MedicalSeg/nnunet/utils/metrics.py:340-350 | contrib/MedicalSeg/nnunet/utils/metrics.py:360-371 | contrib/MedicalSeg/nnunet/utils/metrics.py:381-391 | contrib/MedicalSeg/nnunet/utils/metrics.py:401-412 — 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) contrib/QualityInspector/tools/uad/padim/predict.py:43 — contrib/QualityInspector/tools/uad/padim/predict.py:43-66 | contrib/QualityInspector/tools/uad/patchcore/predict.py:35-72 | contrib/QualityInspector/tools/uad/patchcore/train.py:46-97 | contrib/QualityInspector/tools/uad/patchcore/val.py:46-89 — 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) paddleseg/models/backbones/swin_transformer.py:719 — paddleseg/models/backbones/swin_transformer.py:719-742 | paddleseg/models/backbones/swin_transformer.py:778-801 | paddleseg/models/backbones/swin_transformer.py:850-873 | paddleseg/models/backbones/swin_transformer.py:922-945 — 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) paddleseg/models/emanet.py:75 — paddleseg/models/emanet.py:75-86 | paddleseg/models/sfnet.py:76-86 | paddleseg/models/upernet.py:76-86 | paddleseg/models/upernet_vit_adapter.py:84-94 — 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×24
  • Duplicated block (15 lines × 2) Matting/ppmatting/transforms/transforms.py:329 — Matting/ppmatting/transforms/transforms.py:329-343 | Matting/ppmatting/transforms/transforms.py:365-379 — 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 (15 lines × 2) contrib/AutoNUE/core/predict_ensemble_three.py:162 — contrib/AutoNUE/core/predict_ensemble_three.py:162-176 | contrib/AutoNUE/core/val_crop.py:115-129 — 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 `contrib/AutoNUE/core/predict_ensemble_three.py:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) contrib/CrossPseudoSupervision/cvlibs/builder.py:186 — contrib/CrossPseudoSupervision/cvlibs/builder.py:186-200 | paddleseg/cvlibs/builder.py:242-256 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/builder.py` and `paddleseg/cvlibs/builder.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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) contrib/CrossPseudoSupervision/cvlibs/config.py:184 — contrib/CrossPseudoSupervision/cvlibs/config.py:184-198 | paddleseg/cvlibs/config.py:177-191 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/config.py` and `paddleseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 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 (15 lines × 2) contrib/LaneSeg/core/train.py:38 — contrib/LaneSeg/core/train.py:38-52 | deploy/slim/distill/distill_utils.py:39-53 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `deploy/slim/distill/distill_utils.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 240 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) contrib/LaneSeg/core/train.py:198 — contrib/LaneSeg/core/train.py:198-212 | contrib/RSSegBenchmark/c2fnet/core/train.py:237-251 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 284 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, `contrib/RSSegBenchmark/c2fnet/core/train.py:234` calls `isinstance`, `step` and `contrib/LaneSeg/core/train.py:197` 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 (15 lines × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:390 — contrib/MedicalSeg/medicalseg/models/nnformer.py:390-404 | contrib/MedicalSeg/medicalseg/models/nnformer.py:494-508 — 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 `contrib/MedicalSeg/medicalseg/models/nnformer.py:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) contrib/MedicalSeg/medicalseg/transforms/transform.py:272 — contrib/MedicalSeg/medicalseg/transforms/transform.py:272-286 | contrib/MedicalSeg/medicalseg/transforms/transform.py:565-579 — 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 (15 lines × 2) contrib/MedicalSeg/nnunet/infer.py:167 — contrib/MedicalSeg/nnunet/infer.py:167-181 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:672-686 — 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 (15 lines × 2) contrib/MedicalSeg/nnunet/infer.py:222 — contrib/MedicalSeg/nnunet/infer.py:222-236 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:756-770 — 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, `contrib/MedicalSeg/nnunet/utils/base_predictor.py:755` calls `set_state_dict` and `contrib/MedicalSeg/nnunet/infer.py:221` 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.
  • Duplicated block (15 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:298 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:298-312 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:284-298 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 `contrib/MedicalSeg/nnunet/utils/base_predictor.py:298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:340 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:340-354 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:326-340 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 `contrib/MedicalSeg/nnunet/utils/base_predictor.py:340` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) contrib/PanopticDeepLab/core/train.py:275 — contrib/PanopticDeepLab/core/train.py:275-289 | contrib/PanopticSeg/paddlepanseg/core/train.py:269-283 — before extracting anything, compare `contrib/PanopticDeepLab/core/train.py` and `contrib/PanopticSeg/paddlepanseg/core/train.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 226 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) contrib/PanopticDeepLab/models/panoptic_deeplab.py:179 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:179-193 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:184-198 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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) contrib/PanopticDeepLab/models/panoptic_deeplab.py:379 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:379-393 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:384-398 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:73 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:73-87 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:71-85 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/panoptic.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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) contrib/PanopticDeepLab/utils/evaluation/semantic.py:67 — contrib/PanopticDeepLab/utils/evaluation/semantic.py:67-81 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/sem_seg_evaluator.py:47-61 — 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 (15 lines × 2) contrib/QualityInspector/tools/uad/padim/train.py:104 — contrib/QualityInspector/tools/uad/padim/train.py:104-118 | contrib/QualityInspector/tools/uad/patchcore/train.py:132-146 — `contrib/QualityInspector/tools/uad/padim/train.py` and `contrib/QualityInspector/tools/uad/patchcore/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/QualityInspector/tools/uad/padim/train.py:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) contrib/RSSegBenchmark/c2fnet/core/train.py:138 — contrib/RSSegBenchmark/c2fnet/core/train.py:138-152 | paddleseg/core/train.py:147-161 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/train.py` and `paddleseg/core/train.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 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 `contrib/RSSegBenchmark/c2fnet/core/train.py:138` 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 (15 lines × 2) paddleseg/core/train.py:225 — paddleseg/core/train.py:225-239 | paddleseg/core/train.py:249-263 — 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 (15 lines × 2) paddleseg/datasets/mini_deep_globe_road_extraction.py:80 — paddleseg/datasets/mini_deep_globe_road_extraction.py:80-94 | paddleseg/datasets/pp_humanseg14k.py:67-81 — before extracting anything, compare `paddleseg/datasets/mini_deep_globe_road_extraction.py` and `paddleseg/datasets/pp_humanseg14k.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) paddleseg/models/encnet.py:198 — paddleseg/models/encnet.py:198-212 | paddleseg/models/fastfcn.py:218-232 — before extracting anything, compare `paddleseg/models/encnet.py` and `paddleseg/models/fastfcn.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:216 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:216-230 | paddleseg/models/backbones/swin_transformer.py:179-193 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py` and `paddleseg/models/backbones/swin_transformer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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) contrib/PanopticDeepLab/utils/visualize.py:50 — contrib/PanopticDeepLab/utils/visualize.py:50-64 | contrib/PanopticSeg/paddlepanseg/utils/visualize.py:102-116 — 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 (14 lines × 2) · ×24
  • Duplicated block (14 lines × 2) Matting/ppmatting/models/backbone/gca_enc.py:124 — Matting/ppmatting/models/backbone/gca_enc.py:124-137 | Matting/ppmatting/models/gca.py:238-251 — 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 (14 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:358 — Matting/ppmatting/models/backbone/hrnet.py:358-371 | paddleseg/models/backbones/hrnet.py:374-387 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 (14 lines × 2) Matting/ppmatting/models/backbone/stdcnet.py:135 — Matting/ppmatting/models/backbone/stdcnet.py:135-148 | Matting/ppmatting/models/backbone/stdcnet.py:203-216 — 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 `Matting/ppmatting/models/backbone/stdcnet.py:135` 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 (14 lines × 2) contrib/AutoNUE/models/ocrnet_nv.py:62 — contrib/AutoNUE/models/ocrnet_nv.py:62-75 | contrib/CityscapesSOTA/models/ocrnet_nv.py:65-78 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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, `contrib/CityscapesSOTA/models/ocrnet_nv.py:81` calls `init_weight` and `contrib/AutoNUE/models/ocrnet_nv.py:78` 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 (14 lines × 2) contrib/CrossPseudoSupervision/cvlibs/config.py:167 — contrib/CrossPseudoSupervision/cvlibs/config.py:167-180 | paddleseg/cvlibs/config.py:160-173 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/config.py` and `paddleseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 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 (14 lines × 2) contrib/CrossPseudoSupervision/train.py:119 — contrib/CrossPseudoSupervision/train.py:119-132 | contrib/QualityInspector/tools/seg/train.py:142-155 — before extracting anything, compare `contrib/CrossPseudoSupervision/train.py` and `contrib/QualityInspector/tools/seg/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 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 (14 lines × 2) contrib/LaneSeg/core/infer.py:51 — contrib/LaneSeg/core/infer.py:51-64 | contrib/PanopticDeepLab/core/infer.py:43-56 — before extracting anything, compare `contrib/LaneSeg/core/infer.py` and `contrib/PanopticDeepLab/core/infer.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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 (14 lines × 2) contrib/MedicalSeg/medicalseg/models/losses/mixes_losses.py:37 — contrib/MedicalSeg/medicalseg/models/losses/mixes_losses.py:37-50 | paddleseg/models/losses/mixed_loss.py:37-50 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/mixes_losses.py` and `paddleseg/models/losses/mixed_loss.py` as WHOLE FILES: 89% 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.
  • Duplicated block (14 lines × 2) contrib/MedicalSeg/nnunet/datasets/dataset.py:386 — contrib/MedicalSeg/nnunet/datasets/dataset.py:386-399 | contrib/MedicalSeg/nnunet/losses/multiple_losses.py:79-92 — 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 `contrib/MedicalSeg/nnunet/datasets/dataset.py:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) contrib/MedicalSeg/nnunet/infer.py:263 — contrib/MedicalSeg/nnunet/infer.py:263-276 | contrib/MedicalSeg/nnunet/predict.py:299-312 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/MedicalSeg/nnunet/infer.py:263` 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 (14 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:138 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:138-151 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:125-138 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 `contrib/MedicalSeg/nnunet/utils/base_predictor.py:138` 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 (14 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:194 — contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:194-207 | contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:516-529 — 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) contrib/PanopticDeepLab/transforms/target_transforms.py:128 — contrib/PanopticDeepLab/transforms/target_transforms.py:128-141 | contrib/PanopticSeg/paddlepanseg/transforms/generate_targets/panoptic_deeplab.py:81-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) contrib/RSSegBenchmark/c2fnet/core/predict.py:109 — contrib/RSSegBenchmark/c2fnet/core/predict.py:109-122 | paddleseg/core/analyse.py:106-119 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/predict.py` and `paddleseg/core/analyse.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 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 (14 lines × 2) contrib/RSSegBenchmark/c2fnet/predict.py:172 — contrib/RSSegBenchmark/c2fnet/predict.py:172-185 | contrib/RSSegBenchmark/predict.py:164-177 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/predict.py` and `contrib/RSSegBenchmark/predict.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 231 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 `contrib/RSSegBenchmark/c2fnet/predict.py:172` 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 (14 lines × 2) contrib/RSSegBenchmark/c2fnet/train.py:251 — contrib/RSSegBenchmark/c2fnet/train.py:251-264 | contrib/RSSegBenchmark/train.py:241-254 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/train.py` and `contrib/RSSegBenchmark/train.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 390 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 `contrib/RSSegBenchmark/c2fnet/train.py:251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) paddleseg/models/layers/layer_libs.py:160 — paddleseg/models/layers/layer_libs.py:160-173 | paddleseg/models/layers/layer_libs.py:556-569 — 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) REDACTED:84 — REDACTED:84-97 | REDACTED:89-102 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 `REDACTED:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) paddleseg/models/pphumanseg_lite.py:115 — paddleseg/models/pphumanseg_lite.py:115-128 | paddleseg/models/pphumanseg_lite.py:147-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.
  • Duplicated block (14 lines × 2) paddleseg/models/backbones/efficientformerv2.py:180 — paddleseg/models/backbones/efficientformerv2.py:180-193 | paddleseg/models/backbones/hrformer.py:983-996 — 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) contrib/MedicalSeg/nnunet/datasets/dataloader.py:154 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:154-167 | contrib/MedicalSeg/nnunet/datasets/dataloader.py:399-412 — 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 `contrib/MedicalSeg/nnunet/datasets/dataloader.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 (14 lines × 2) contrib/MedicalSeg/medicalseg/utils/train_profiler.py:62 — contrib/MedicalSeg/medicalseg/utils/train_profiler.py:62-75 | paddleseg/utils/train_profiler.py:62-75 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/train_profiler.py` and `paddleseg/utils/train_profiler.py` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (14 lines × 2) paddleseg/models/backbones/pidnet.py:527 — paddleseg/models/backbones/pidnet.py:527-540 | paddleseg/models/pidnet.py:151-164 — 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 (14 lines × 2) paddleseg/models/decoupled_segnet.py:221 — paddleseg/models/decoupled_segnet.py:221-234 | paddleseg/models/sfnet.py:206-219 — 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 (5 lines × 2) · ×23
  • Duplicated block (5 lines × 2) EISeg/eiseg/plugin/n2grid/grid.py:97 — EISeg/eiseg/plugin/n2grid/grid.py:97-102 | EISeg/eiseg/plugin/remotesensing/raster.py:192-196 — 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) EISeg/eiseg/util/coco/coco.py:292 — EISeg/eiseg/util/coco/coco.py:292-297 | EISeg/eiseg/util/coco/coco.py:320-324 — 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 `EISeg/eiseg/util/coco/coco.py:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) EISeg/eiseg/util/coco/cocoeval.py:496 — EISeg/eiseg/util/coco/cocoeval.py:496-500 | EISeg/eiseg/util/coco/cocoeval.py:505-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. Read the line range as the matched WINDOW rather than a finished unit: at `EISeg/eiseg/util/coco/cocoeval.py:496` 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) Matting/deploy/python/infer.py:151 — Matting/deploy/python/infer.py:151-155 | paddleseg/deploy/infer.py:25-30 — before extracting anything, compare `Matting/deploy/python/infer.py` and `paddleseg/deploy/infer.py` as WHOLE FILES: 85% 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.
  • Duplicated block (5 lines × 2) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:136 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:136-140 | paddleseg/models/losses/binary_cross_entropy_loss.py:137-141 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py` and `paddleseg/models/losses/binary_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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, `paddleseg/models/losses/binary_cross_entropy_loss.py:136` calls `where`, `zeros_like` and `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:135` 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.
  • Duplicated block (5 lines × 2) contrib/QualityInspector/tools/uad/padim/predict.py:152 — contrib/QualityInspector/tools/uad/padim/predict.py:152-156 | contrib/QualityInspector/tools/uad/padim/val.py:248-252 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/predict.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 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 × 2) paddleseg/models/backbones/seaformer.py:383 — paddleseg/models/backbones/seaformer.py:383-388 | paddleseg/models/backbones/strideformer.py:518-522 — 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 `paddleseg/models/backbones/seaformer.py:383` 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 (5 lines × 2) paddleseg/models/efficientformerv2_seg.py:268 — paddleseg/models/efficientformerv2_seg.py:268-274 | paddleseg/models/pointrend.py:646-650 — 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 (5 lines × 2) Matting/ppmatting/models/backbone/mobilenetv3.py:310 — Matting/ppmatting/models/backbone/mobilenetv3.py:310-314 | paddleseg/models/backbones/mobilenetv3.py:266-270 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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 (5 lines × 2) Matting/ppmatting/models/human_matting.py:30 — Matting/ppmatting/models/human_matting.py:30-34 | Matting/ppmatting/models/ppmatting.py:231-235 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Matting/ppmatting/models/human_matting.py:336 — Matting/ppmatting/models/human_matting.py:336-340 | Matting/ppmatting/models/ppmatting.py:159-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. 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) Matting/ppmatting/transforms/transforms.py:513 — Matting/ppmatting/transforms/transforms.py:513-518 | paddleseg/transforms/transforms.py:119-123 — before extracting anything, compare `Matting/ppmatting/transforms/transforms.py` and `paddleseg/transforms/transforms.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (5 lines × 2) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:35 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:35-39 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:34-38 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/panoptic.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 (5 lines × 2) paddleseg/models/attention_unet.py:160 — paddleseg/models/attention_unet.py:160-164 | paddleseg/models/unet.py:89-93 — 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 (5 lines × 2) REDACTED:255 — REDACTED:255-259 | REDACTED:233-237 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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.
  • Duplicated block (5 lines × 2) contrib/PanopticDeepLab/utils/evaluation/semantic.py:36 — contrib/PanopticDeepLab/utils/evaluation/semantic.py:36-40 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/sem_seg_evaluator.py:23-27 — 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) EISeg/eiseg/util/coco/cocoeval.py:515 — EISeg/eiseg/util/coco/cocoeval.py:515-519 | EISeg/eiseg/util/coco/cocoeval.py:520-524 — 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) EISeg/eiseg/widget/label_corres.py:179 — EISeg/eiseg/widget/label_corres.py:179-183 | EISeg/eiseg/widget/label_corres.py:218-222 — 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) contrib/MedicalSeg/medicalseg/transforms/transform.py:339 — contrib/MedicalSeg/medicalseg/transforms/transform.py:339-343 | contrib/MedicalSeg/tools/preprocess_utils/image_crop.py:89-93 — 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) contrib/QualityInspector/tools/uad/patchcore/val.py:191 — contrib/QualityInspector/tools/uad/patchcore/val.py:191-195 | contrib/QualityInspector/tools/uad/patchcore/val.py:205-209 — 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) paddleseg/models/layers/tensor_fusion.py:170 — paddleseg/models/layers/tensor_fusion.py:170-174 | paddleseg/models/layers/tensor_fusion.py:207-211 — 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) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:436 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:436-440 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:307-311 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 180 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 (5 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java:31 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java:31-35 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/preprocess/Preprocess.java:31-35 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/preprocess/Preprocess.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 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 lines × 2) · ×21
  • Duplicated block (12 lines × 2) EISeg/eiseg/models.py:31 — EISeg/eiseg/models.py:31-44 | EISeg/eiseg/plugin/video/load_model.py:27-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.
  • Duplicated block (12 lines × 2) Matting/deploy/python/infer.py:341 — Matting/deploy/python/infer.py:341-352 | Matting/deploy/python/infer.py:574-585 — 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) Matting/ppmatting/models/backbone/gca_enc.py:166 — Matting/ppmatting/models/backbone/gca_enc.py:166-177 | Matting/ppmatting/models/backbone/gca_enc.py:285-296 — 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 (12 lines × 2) contrib/AutoNUE/models/ocrnet_nv.py:79 — contrib/AutoNUE/models/ocrnet_nv.py:79-90 | contrib/CityscapesSOTA/models/ocrnet_nv.py:84-95 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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 (12 lines × 2) contrib/AutoNUE/models/ocrnet_nv.py:135 — contrib/AutoNUE/models/ocrnet_nv.py:135-146 | contrib/CityscapesSOTA/models/ocrnet_nv.py:144-155 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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 `contrib/AutoNUE/models/ocrnet_nv.py:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) contrib/CrossPseudoSupervision/core/train.py:283 — contrib/CrossPseudoSupervision/core/train.py:283-294 | contrib/LaneSeg/core/train.py:208-219 — 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 `contrib/CrossPseudoSupervision/core/train.py:283` 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 (12 lines × 2) contrib/MedicalSeg/nnunet/infer.py:195 — contrib/MedicalSeg/nnunet/infer.py:195-206 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:693-704 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) contrib/PanopticSeg/paddlepanseg/core/train.py:105 — contrib/PanopticSeg/paddlepanseg/core/train.py:105-116 | contrib/RSSegBenchmark/c2fnet/core/train.py:126-137 — before extracting anything, compare `contrib/PanopticSeg/paddlepanseg/core/train.py` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 12 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. 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) contrib/QualityInspector/tools/convert_tools/convert_mask_to_RoI.py:100 — contrib/QualityInspector/tools/convert_tools/convert_mask_to_RoI.py:100-111 | contrib/QualityInspector/tools/convert_tools/convert_mask_to_coco.py:83-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) contrib/QualityInspector/tools/seg/train.py:157 — contrib/QualityInspector/tools/seg/train.py:157-168 | tools/train.py:209-220 — before extracting anything, compare `contrib/QualityInspector/tools/seg/train.py` and `tools/train.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 183 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 (12 lines × 2) contrib/QualityInspector/tools/seg/train.py:178 — contrib/QualityInspector/tools/seg/train.py:178-189 | tools/train.py:230-241 — before extracting anything, compare `contrib/QualityInspector/tools/seg/train.py` and `tools/train.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 183 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 (12 lines × 2) contrib/QualityInspector/tools/uad/padim/train.py:89 — contrib/QualityInspector/tools/uad/padim/train.py:89-100 | contrib/QualityInspector/tools/uad/patchcore/train.py:117-128 — `contrib/QualityInspector/tools/uad/padim/train.py` and `contrib/QualityInspector/tools/uad/patchcore/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) contrib/RSSegBenchmark/c2fnet/core/train.py:304 — contrib/RSSegBenchmark/c2fnet/core/train.py:304-315 | paddleseg/core/train.py:351-362 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/train.py` and `paddleseg/core/train.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 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 `contrib/RSSegBenchmark/c2fnet/core/train.py:304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:382 — REDACTED:382-393 | REDACTED:196-207 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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 `REDACTED:382` 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 (12 lines × 2) paddleseg/models/encnet.py:142 — paddleseg/models/encnet.py:142-153 | paddleseg/models/fastfcn.py:163-174 — before extracting anything, compare `paddleseg/models/encnet.py` and `paddleseg/models/fastfcn.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 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) paddleseg/models/layers/tensor_fusion.py:239 — paddleseg/models/layers/tensor_fusion.py:239-250 | paddleseg/models/layers/tensor_fusion.py:265-276 — 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) contrib/QualityInspector/tools/uad/padim/predict.py:174 — contrib/QualityInspector/tools/uad/padim/predict.py:174-185 | contrib/QualityInspector/tools/uad/padim/val.py:270-281 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/predict.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 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, `contrib/QualityInspector/tools/uad/padim/val.py:282` calls `imshow`, `set_text` and `contrib/QualityInspector/tools/uad/padim/predict.py:186` 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 (12 lines × 2) contrib/PanopticDeepLab/utils/evaluation/instance.py:52 — contrib/PanopticDeepLab/utils/evaluation/instance.py:52-63 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:31-42 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/instance.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 228 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 (12 lines × 2) contrib/DomainAdaptation/cvlibs/config.py:126 — contrib/DomainAdaptation/cvlibs/config.py:126-137 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:132-143 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 (12 lines × 2) paddleseg/models/deeplab.py:176 — paddleseg/models/deeplab.py:176-188 | paddleseg/models/gcnet.py:54-65 — 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 (12 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:196 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:196-207 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:174-185 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 180 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 × 2) · ×21
  • Duplicated block (11 lines × 2) REDACTED:145 — REDACTED:145-155 | contrib/RSSegBenchmark/c2fnet/core/train.py:136-146 — before extracting anything, compare `REDACTED` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 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 (11 lines × 2) Matting/ppmatting/models/backbone/gca_enc.py:108 — Matting/ppmatting/models/backbone/gca_enc.py:108-118 | Matting/ppmatting/models/backbone/gca_enc.py:184-194 — 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) Matting/ppmatting/models/backbone/stdcnet.py:187 — Matting/ppmatting/models/backbone/stdcnet.py:187-197 | paddleseg/models/backbones/stdcnet.py:231-241 — before extracting anything, compare `Matting/ppmatting/models/backbone/stdcnet.py` and `paddleseg/models/backbones/stdcnet.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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) contrib/CrossPseudoSupervision/datasets/basedataset.py:64 — contrib/CrossPseudoSupervision/datasets/basedataset.py:64-74 | contrib/CrossPseudoSupervision/datasets/cityscapes_cps.py:91-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) contrib/CrossPseudoSupervision/models/backbones/resnet.py:56 — contrib/CrossPseudoSupervision/models/backbones/resnet.py:56-66 | contrib/RSSegBenchmark/backbones/resnet.py:57-67 — 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 (11 lines × 2) contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:50 — contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:50-60 | paddleseg/models/losses/ohem_cross_entropy_loss.py:72-82 — before extracting anything, compare `contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py` and `paddleseg/models/losses/ohem_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 (11 lines × 2) contrib/LaneSeg/core/train.py:176 — contrib/LaneSeg/core/train.py:176-186 | contrib/RSSegBenchmark/c2fnet/core/train.py:214-224 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 284 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 `contrib/LaneSeg/core/train.py:176` 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) contrib/MedicalSeg/deploy/python/infer.py:380 — contrib/MedicalSeg/deploy/python/infer.py:380-390 | deploy/python/infer.py:202-212 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 297 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 (11 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:276 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:276-286 | paddleseg/models/backbones/swin_transformer.py:234-244 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py` and `paddleseg/models/backbones/swin_transformer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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, `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:272` calls `min` and `paddleseg/models/backbones/swin_transformer.py:233` 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 (11 lines × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:378 — contrib/MedicalSeg/medicalseg/models/nnformer.py:378-388 | contrib/MedicalSeg/medicalseg/models/nnformer.py:482-492 — 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) contrib/MedicalSeg/nnunet/utils/base_predictor.py:586 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:586-596 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:560-570 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 (11 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:631 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:631-641 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:650-660 — 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) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:423 — contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:423-433 | contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:478-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) contrib/PanopticSeg/paddlepanseg/core/predict.py:82 — contrib/PanopticSeg/paddlepanseg/core/predict.py:82-92 | contrib/QualityInspector/qinspector/seg/engine/predictor.py:128-138 — 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 (11 lines × 2) contrib/QualityInspector/tools/dataset/labelme2seg.py:41 — contrib/QualityInspector/tools/dataset/labelme2seg.py:41-51 | tools/data/labelme2seg.py:88-98 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/labelme2seg.py` and `tools/data/labelme2seg.py` as WHOLE FILES: this scan already matched 5 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.
  • Duplicated block (11 lines × 2) contrib/RSSegBenchmark/c2fnet/core/infer.py:163 — contrib/RSSegBenchmark/c2fnet/core/infer.py:163-173 | contrib/RSSegBenchmark/c2fnet/core/infer.py:195-205 — 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 (11 lines × 2) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:304 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:304-314 | paddleseg/models/fcn.py:109-119 — 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 `contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:304` 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 lines × 2) REDACTED:363 — REDACTED:363-373 | REDACTED:184-194 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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 `REDACTED:363` 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) paddleseg/models/backbones/pidnet.py:106 — paddleseg/models/backbones/pidnet.py:106-116 | paddleseg/models/ddrnet.py:281-291 — 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 (11 lines × 2) paddleseg/models/backbones/efficientformerv2.py:261 — paddleseg/models/backbones/efficientformerv2.py:261-271 | paddleseg/models/backbones/efficientformerv2.py:425-435 — 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 `paddleseg/models/backbones/efficientformerv2.py:261` 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 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:424 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:424-434 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:295-305 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 180 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×17
  • Duplicated block (17 lines × 2) REDACTED:961 — REDACTED:961-977 | REDACTED:1016-1032 — 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 (17 lines × 2) Matting/ppmatting/models/backbone/stdcnet.py:243 — Matting/ppmatting/models/backbone/stdcnet.py:243-259 | paddleseg/models/backbones/stdcnet.py:310-326 — before extracting anything, compare `Matting/ppmatting/models/backbone/stdcnet.py` and `paddleseg/models/backbones/stdcnet.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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 (17 lines × 2) contrib/AutoNUE/models/ocrnet_nv.py:162 — contrib/AutoNUE/models/ocrnet_nv.py:162-178 | contrib/CityscapesSOTA/models/ocrnet_nv.py:171-187 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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 (17 lines × 2) contrib/CrossPseudoSupervision/cvlibs/builder.py:52 — contrib/CrossPseudoSupervision/cvlibs/builder.py:52-68 | paddleseg/cvlibs/builder.py:124-140 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/builder.py` and `paddleseg/cvlibs/builder.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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) contrib/CrossPseudoSupervision/cvlibs/config.py:66 — contrib/CrossPseudoSupervision/cvlibs/config.py:66-82 | paddleseg/cvlibs/config.py:68-84 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/config.py` and `paddleseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 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) contrib/DomainAdaptation/utils/config_check.py:44 — contrib/DomainAdaptation/utils/config_check.py:44-60 | contrib/MedicalSeg/medicalseg/utils/config_check.py:43-59 — before extracting anything, compare `contrib/DomainAdaptation/utils/config_check.py` and `contrib/MedicalSeg/medicalseg/utils/config_check.py` as WHOLE FILES: 96% 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. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/DomainAdaptation/utils/config_check.py:44` 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 (17 lines × 2) contrib/DomainAdaptation/val.py:31 — contrib/DomainAdaptation/val.py:31-47 | deploy/slim/quant/qat_val.py:28-44 — before extracting anything, compare `contrib/DomainAdaptation/val.py` and `deploy/slim/quant/qat_val.py` as WHOLE FILES: this scan already matched 8 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 `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 (17 lines × 2) contrib/LaneSeg/train.py:156 — contrib/LaneSeg/train.py:156-172 | contrib/MedicalSeg/train.py:169-185 — `contrib/LaneSeg/train.py` and `contrib/MedicalSeg/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 263 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (17 lines × 2) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:103 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:103-119 | paddleseg/models/losses/binary_cross_entropy_loss.py:103-119 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py` and `paddleseg/models/losses/binary_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) contrib/MedicalSeg/medicalseg/transforms/transform.py:134 — contrib/MedicalSeg/medicalseg/transforms/transform.py:134-150 | contrib/MedicalSeg/medicalseg/transforms/transform.py:462-478 — 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 (17 lines × 2) contrib/MedicalSeg/medicalseg/utils/utils.py:119 — contrib/MedicalSeg/medicalseg/utils/utils.py:119-135 | paddleseg/utils/utils.py:195-211 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/utils.py` and `paddleseg/utils/utils.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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 (17 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:311 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:311-327 | contrib/MedicalSeg/nnunet/utils/base_predictor.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. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/MedicalSeg/nnunet/utils/base_predictor.py:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `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 (17 lines × 2) contrib/MedicalSeg/nnunet/utils/static_predictor.py:297 — contrib/MedicalSeg/nnunet/utils/static_predictor.py:297-313 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:339-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/MedicalSeg/nnunet/utils/static_predictor.py:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (17 lines × 2) contrib/QualityInspector/tools/dataset/visualize_annotation.py:58 — contrib/QualityInspector/tools/dataset/visualize_annotation.py:58-74 | tools/data/visualize_annotation.py:49-65 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/visualize_annotation.py` and `tools/data/visualize_annotation.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 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 (17 lines × 2) paddleseg/models/backbones/lite_hrnet.py:332 — paddleseg/models/backbones/lite_hrnet.py:332-348 | paddleseg/models/backbones/lite_hrnet.py:358-374 — 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 `paddleseg/models/backbones/lite_hrnet.py:332` 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 (17 lines × 2) REDACTED:35 — REDACTED:35-51 | REDACTED:40-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) Matting/ppmatting/models/ppmattingv2.py:470 — Matting/ppmatting/models/ppmattingv2.py:470-486 | paddleseg/models/backbones/top_transformer.py:280-296 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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. 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 (13 lines × 2) · ×17
  • Duplicated block (13 lines × 2) Matting/ppmatting/transforms/transforms.py:534 — Matting/ppmatting/transforms/transforms.py:534-546 | paddleseg/transforms/transforms.py:853-865 — before extracting anything, compare `Matting/ppmatting/transforms/transforms.py` and `paddleseg/transforms/transforms.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (13 lines × 2) contrib/AutoNUE/tools/IDD_labeling.py:65 — contrib/AutoNUE/tools/IDD_labeling.py:65-77 | contrib/AutoNUE/tools/IDD_labeling.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) contrib/CrossPseudoSupervision/cvlibs/builder.py:127 — contrib/CrossPseudoSupervision/cvlibs/builder.py:127-139 | paddleseg/cvlibs/builder.py:159-171 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/builder.py` and `paddleseg/cvlibs/builder.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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, `paddleseg/cvlibs/builder.py:172` calls `opt` and `contrib/CrossPseudoSupervision/cvlibs/builder.py:140` 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 (13 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:283 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:283-295 | paddleseg/models/backbones/vit_adapter.py:136-148 — 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 `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:89 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:89-101 | paddleseg/models/losses/binary_cross_entropy_loss.py:89-101 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py` and `paddleseg/models/losses/binary_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (13 lines × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:451 — contrib/MedicalSeg/medicalseg/models/nnformer.py:451-463 | contrib/MedicalSeg/medicalseg/models/nnformer.py:564-576 — 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 `contrib/MedicalSeg/medicalseg/models/nnformer.py:451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:174 — contrib/MedicalSeg/medicalseg/transforms/functional.py:174-186 | contrib/MedicalSeg/nnunet/transforms/functional.py:412-424 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (13 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:612 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:612-624 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:586-598 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 (13 lines × 2) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:142 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:142-154 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:152-164 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/panoptic.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 (13 lines × 2) contrib/QualityInspector/qinspector/uad/models/padim.py:36 — contrib/QualityInspector/qinspector/uad/models/padim.py:36-48 | contrib/QualityInspector/qinspector/uad/models/patchcore.py:138-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) contrib/RSSegBenchmark/c2fnet/core/train.py:342 — contrib/RSSegBenchmark/c2fnet/core/train.py:342-354 | paddleseg/core/train.py:483-495 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/train.py` and `paddleseg/core/train.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 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 (13 lines × 2) paddleseg/core/analyse.py:113 — paddleseg/core/analyse.py:113-125 | paddleseg/core/predict.py:111-123 — before extracting anything, compare `paddleseg/core/analyse.py` and `paddleseg/core/predict.py` as WHOLE FILES: this scan already matched 4 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. 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 `paddleseg/core/analyse.py:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) paddleseg/models/backbones/efficientformerv2.py:666 — paddleseg/models/backbones/efficientformerv2.py:666-678 | paddleseg/models/backbones/efficientformerv2.py:712-724 — 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) paddleseg/models/danet.py:141 — paddleseg/models/danet.py:141-153 | paddleseg/models/layers/attention.py:189-201 — before extracting anything, compare `paddleseg/models/danet.py` and `paddleseg/models/layers/attention.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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 (13 lines × 2) paddleseg/models/espnetv1.py:173 — paddleseg/models/espnetv1.py:173-185 | paddleseg/models/espnetv1.py:240-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 (13 lines × 2) contrib/MedicalSeg/medicalseg/models/vnet.py:270 — contrib/MedicalSeg/medicalseg/models/vnet.py:270-282 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:299-311 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/vnet.py` and `contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 161 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 (13 lines × 2) paddleseg/models/backbones/ghostnet.py:288 — paddleseg/models/backbones/ghostnet.py:288-300 | paddleseg/models/backbones/top_transformer.py:30-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `paddleseg/models/backbones/ghostnet.py:288` 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 (16 lines × 2) · ×16
  • Duplicated block (16 lines × 2) Matting/ppmatting/models/ppmattingv2.py:416 — Matting/ppmatting/models/ppmattingv2.py:416-431 | paddleseg/models/backbones/top_transformer.py:136-151 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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.
  • Duplicated block (16 lines × 2) Matting/ppmatting/models/ppmattingv2.py:452 — Matting/ppmatting/models/ppmattingv2.py:452-467 | paddleseg/models/backbones/top_transformer.py:262-277 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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.
  • Duplicated block (16 lines × 2) contrib/AutoNUE/core/infer_ensemble.py:197 — contrib/AutoNUE/core/infer_ensemble.py:197-212 | contrib/AutoNUE/core/infer_ensemble_three.py:197-212 — before extracting anything, compare `contrib/AutoNUE/core/infer_ensemble.py` and `contrib/AutoNUE/core/infer_ensemble_three.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 125 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 (16 lines × 2) contrib/CrossPseudoSupervision/predict.py:124 — contrib/CrossPseudoSupervision/predict.py:124-139 | contrib/QualityInspector/tools/seg/predict.py:122-137 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 `contrib/CrossPseudoSupervision/predict.py:124` 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 (16 lines × 2) contrib/MedicalSeg/deploy/python/infer.py:301 — contrib/MedicalSeg/deploy/python/infer.py:301-316 | contrib/PanopticSeg/deploy/python/infer.py:221-236 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `contrib/PanopticSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 141 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 (16 lines × 2) contrib/MedicalSeg/medicalseg/transforms/transform.py:236 — contrib/MedicalSeg/medicalseg/transforms/transform.py:236-251 | contrib/MedicalSeg/medicalseg/transforms/transform.py:524-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:127 — contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:127-142 | contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:662-677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) contrib/QualityInspector/tools/seg/val.py:119 — contrib/QualityInspector/tools/seg/val.py:119-134 | tools/val.py:127-142 — before extracting anything, compare `contrib/QualityInspector/tools/seg/val.py` and `tools/val.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.
  • Duplicated block (16 lines × 2) contrib/QualityInspector/tools/uad/patchcore/train.py:149 — contrib/QualityInspector/tools/uad/patchcore/train.py:149-164 | contrib/QualityInspector/tools/uad/patchcore/val.py:129-144 — before extracting anything, compare `contrib/QualityInspector/tools/uad/patchcore/train.py` and `contrib/QualityInspector/tools/uad/patchcore/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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 (16 lines × 2) REDACTED:262 — REDACTED:262-277 | REDACTED:240-255 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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.
  • Duplicated block (16 lines × 2) paddleseg/models/losses/ohem_cross_entropy_loss.py:82 — paddleseg/models/losses/ohem_cross_entropy_loss.py:82-97 | paddleseg/models/losses/ohem_edge_attention_loss.py:79-94 — before extracting anything, compare `paddleseg/models/losses/ohem_cross_entropy_loss.py` and `paddleseg/models/losses/ohem_edge_attention_loss.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 (16 lines × 2) contrib/QualityInspector/tools/uad/padim/train.py:59 — contrib/QualityInspector/tools/uad/padim/train.py:59-74 | contrib/QualityInspector/tools/uad/padim/val.py:67-82 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/train.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 4 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. 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.
  • Duplicated block (16 lines × 2) paddleseg/models/setr.py:156 — paddleseg/models/setr.py:156-171 | paddleseg/models/setr.py:257-272 — 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 (16 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:420 — contrib/MedicalSeg/medicalseg/transforms/functional.py:420-435 | contrib/MedicalSeg/nnunet/transforms/functional.py:136-151 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 `contrib/MedicalSeg/medicalseg/transforms/functional.py:420` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (16 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:243 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:243-258 | Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:269-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:175 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:175-190 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java:172-187 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 139 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×15
  • Duplicated block (19 lines × 2) Matting/ppmatting/core/bg_replace_video.py:197 — Matting/ppmatting/core/bg_replace_video.py:197-215 | Matting/ppmatting/core/predict_video.py:148-166 — before extracting anything, compare `Matting/ppmatting/core/bg_replace_video.py` and `Matting/ppmatting/core/predict_video.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 `Matting/ppmatting/core/bg_replace_video.py:197` 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 (19 lines × 2) REDACTED:155 — REDACTED:155-173 | contrib/PanopticDeepLab/core/train.py:121-139 — before extracting anything, compare `REDACTED` and `contrib/PanopticDeepLab/core/train.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 115 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 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:489 — Matting/ppmatting/models/backbone/hrnet.py:489-507 | paddleseg/models/backbones/hrnet.py:510-528 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 `Matting/ppmatting/models/backbone/hrnet.py:489` 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) Matting/ppmatting/models/backbone/stdcnet.py:64 — Matting/ppmatting/models/backbone/stdcnet.py:64-82 | paddleseg/models/backbones/stdcnet.py:68-86 — before extracting anything, compare `Matting/ppmatting/models/backbone/stdcnet.py` and `paddleseg/models/backbones/stdcnet.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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 lines × 2) Matting/ppmatting/models/ppmattingv2.py:381 — Matting/ppmatting/models/ppmattingv2.py:381-399 | paddleseg/models/backbones/top_transformer.py:67-85 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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.
  • Duplicated block (19 lines × 2) Matting/ppmatting/models/ppmattingv2.py:581 — Matting/ppmatting/models/ppmattingv2.py:581-599 | paddleseg/models/backbones/top_transformer.py:391-409 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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. 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) contrib/AutoNUE/datasets/auto_nue_autolabel.py:133 — contrib/AutoNUE/datasets/auto_nue_autolabel.py:133-151 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:146-164 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue_autolabel.py` and `contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 146 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 `contrib/AutoNUE/datasets/auto_nue_autolabel.py:133` 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 (19 lines × 2) contrib/AutoNUE/models/ocrnet_nv.py:233 — contrib/AutoNUE/models/ocrnet_nv.py:233-251 | contrib/CityscapesSOTA/models/ocrnet_nv.py:242-260 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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 lines × 2) contrib/LaneSeg/core/infer.py:25 — contrib/LaneSeg/core/infer.py:25-43 | contrib/PanopticDeepLab/core/infer.py:25-43 — before extracting anything, compare `contrib/LaneSeg/core/infer.py` and `contrib/PanopticDeepLab/core/infer.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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 lines × 2) contrib/PanopticSeg/deploy/python/infer.py:263 — contrib/PanopticSeg/deploy/python/infer.py:263-281 | deploy/python/infer.py:166-184 — before extracting anything, compare `contrib/PanopticSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 lines × 2) paddleseg/models/backbones/seaformer.py:79 — paddleseg/models/backbones/seaformer.py:79-97 | paddleseg/models/backbones/strideformer.py:80-98 — 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 `paddleseg/models/backbones/seaformer.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.
  • Duplicated block (19 lines × 2) paddleseg/models/backbones/stdcnet.py:155 — paddleseg/models/backbones/stdcnet.py:155-173 | paddleseg/models/backbones/stdcnet.py:252-270 — 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) contrib/MedicalSeg/medicalseg/utils/metric.py:36 — contrib/MedicalSeg/medicalseg/utils/metric.py:36-54 | paddleseg/utils/metrics.py:42-60 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/metric.py` and `paddleseg/utils/metrics.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 106 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 `contrib/MedicalSeg/medicalseg/utils/metric.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.
  • Duplicated block (19 lines × 2) contrib/MedicalSeg/medicalseg/cvlibs/manager.py:124 — contrib/MedicalSeg/medicalseg/cvlibs/manager.py:124-142 | paddleseg/cvlibs/manager.py:122-140 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/cvlibs/manager.py` and `paddleseg/cvlibs/manager.py` as WHOLE FILES: 98% 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.
  • Duplicated block (19 lines × 2) contrib/PanopticDeepLab/utils/evaluation/instance.py:310 — contrib/PanopticDeepLab/utils/evaluation/instance.py:310-328 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:290-309 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/instance.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 228 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 · Edited copy of a member (14 corresponding lines) · ×13
  • Edited copy of a member (14 corresponding lines) paddleseg/models/backbones/pidnet.py:525 — paddleseg/models/backbones/pidnet.py:525-540 | paddleseg/models/pidnet.py:151-164 — 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.
  • Edited copy of a member (14 corresponding lines) contrib/MedicalSeg/medicalseg/utils/train_profiler.py:62 — contrib/MedicalSeg/medicalseg/utils/train_profiler.py:62-75 | paddleseg/utils/train_profiler.py:62-77 — 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.
  • Edited copy of a member (14 corresponding lines) contrib/MedicalSeg/tools/prepare_msd.py:110 — contrib/MedicalSeg/tools/prepare_msd.py:110-133 | contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:40-53 — 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.
  • Edited copy of a member (14 corresponding lines) contrib/PanopticDeepLab/transforms/target_transforms.py:45 — contrib/PanopticDeepLab/transforms/target_transforms.py:45-58 | contrib/PanopticSeg/paddlepanseg/transforms/generate_targets/panoptic_deeplab.py:30-43 — 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.
  • Edited copy of a member (14 corresponding lines) paddleseg/models/sinet.py:163 — paddleseg/models/sinet.py:163-176 | paddleseg/models/sinet.py:216-231 — 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.
  • Edited copy of a member (14 corresponding lines) paddleseg/models/pp_mobileseg.py:104 — paddleseg/models/pp_mobileseg.py:104-117 | paddleseg/models/topformer.py:95-111 — 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.
  • Edited copy of a member (14 corresponding lines) Matting/ppmatting/models/modnet.py:190 — Matting/ppmatting/models/modnet.py:190-206 | Matting/ppmatting/models/modnet.py:308-321 — 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.
  • Edited copy of a member (14 corresponding lines) contrib/CrossPseudoSupervision/cvlibs/builder.py:127 — contrib/CrossPseudoSupervision/cvlibs/builder.py:127-140 | paddleseg/cvlibs/builder.py:158-173 — 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.
  • Edited copy of a member (14 corresponding lines) paddleseg/models/danet.py:62 — paddleseg/models/danet.py:62-75 | paddleseg/models/ocrnet.py:70-83 — 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.
  • Edited copy of a member (14 corresponding lines) contrib/MedicalSeg/medicalseg/transforms/transform.py:376 — contrib/MedicalSeg/medicalseg/transforms/transform.py:376-389 | contrib/MedicalSeg/medicalseg/transforms/transform.py:608-622 — 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.
  • Edited copy of a member (14 corresponding lines) Matting/ppmatting/models/backbone/resnet_vd.py:318 — Matting/ppmatting/models/backbone/resnet_vd.py:318-332 | paddleseg/models/backbones/resnet_vd.py:351-364 — 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.
  • Edited copy of a member (14 corresponding lines) contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:56 — contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:56-69 | contrib/MedicalSeg/tools/prepare_msd.py:136-149 — 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.
  • Edited copy of a member (14 corresponding lines) paddleseg/models/pp_mobileseg.py:53 — paddleseg/models/pp_mobileseg.py:53-66 | paddleseg/models/topformer.py:54-67 — 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 (9 corresponding lines) · ×13
  • Edited copy of a member (9 corresponding lines) Matting/ppmatting/models/rvm.py:475 — Matting/ppmatting/models/rvm.py:475-483 | Matting/ppmatting/models/rvm.py:543-552 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) contrib/MedicalSeg/nnunet/transforms/functional.py:428 — contrib/MedicalSeg/nnunet/transforms/functional.py:428-436 | contrib/MedicalSeg/nnunet/transforms/functional.py:816-824 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) contrib/MedicalSeg/medicalseg/models/nnformer.py:62 — contrib/MedicalSeg/medicalseg/models/nnformer.py:62-70 | contrib/MedicalSeg/medicalseg/models/nnformer.py:91-101 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) paddleseg/models/layers/tensor_fusion_helper.py:71 — paddleseg/models/layers/tensor_fusion_helper.py:71-79 | paddleseg/models/layers/tensor_fusion_helper.py:85-93 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) contrib/AutoNUE/models/mscale_ocrnet.py:257 — contrib/AutoNUE/models/mscale_ocrnet.py:257-268 | contrib/CityscapesSOTA/models/mscale_ocrnet.py:175-183 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) paddleseg/models/efficientformerv2_seg.py:265 — paddleseg/models/efficientformerv2_seg.py:265-279 | paddleseg/models/pointrend.py:644-652 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) REDACTED:62 — REDACTED:62-70 | paddleseg/models/backbones/vit_adapter.py:92-100 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) paddleseg/models/backbones/seaformer.py:161 — paddleseg/models/backbones/seaformer.py:161-178 | paddleseg/models/backbones/strideformer.py:543-551 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) contrib/CityscapesSOTA/export.py:69 — contrib/CityscapesSOTA/export.py:69-78 | paddleseg/deploy/export.py:26-34 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) paddleseg/models/ann.py:208 — paddleseg/models/ann.py:208-216 | paddleseg/models/ann.py:255-263 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) paddleseg/models/attention_unet.py:177 — paddleseg/models/attention_unet.py:177-186 | paddleseg/models/backbones/efficientformerv2.py:354-362 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) deploy/slim/distill/distill_utils.py:61 — deploy/slim/distill/distill_utils.py:61-70 | paddleseg/models/maskformer.py:134-142 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/instance.py:142 — contrib/PanopticDeepLab/utils/evaluation/instance.py:142-150 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:124-132 — These two members are one piece of code written twice and then edited apart: 9 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) · ×12
  • Edited copy of a member (11 corresponding lines) contrib/MedicalSeg/nnunet/datasets/dataloader.py:89 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:89-103 | contrib/MedicalSeg/nnunet/datasets/dataloader.py:292-302 — 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.
  • Edited copy of a member (11 corresponding lines) Matting/deploy/python/infer.py:433 — Matting/deploy/python/infer.py:433-449 | Matting/ppmatting/core/val_ml.py:44-54 — 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.
  • Edited copy of a member (11 corresponding lines) EISeg/eiseg/inference/predictor/base.py:70 — EISeg/eiseg/inference/predictor/base.py:70-80 | EISeg/med3d/EISegMed3D/inference/predictor.py:107-123 — 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.
  • Edited copy of a member (11 corresponding lines) EISeg/med3d/EISegMed3D/inference/models.py:463 — EISeg/med3d/EISegMed3D/inference/models.py:463-477 | contrib/MedicalSeg/medicalseg/models/vnet.py:257-267 — 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.
  • Edited copy of a member (11 corresponding lines) paddleseg/models/backbones/pidnet.py:206 — paddleseg/models/backbones/pidnet.py:206-216 | paddleseg/models/backbones/pidnet.py:256-266 — 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.
  • Edited copy of a member (11 corresponding lines) contrib/MedicalSeg/medicalseg/models/swinunet.py:195 — contrib/MedicalSeg/medicalseg/models/swinunet.py:195-206 | contrib/MedicalSeg/medicalseg/models/transunet.py:369-379 — 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.
  • Edited copy of a member (11 corresponding lines) contrib/SegmentAnything/segment_anything/utils/transforms.py:155 — contrib/SegmentAnything/segment_anything/utils/transforms.py:155-165 | contrib/SegmentAnything/segment_anything/utils/transforms.py:196-206 — 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.
  • Edited copy of a member (11 corresponding lines) paddleseg/models/backbones/hrformer.py:1069 — paddleseg/models/backbones/hrformer.py:1069-1079 | paddleseg/models/backbones/hrformer.py:1084-1096 — 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.
  • Edited copy of a member (11 corresponding lines) contrib/AutoNUE/models/ocrnet_nv.py:134 — contrib/AutoNUE/models/ocrnet_nv.py:134-146 | paddleseg/models/ocrnet.py:128-138 — 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.
  • Edited copy of a member (11 corresponding lines) contrib/MedicalSeg/nnunet/utils/metrics.py:107 — contrib/MedicalSeg/nnunet/utils/metrics.py:107-117 | contrib/MedicalSeg/nnunet/utils/metrics.py:125-137 — 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.
  • Edited copy of a member (11 corresponding lines) EISeg/med3d/EISegMed3D/EISegMed3D.py:451 — EISeg/med3d/EISegMed3D/EISegMed3D.py:451-461 | EISeg/med3d/EISegMed3D/EISegMed3D.py:464-474 — 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.
  • Edited copy of a member (11 corresponding lines) Matting/ppmatting/models/backbone/resnet_vd.py:165 — Matting/ppmatting/models/backbone/resnet_vd.py:165-175 | paddleseg/models/backbones/resnet_vd.py:184-194 — 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 · Duplicated block (9 lines × 3) · ×12
  • Duplicated block (9 lines × 3) REDACTED:282 — REDACTED:282-290 | contrib/PanopticDeepLab/core/train.py:237-245 | contrib/PanopticSeg/paddlepanseg/core/train.py:224-232 — before extracting anything, compare `REDACTED` and `contrib/PanopticDeepLab/core/train.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 115 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) Matting/ppmatting/models/backbone/gca_enc.py:105 — Matting/ppmatting/models/backbone/gca_enc.py:105-113 | Matting/ppmatting/models/backbone/gca_enc.py:181-189 | Matting/ppmatting/models/backbone/gca_enc.py:300-308 — 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 (9 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:225 — contrib/DomainAdaptation/cvlibs/config.py:225-233 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:236-244 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:302-310 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 `contrib/DomainAdaptation/cvlibs/config.py:225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 3) contrib/DomainAdaptation/script/train.py:104 — contrib/DomainAdaptation/script/train.py:104-112 | contrib/LaneSeg/core/train.py:103-111 | contrib/MedicalSeg/medicalseg/core/train.py:82-90 — 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 (9 lines × 3) contrib/MedicalSeg/medicalseg/core/val.py:140 — contrib/MedicalSeg/medicalseg/core/val.py:140-148 | contrib/RSSegBenchmark/c2fnet/core/val.py:204-212 | paddleseg/core/val.py:201-209 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/core/val.py` and `contrib/RSSegBenchmark/c2fnet/core/val.py` as WHOLE FILES: this scan already matched 5 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. 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) contrib/MedicalSeg/medicalseg/utils/download.py:41 — contrib/MedicalSeg/medicalseg/utils/download.py:41-49 | contrib/MedicalSeg/tools/preprocess_utils/uncompress.py:99-107 | paddleseg/utils/download.py:41-49 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `contrib/MedicalSeg/tools/preprocess_utils/uncompress.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 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) contrib/MedicalSeg/medicalseg/utils/download.py:68 — contrib/MedicalSeg/medicalseg/utils/download.py:68-76 | contrib/MedicalSeg/tools/preprocess_utils/uncompress.py:42-50 | paddleseg/utils/download.py:68-76 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `contrib/MedicalSeg/tools/preprocess_utils/uncompress.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 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) contrib/MedicalSeg/medicalseg/utils/download.py:80 — contrib/MedicalSeg/medicalseg/utils/download.py:80-88 | contrib/MedicalSeg/tools/preprocess_utils/uncompress.py:63-71 | paddleseg/utils/download.py:80-88 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `contrib/MedicalSeg/tools/preprocess_utils/uncompress.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 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) contrib/RSSegBenchmark/c2fnet/core/infer.py:159 — contrib/RSSegBenchmark/c2fnet/core/infer.py:159-167 | contrib/RSSegBenchmark/c2fnet/core/infer.py:191-199 | paddleseg/core/infer.py:172-180 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/infer.py` and `paddleseg/core/infer.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 145 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, `paddleseg/core/infer.py:182` calls `stfpm_post_transform` and `contrib/RSSegBenchmark/c2fnet/core/infer.py:168` 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 (9 lines × 3) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:89 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:89-97 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:100-108 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:111-119 — 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 `contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:89` 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 (9 lines × 3) paddleseg/models/knet.py:158 — paddleseg/models/knet.py:158-166 | paddleseg/models/upernet.py:156-164 | paddleseg/models/upernet_vit_adapter.py:257-265 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `paddleseg/models/upernet_vit_adapter.py:268` calls `dropout` and `paddleseg/models/upernet.py:166` 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 (9 lines × 3) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:210 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:210-218 | Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:246-254 | Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:272-280 — 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 (7 lines × 3) · ×12
  • Duplicated block (7 lines × 3) REDACTED:1414 — REDACTED:1414-1420 | REDACTED:2145-2151 | REDACTED:3420-3426 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1414` 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 (7 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:307 — EISeg/med3d/EISegMed3D/inference/models.py:307-313 | contrib/MedicalSeg/medicalseg/models/vnet.py:107-113 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:113-119 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 (7 lines × 3) contrib/LaneSeg/core/train.py:108 — contrib/LaneSeg/core/train.py:108-114 | contrib/MedicalSeg/medicalseg/core/train.py:87-93 | contrib/RSSegBenchmark/c2fnet/core/train.py:146-152 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/MedicalSeg/medicalseg/core/train.py` as WHOLE FILES: this scan already matched 13 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 `contrib/LaneSeg/core/train.py:108` 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 (7 lines × 3) contrib/MedicalSeg/medicalseg/cvlibs/config.py:333 — contrib/MedicalSeg/medicalseg/cvlibs/config.py:333-339 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:343-349 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:377-383 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:625 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:625-631 | contrib/MedicalSeg/medicalseg/models/nnformer.py:877-883 | paddleseg/models/backbones/swin_transformer.py:620-626 — 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.
  • Duplicated block (7 lines × 3) contrib/MedicalSeg/medicalseg/models/losses/cross_entropy_loss.py:71 — contrib/MedicalSeg/medicalseg/models/losses/cross_entropy_loss.py:71-77 | paddleseg/models/losses/cross_entropy_loss.py:76-82 | paddleseg/models/losses/cross_entropy_loss.py:213-219 — 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 (7 lines × 3) contrib/QualityInspector/qinspector/uad/utils/utils.py:315 — contrib/QualityInspector/qinspector/uad/utils/utils.py:315-321 | contrib/QualityInspector/tools/uad/padim/predict.py:179-185 | contrib/QualityInspector/tools/uad/padim/val.py:275-281 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/QualityInspector/qinspector/uad/utils/utils.py:323` calls `transpose`, `squeeze` and `contrib/QualityInspector/tools/uad/padim/val.py:282` 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 (7 lines × 3) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:92 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:92-98 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:114-120 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:193-199 — 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 `contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:92` 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 × 3) REDACTED:151 — REDACTED:151-157 | REDACTED:81-87 | paddleseg/models/backbones/vit_adapter.py:111-117 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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.
  • Duplicated block (7 lines × 3) Matting/ppmatting/models/backbone/mobilenetv3.py:410 — Matting/ppmatting/models/backbone/mobilenetv3.py:410-416 | paddleseg/models/backbones/mobilenetv3.py:360-366 | paddleseg/models/backbones/strideformer.py:346-352 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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 (7 lines × 3) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:62 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:62-68 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:103-109 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Utils.java:62-68 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java` and `deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 3) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:71 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:71-77 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:112-118 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Utils.java:71-77 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java` and `deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×12
  • Swallowed exception (caught, then discarded) REDACTED:82 — `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) contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:92 — `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) contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py:76 — `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) EISeg/med3d/EISegMed3D/EISegMed3D.py:721 — `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) EISeg/eiseg/widget/vtk.py:34 — `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) EISeg/eiseg/util/language.py:44 — `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) EISeg/eiseg/util/language.py:55 — `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) EISeg/eiseg/util/polygon.py:162 — `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) EISeg/eiseg/util/polygon.py:175 — `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) EISeg/eiseg/plugin/remotesensing/raster.py:29 — `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) EISeg/eiseg/plugin/remotesensing/shape.py:22 — `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) EISeg/eiseg/plugin/remotesensing/shape.py:36 — `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.
X3 · Exception handling · Swallowed exception (empty catch) · ×12
  • Swallowed exception (empty catch) REDACTED:121 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py:115 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:87 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:988 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1266 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:2541 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:2727 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:2767 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:2900 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:2911 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) EISeg/eiseg/util/coco/coco.py:86 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) EISeg/eiseg/util/coco/cocoeval.py:436 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×11
  • Edited copy of a member (12 corresponding lines) EISeg/eiseg/util/coco/cocoeval.py:546 — EISeg/eiseg/util/coco/cocoeval.py:546-557 | EISeg/eiseg/util/coco/cocoeval.py:560-574 — 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.
  • Edited copy of a member (12 corresponding lines) contrib/DomainAdaptation/script/val.py:75 — contrib/DomainAdaptation/script/val.py:75-88 | contrib/DomainAdaptation/script/val.py:118-129 — 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.
  • Edited copy of a member (12 corresponding lines) paddleseg/models/backbones/strideformer.py:669 — paddleseg/models/backbones/strideformer.py:669-680 | paddleseg/models/backbones/strideformer.py:710-723 — 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.
  • Edited copy of a member (12 corresponding lines) contrib/MedicalSeg/medicalseg/models/swinunet.py:154 — contrib/MedicalSeg/medicalseg/models/swinunet.py:154-165 | paddleseg/models/espnet.py:454-465 — 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.
  • Edited copy of a member (12 corresponding lines) Matting/ppmatting/models/losses/loss.py:63 — Matting/ppmatting/models/losses/loss.py:63-76 | Matting/ppmatting/models/losses/loss.py:122-133 — 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.
  • Edited copy of a member (12 corresponding lines) paddleseg/models/backbones/strideformer.py:181 — paddleseg/models/backbones/strideformer.py:181-192 | paddleseg/models/backbones/top_transformer.py:106-118 — 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.
  • Edited copy of a member (12 corresponding lines) paddleseg/models/ann.py:193 — paddleseg/models/ann.py:193-205 | paddleseg/models/ann.py:241-252 — 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.
  • Edited copy of a member (12 corresponding lines) Matting/ppmatting/models/backbone/stdcnet.py:50 — Matting/ppmatting/models/backbone/stdcnet.py:50-61 | paddleseg/models/backbones/stdcnet.py:54-65 — 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.
  • Edited copy of a member (12 corresponding lines) paddleseg/models/bisenetv1.py:209 — paddleseg/models/bisenetv1.py:209-220 | paddleseg/models/bisenetv1.py:240-256 — 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.
  • Edited copy of a member (12 corresponding lines) Matting/ppmatting/transforms/transforms.py:93 — Matting/ppmatting/transforms/transforms.py:93-105 | contrib/MedicalSeg/medicalseg/transforms/transform.py:921-932 — 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.
  • Edited copy of a member (12 corresponding lines) contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:221 — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:221-236 | paddleseg/models/losses/maskformer_loss.py:136-147 — 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 · Duplicated block (20 lines × 2) · ×11
  • Duplicated block (20 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:238 — Matting/ppmatting/models/backbone/hrnet.py:238-257 | paddleseg/models/backbones/hrnet.py:252-271 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 (20 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:396 — Matting/ppmatting/models/backbone/hrnet.py:396-415 | paddleseg/models/backbones/hrnet.py:415-434 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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, `paddleseg/models/backbones/hrnet.py:413` calls `PolarizedSelfAttentionModule`, `Identity` and `Matting/ppmatting/models/backbone/hrnet.py:395` 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 (20 lines × 2) Matting/ppmatting/models/backbone/mobilenetv3.py:240 — Matting/ppmatting/models/backbone/mobilenetv3.py:240-259 | paddleseg/models/backbones/mobilenetv3.py:202-221 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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 (20 lines × 2) Matting/ppmatting/models/ppmattingv2.py:501 — Matting/ppmatting/models/ppmattingv2.py:501-520 | paddleseg/models/backbones/top_transformer.py:311-330 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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.
  • Duplicated block (20 lines × 2) contrib/MedicalSeg/medicalseg/cvlibs/config.py:173 — contrib/MedicalSeg/medicalseg/cvlibs/config.py:173-192 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:223-242 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/cvlibs/config.py` and `contrib/RSSegBenchmark/c2fnet/cvlibs/config.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 157 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. 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 (20 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:550 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:550-569 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:524-543 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 (20 lines × 2) contrib/QualityInspector/tools/convert_tools/convert_mask_to_RoI.py:29 — contrib/QualityInspector/tools/convert_tools/convert_mask_to_RoI.py:29-48 | contrib/QualityInspector/tools/convert_tools/convert_mask_to_coco.py:26-45 — 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 `contrib/QualityInspector/tools/convert_tools/convert_mask_to_RoI.py:29` 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 (20 lines × 2) paddleseg/models/ann.py:332 — paddleseg/models/ann.py:332-351 | paddleseg/models/ann.py:404-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. 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 (20 lines × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:181 — contrib/MedicalSeg/medicalseg/models/nnformer.py:181-200 | contrib/MedicalSeg/medicalseg/models/nnformer.py:277-296 — 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 (20 lines × 2) paddleseg/models/backbones/efficientformerv2.py:318 — paddleseg/models/backbones/efficientformerv2.py:318-337 | paddleseg/models/backbones/efficientformerv2.py:486-505 — 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 (20 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:93 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:93-112 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java:91-110 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 139 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×10
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Matting/deploy/python/infer.py:186 — Matting/deploy/python/infer.py:186-232 | contrib/MedicalSeg/deploy/python/infer.py:216-260 | contrib/PanopticSeg/deploy/python/infer.py:134-184 | deploy/python/infer.py:34-85 | deploy/python/infer_dataset.py:176-223 — 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) Matting/ppmatting/models/backbone/hrnet.py:204 — Matting/ppmatting/models/backbone/hrnet.py:204-219 | contrib/AutoNUE/models/backbones/hrnet_nv.py:209-223 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:204-218 | paddleseg/models/backbones/hrnet.py:218-233 | paddleseg/models/backbones/uhrnet.py:384-398 — 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) Matting/ppmatting/models/backbone/hrnet.py:281 — Matting/ppmatting/models/backbone/hrnet.py:281-297 | contrib/AutoNUE/models/backbones/hrnet_nv.py:283-299 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:278-293 | paddleseg/models/backbones/hrnet.py:296-313 | paddleseg/models/backbones/uhrnet.py:479-494 — 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) Matting/ppmatting/models/backbone/hrnet.py:608 — Matting/ppmatting/models/backbone/hrnet.py:608-634 | contrib/AutoNUE/models/backbones/hrnet_nv.py:605-632 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:589-615 | paddleseg/models/backbones/hrnet.py:632-658 | paddleseg/models/backbones/uhrnet.py:795-822 — 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) contrib/AutoNUE/core/infer.py:113 — contrib/AutoNUE/core/infer.py:113-162 | contrib/AutoNUE/core/infer_crop.py:113-162 | contrib/AutoNUE/core/infer_generate_autolabel.py:113-162 | contrib/RSSegBenchmark/c2fnet/core/infer.py:82-131 | paddleseg/core/infer.py:93-142 — 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) contrib/CityscapesSOTA/export.py:82 — contrib/CityscapesSOTA/export.py:82-136 | contrib/LaneSeg/export.py:59-99 | contrib/MedicalSeg/export.py:97-140 | contrib/MedicalSeg/nnunet/export.py:72-112 | contrib/PanopticSeg/tools/export.py:48-93 — 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) contrib/CityscapesSOTA/predict.py:109 — contrib/CityscapesSOTA/predict.py:109-128 | contrib/DomainAdaptation/val.py:31-47 | contrib/RSSegBenchmark/c2fnet/predict.py:126-147 | contrib/RSSegBenchmark/predict.py:119-140 | deploy/slim/quant/qat_val.py:28-44 — 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) contrib/CrossPseudoSupervision/val.py:106 — contrib/CrossPseudoSupervision/val.py:106-116 | contrib/QualityInspector/tools/seg/val.py:105-115 | contrib/RSSegBenchmark/c2fnet/val.py:29-41 | contrib/RSSegBenchmark/val.py:28-40 | tools/val.py:111-123 — 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) paddleseg/models/rtformer.py:141 — paddleseg/models/rtformer.py:141-151 | paddleseg/models/rtformer.py:304-314 | paddleseg/models/rtformer.py:367-377 | paddleseg/models/rtformer.py:519-529 | paddleseg/models/rtformer.py:532-542 — 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) paddleseg/models/u2net.py:298 — paddleseg/models/u2net.py:298-326 | paddleseg/models/u2net.py:376-400 | paddleseg/models/u2net.py:445-465 | paddleseg/models/u2net.py:504-520 | paddleseg/models/u2net.py:553-565 — 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 (15 corresponding lines) · ×10
  • Edited copy of a member (15 corresponding lines) REDACTED:73 — REDACTED:73-87 | paddleseg/models/backbones/vit_adapter.py:103-117 — 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) paddleseg/models/backbones/seaformer.py:508 — paddleseg/models/backbones/seaformer.py:508-522 | paddleseg/models/backbones/seaformer.py:527-542 — 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) Matting/ppmatting/models/backbone/gca_enc.py:124 — Matting/ppmatting/models/backbone/gca_enc.py:124-141 | Matting/ppmatting/models/gca.py:238-252 — 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) paddleseg/models/maskformer.py:305 — paddleseg/models/maskformer.py:305-319 | paddleseg/models/maskformer.py:398-415 — 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) contrib/CrossPseudoSupervision/models/backbones/resnet.py:340 — contrib/CrossPseudoSupervision/models/backbones/resnet.py:340-355 | contrib/RSSegBenchmark/backbones/resnet.py:231-245 — 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) paddleseg/models/backbones/mix_transformer.py:217 — paddleseg/models/backbones/mix_transformer.py:217-233 | paddleseg/models/backbones/vit_adapter.py:34-48 — 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) paddleseg/models/gcnet.py:145 — paddleseg/models/gcnet.py:145-164 | paddleseg/models/glore.py:119-133 — 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) contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:74 — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:74-89 | paddleseg/models/losses/maskformer_loss.py:30-44 — 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) Matting/ppmatting/models/backbone/hrnet.py:530 — Matting/ppmatting/models/backbone/hrnet.py:530-544 | paddleseg/models/backbones/hrnet.py:553-568 — 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) paddleseg/models/backbones/top_transformer.py:419 — paddleseg/models/backbones/top_transformer.py:419-433 | paddleseg/models/backbones/top_transformer.py:458-476 — 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 copy of a member (8 corresponding lines) · ×10
  • Edited copy of a member (8 corresponding lines) contrib/QualityInspector/qinspector/uad/models/patchcore.py:190 — contrib/QualityInspector/qinspector/uad/models/patchcore.py:190-197 | contrib/QualityInspector/qinspector/uad/models/patchcore.py:202-212 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) paddleseg/transforms/functional.py:53 — paddleseg/transforms/functional.py:53-60 | paddleseg/transforms/functional.py:64-71 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/semantic.py:43 — contrib/PanopticDeepLab/utils/evaluation/semantic.py:43-50 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/sem_seg_evaluator.py:30-37 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:203 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:203-210 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:207-214 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) EISeg/eiseg/plugin/medical/med.py:49 — EISeg/eiseg/plugin/medical/med.py:49-61 | EISeg/tool/medical2video.py:54-61 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) paddleseg/models/backbones/mix_transformer.py:36 — paddleseg/models/backbones/mix_transformer.py:36-45 | paddleseg/models/layers/vit_adapter_layers.py:86-93 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) contrib/MedicalSeg/medicalseg/models/nnformer.py:151 — contrib/MedicalSeg/medicalseg/models/nnformer.py:151-158 | paddleseg/models/backbones/hrformer.py:72-79 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) Matting/ppmatting/transforms/transforms.py:582 — Matting/ppmatting/transforms/transforms.py:582-589 | paddleseg/transforms/transforms.py:1029-1038 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) contrib/MedicalSeg/medicalseg/transforms/transform.py:776 — contrib/MedicalSeg/medicalseg/transforms/transform.py:776-783 | contrib/MedicalSeg/nnunet/transforms/transform.py:349-357 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) paddleseg/models/backbones/seaformer.py:297 — paddleseg/models/backbones/seaformer.py:297-304 | paddleseg/models/backbones/strideformer.py:417-424 — These two members are one piece of code written twice and then edited apart: 8 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 (22 lines × 2) · ×10
  • Duplicated block (22 lines × 2) contrib/AutoNUE/models/ocrnet_nv.py:209 — contrib/AutoNUE/models/ocrnet_nv.py:209-230 | contrib/CityscapesSOTA/models/ocrnet_nv.py:218-239 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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) contrib/CrossPseudoSupervision/train.py:70 — contrib/CrossPseudoSupervision/train.py:70-91 | contrib/QualityInspector/tools/seg/train.py:72-93 — before extracting anything, compare `contrib/CrossPseudoSupervision/train.py` and `contrib/QualityInspector/tools/seg/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 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 `contrib/CrossPseudoSupervision/train.py:70` 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.
  • Duplicated block (22 lines × 2) contrib/LaneSeg/core/train.py:135 — contrib/LaneSeg/core/train.py:135-156 | contrib/RSSegBenchmark/c2fnet/core/train.py:172-193 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 284 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 (22 lines × 2) contrib/MedicalSeg/medicalseg/utils/download.py:43 — contrib/MedicalSeg/medicalseg/utils/download.py:43-64 | paddleseg/utils/download.py:43-64 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `paddleseg/utils/download.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 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) contrib/MedicalSeg/medicalseg/utils/download.py:92 — contrib/MedicalSeg/medicalseg/utils/download.py:92-113 | paddleseg/utils/download.py:92-113 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `paddleseg/utils/download.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 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 (22 lines × 2) contrib/MedicalSeg/medicalseg/utils/metric.py:111 — contrib/MedicalSeg/medicalseg/utils/metric.py:111-132 | paddleseg/utils/metrics.py:122-143 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/metric.py` and `paddleseg/utils/metrics.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 106 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) contrib/MedicalSeg/medicalseg/utils/metric.py:139 — contrib/MedicalSeg/medicalseg/utils/metric.py:139-160 | paddleseg/utils/metrics.py:150-171 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/metric.py` and `paddleseg/utils/metrics.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 106 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) contrib/MedicalSeg/medicalseg/utils/progbar.py:45 — contrib/MedicalSeg/medicalseg/utils/progbar.py:45-66 | paddleseg/utils/progbar.py:45-66 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/progbar.py` and `paddleseg/utils/progbar.py` as WHOLE FILES: 100% 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.
  • Duplicated block (22 lines × 2) contrib/RSSegBenchmark/c2fnet/core/predict.py:98 — contrib/RSSegBenchmark/c2fnet/core/predict.py:98-119 | paddleseg/core/predict.py:92-113 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/predict.py` and `paddleseg/core/predict.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 79 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 `contrib/RSSegBenchmark/c2fnet/core/predict.py:98` 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 (22 lines × 2) REDACTED:428 — REDACTED:428-449 | REDACTED:242-263 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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 (5 lines × 3) · ×10
  • Duplicated block (5 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:272 — EISeg/med3d/EISegMed3D/inference/models.py:272-276 | contrib/MedicalSeg/medicalseg/models/vnet.py:75-79 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:78-82 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 (5 lines × 3) contrib/LaneSeg/core/predict.py:78 — contrib/LaneSeg/core/predict.py:78-82 | contrib/RSSegBenchmark/c2fnet/core/predict.py:104-108 | paddleseg/core/predict.py:98-102 — before extracting anything, compare `contrib/LaneSeg/core/predict.py` and `contrib/RSSegBenchmark/c2fnet/core/predict.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 (5 lines × 3) contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:55 — contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:55-59 | tools/data/gray2pseudo_color.py:55-59 | tools/data/labelme2seg.py:49-53 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/gray2pseudo_color.py` and `tools/data/gray2pseudo_color.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 103 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 (5 lines × 3) paddleseg/models/pfpnnet.py:181 — paddleseg/models/pfpnnet.py:181-185 | paddleseg/models/pointrend.py:692-696 | paddleseg/models/upernet_cae.py:322-326 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `paddleseg/models/pfpnnet.py:181` 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 × 3) paddleseg/models/segformer.py:93 — paddleseg/models/segformer.py:93-97 | paddleseg/models/segformer.py:100-104 | paddleseg/models/segformer.py:107-111 — 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 `paddleseg/models/segformer.py:93` 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 (5 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:229 — EISeg/med3d/EISegMed3D/inference/models.py:229-233 | contrib/MedicalSeg/medicalseg/models/vnet.py:34-38 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:35-39 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 (5 lines × 3) Matting/ppmatting/models/ppmatting.py:337 — Matting/ppmatting/models/ppmatting.py:337-341 | contrib/DomainAdaptation/models/gscnn.py:184-188 | paddleseg/models/gscnn.py:247-251 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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 (5 lines × 3) contrib/AutoNUE/models/ocrnet_nv.py:198 — contrib/AutoNUE/models/ocrnet_nv.py:198-202 | contrib/CityscapesSOTA/models/ocrnet_nv.py:207-211 | paddleseg/models/ocrnet.py:191-195 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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 (5 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:217 — contrib/DomainAdaptation/cvlibs/config.py:217-221 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:228-232 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:294-298 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 (5 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:480 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:480-484 | contrib/SegmentAnything/segment_anything/modeling/tiny_vit_sam.py:325-329 | contrib/SegmentAnything/segment_anything/modeling/tiny_vit_sam.py:606-610 — 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. 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.
D17 · Explicit Debt · XxxComment · ×9
  • XxxComment contrib/PanopticSeg/tools/analyze_model.py:77 — # XXX: Hard-code default items — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/utils/visualize.py:217 — # XXX: The conversion strategy is hard-coded — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:414 — # XXX: Inplace modification — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:297 — # XXX: Since Paddle boolean tensor does not support masked assign — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/deploy/export.py:25 — # XXX: Currently, pass an empty sample_dict to postprocessor — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/cvlibs/info_dicts.py:86 — # XXX: Rewrite trans_info as empty list — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/core/infer.py:57 — # XXX: In-place modification — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/core/predict.py:96 — # XXX: For efficiency only convert img to tensor. — 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.
  • XxxComment contrib/PanopticSeg/paddlepanseg/core/train.py:35 — # XXX: We choose to rewrite `__getattr__` here because it is simpler. — 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 · Edited copy of a member (10 corresponding lines) · ×9
  • Edited copy of a member (10 corresponding lines) paddleseg/models/decoupled_segnet.py:209 — paddleseg/models/decoupled_segnet.py:209-218 | paddleseg/models/sfnet.py:222-233 — 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) paddleseg/models/decoupled_segnet.py:71 — paddleseg/models/decoupled_segnet.py:71-84 | paddleseg/models/gscnn.py:68-77 — 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) paddleseg/models/backbones/strideformer.py:647 — paddleseg/models/backbones/strideformer.py:647-664 | paddleseg/models/seaformer_seg.py:146-155 — 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) paddleseg/models/hardnet.py:213 — paddleseg/models/hardnet.py:213-222 | paddleseg/models/unet.py:148-157 — 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) Matting/ppmatting/models/backbone/stdcnet.py:116 — Matting/ppmatting/models/backbone/stdcnet.py:116-125 | paddleseg/models/backbones/stdcnet.py:128-140 — 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) REDACTED:261 — REDACTED:261-271 | paddleseg/models/stdcseg.py:115-124 — 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) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:288 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:288-300 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java:284-293 — 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) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:230 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:230-239 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:196-205 — 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) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/config/Config.java:18 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/config/Config.java:18-28 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/config/Config.java:17-26 — 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 (18 lines × 2) · ×9
  • Duplicated block (18 lines × 2) Matting/ppmatting/models/backbone/mobilenet_v2.py:58 — Matting/ppmatting/models/backbone/mobilenet_v2.py:58-75 | paddleseg/models/backbones/mobilenetv2.py:127-144 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenet_v2.py` and `paddleseg/models/backbones/mobilenetv2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 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 (18 lines × 2) contrib/CrossPseudoSupervision/cvlibs/builder.py:107 — contrib/CrossPseudoSupervision/cvlibs/builder.py:107-124 | paddleseg/cvlibs/builder.py:193-210 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/builder.py` and `paddleseg/cvlibs/builder.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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 (18 lines × 2) paddleseg/datasets/ade.py:56 — paddleseg/datasets/ade.py:56-73 | paddleseg/datasets/voc.py:54-71 — 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 `paddleseg/datasets/ade.py:56` 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 (18 lines × 2) paddleseg/models/backbones/lite_hrnet.py:633 — paddleseg/models/backbones/lite_hrnet.py:633-650 | paddleseg/models/backbones/lite_hrnet.py:653-670 — 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 `paddleseg/models/backbones/lite_hrnet.py:633` 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 (18 lines × 2) paddleseg/models/layers/pyramid_pool.py:142 — paddleseg/models/layers/pyramid_pool.py:142-159 | paddleseg/models/upernet_cae.py:168-185 — 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 `paddleseg/models/layers/pyramid_pool.py:142` 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 (18 lines × 2) REDACTED:149 — REDACTED:149-166 | REDACTED:157-174 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 `REDACTED:149` 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) REDACTED:184 — REDACTED:184-201 | REDACTED:177-194 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 (18 lines × 2) paddleseg/transforms/transforms.py:506 — paddleseg/transforms/transforms.py:506-523 | paddleseg/transforms/transforms.py:631-648 — 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 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:213 — contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:213-230 | contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:535-552 — 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, `contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:232` calls `list` and `contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:554` 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 (10 lines × 3) · ×9
  • Duplicated block (10 lines × 3) REDACTED:960 — REDACTED:960-969 | REDACTED:1015-1024 | REDACTED:1377-1386 — 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 (10 lines × 3) Matting/deploy/python/infer.py:487 — Matting/deploy/python/infer.py:487-496 | Matting/deploy/python/infer.py:558-567 | Matting/deploy/python/infer.py:669-678 — 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 (10 lines × 3) Matting/ppmatting/models/backbone/resnet_vd.py:209 — Matting/ppmatting/models/backbone/resnet_vd.py:209-218 | contrib/CrossPseudoSupervision/models/backbones/resnet.py:195-204 | paddleseg/models/backbones/resnet_vd.py:231-240 — before extracting anything, compare `Matting/ppmatting/models/backbone/resnet_vd.py` and `paddleseg/models/backbones/resnet_vd.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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) contrib/AutoNUE/models/ocrnet_nv.py:134 — contrib/AutoNUE/models/ocrnet_nv.py:134-143 | contrib/CityscapesSOTA/models/ocrnet_nv.py:143-152 | paddleseg/models/ocrnet.py:128-137 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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) contrib/LaneSeg/core/train.py:203 — contrib/LaneSeg/core/train.py:203-212 | contrib/MedicalSeg/medicalseg/core/train.py:152-161 | contrib/RSSegBenchmark/c2fnet/core/train.py:242-251 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/MedicalSeg/medicalseg/core/train.py` as WHOLE FILES: this scan already matched 13 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.
  • Duplicated block (10 lines × 3) contrib/MedicalSeg/medicalseg/models/losses/mixes_losses.py:38 — contrib/MedicalSeg/medicalseg/models/losses/mixes_losses.py:38-47 | contrib/MedicalSeg/nnunet/losses/multiple_losses.py:36-45 | paddleseg/models/losses/mixed_loss.py:38-47 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/mixes_losses.py` and `paddleseg/models/losses/mixed_loss.py` as WHOLE FILES: 89% 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.
  • Duplicated block (10 lines × 3) contrib/PanopticSeg/paddlepanseg/core/infer.py:20 — contrib/PanopticSeg/paddlepanseg/core/infer.py:20-29 | contrib/RSSegBenchmark/c2fnet/core/infer.py:25-34 | paddleseg/core/infer.py:26-35 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/infer.py` and `paddleseg/core/infer.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 145 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) contrib/QualityInspector/qinspector/uad/models/padim.py:38 — contrib/QualityInspector/qinspector/uad/models/padim.py:38-47 | contrib/QualityInspector/qinspector/uad/models/patchcore.py:140-149 | contrib/QualityInspector/qinspector/uad/models/patchcore.py:155-164 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/QualityInspector/qinspector/uad/models/padim.py:37` calls `no_grad` and `contrib/QualityInspector/qinspector/uad/models/patchcore.py:154` 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 (10 lines × 3) contrib/QualityInspector/tools/seg/model/export_onnx.py:70 — contrib/QualityInspector/tools/seg/model/export_onnx.py:70-79 | deploy/python/infer_onnx_trt.py:372-381 | tools/model/export_onnx.py:70-79 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/export_onnx.py` and `deploy/python/infer_onnx_trt.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 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 · Edited copy of a member (13 corresponding lines) · ×8
  • Edited copy of a member (13 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/instance.py:52 — contrib/PanopticDeepLab/utils/evaluation/instance.py:52-66 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:31-48 — 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) paddleseg/models/backbones/seaformer.py:474 — paddleseg/models/backbones/seaformer.py:474-486 | paddleseg/models/backbones/seaformer.py:491-503 — 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) paddleseg/models/encnet.py:180 — paddleseg/models/encnet.py:180-192 | paddleseg/models/fastfcn.py:198-212 — 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) contrib/QualityInspector/tools/seg/model/analyze_model.py:134 — contrib/QualityInspector/tools/seg/model/analyze_model.py:134-146 | tools/model/analyze_model.py:134-147 — 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) contrib/PanopticSeg/paddlepanseg/models/param_init.py:36 — contrib/PanopticSeg/paddlepanseg/models/param_init.py:36-48 | paddleseg/cvlibs/param_init.py:193-217 — 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) Matting/ppmatting/models/gca.py:265 — Matting/ppmatting/models/gca.py:265-277 | Matting/ppmatting/models/gca.py:291-305 — 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) Matting/ppmatting/models/ppmattingv2.py:349 — Matting/ppmatting/models/ppmattingv2.py:349-366 | paddleseg/models/layers/pyramid_pool.py:190-202 — 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) REDACTED:240 — REDACTED:240-252 | REDACTED:218-230 — 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 · Edited copy of a member (16 corresponding lines) · ×8
  • Edited copy of a member (16 corresponding lines) contrib/MedicalSeg/medicalseg/models/swinunet.py:229 — contrib/MedicalSeg/medicalseg/models/swinunet.py:229-244 | contrib/MedicalSeg/medicalseg/models/swinunet.py:263-280 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) paddleseg/models/espnetv1.py:173 — paddleseg/models/espnetv1.py:173-188 | paddleseg/models/espnetv1.py:240-257 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) Matting/ppmatting/models/dim.py:205 — Matting/ppmatting/models/dim.py:205-225 | paddleseg/models/layers/tensor_fusion.py:265-280 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) paddleseg/models/backbones/lite_hrnet.py:197 — paddleseg/models/backbones/lite_hrnet.py:197-215 | paddleseg/models/backbones/lite_hrnet.py:239-254 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) contrib/DomainAdaptation/cvlibs/config.py:73 — contrib/DomainAdaptation/cvlibs/config.py:73-88 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:76-92 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) Matting/ppmatting/models/rvm.py:298 — Matting/ppmatting/models/rvm.py:298-313 | Matting/ppmatting/models/rvm.py:351-367 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) EISeg/med3d/EISegMed3D/EISegMed3D.py:1317 — EISeg/med3d/EISegMed3D/EISegMed3D.py:1317-1332 | EISeg/med3d/EISegMed3D/EISegMed3D.py:1364-1381 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) contrib/MedicalSeg/tools/prepare_lung_coronavirus.py:92 — contrib/MedicalSeg/tools/prepare_lung_coronavirus.py:92-109 | contrib/MedicalSeg/tools/prepare_mri_spine_seg.py:82-97 — These two members are one piece of code written twice and then edited apart: 16 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 (7 corresponding lines) · ×8
  • Edited copy of a member (7 corresponding lines) REDACTED:203 — REDACTED:203-211 | paddleseg/models/backbones/vit_adapter.py:159-165 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) contrib/QualityInspector/tools/uad/patchcore/val.py:228 — contrib/QualityInspector/tools/uad/patchcore/val.py:228-234 | contrib/QualityInspector/tools/uad/patchcore/val.py:238-251 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) EISeg/eiseg/plugin/n2grid/grid.py:47 — EISeg/eiseg/plugin/n2grid/grid.py:47-69 | EISeg/eiseg/plugin/n2grid/rs_grid.py:41-47 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) paddleseg/models/encnet.py:216 — paddleseg/models/encnet.py:216-225 | paddleseg/models/fastfcn.py:235-241 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) REDACTED:2173 — REDACTED:2173-2180 | REDACTED:2191-2197 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) paddleseg/models/backbones/ghostnet.py:279 — paddleseg/models/backbones/ghostnet.py:279-285 | paddleseg/models/backbones/mobilenetv2.py:101-109 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java:23 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java:23-29 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/preprocess/Preprocess.java:23-29 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) test_tipc/serving_python/web_service.py:93 — test_tipc/serving_python/web_service.py:93-100 | test_tipc/serving_cpp/serving_client.py:59-65 — These two members are one piece of code written twice and then edited apart: 7 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) · ×8
  • Edited copy of a member (4 corresponding lines) contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:389 — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:389-392 | paddleseg/models/losses/maskformer_loss.py:371-375 — 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.
  • Edited copy of a member (4 corresponding lines) contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:396 — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:396-399 | paddleseg/models/losses/maskformer_loss.py:378-382 — 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.
  • Edited copy of a member (4 corresponding lines) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:385 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:385-389 | paddleseg/models/backbones/swin_transformer.py:339-342 — 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.
  • Edited copy of a member (4 corresponding lines) contrib/PanopticSeg/paddlepanseg/models/mask2former/pixel_decoder.py:144 — contrib/PanopticSeg/paddlepanseg/models/mask2former/pixel_decoder.py:144-147 | contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:151-154 — 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.
  • Edited copy of a member (4 corresponding lines) EISeg/eiseg/widget/label_corres.py:186 — EISeg/eiseg/widget/label_corres.py:186-189 | EISeg/eiseg/widget/shortcut.py:123-126 — 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.
  • Edited copy of a member (4 corresponding lines) contrib/DomainAdaptation/cvlibs/config.py:295 — contrib/DomainAdaptation/cvlibs/config.py:295-301 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:372-375 — 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.
  • Edited copy of a member (4 corresponding lines) Matting/ppmatting/models/backbone/mobilenet_v2.py:157 — Matting/ppmatting/models/backbone/mobilenet_v2.py:157-160 | paddleseg/models/backbones/mobilenetv2.py:226-229 — 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.
  • Edited copy of a member (4 corresponding lines) contrib/MedicalSeg/medicalseg/cvlibs/manager.py:80 — contrib/MedicalSeg/medicalseg/cvlibs/manager.py:80-83 | paddleseg/cvlibs/manager.py:78-81 — 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 (26 lines × 2) · ×8
  • Duplicated block (26 lines × 2) Matting/ppmatting/models/backbone/mobilenet_v2.py:129 — Matting/ppmatting/models/backbone/mobilenet_v2.py:129-154 | paddleseg/models/backbones/mobilenetv2.py:198-223 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenet_v2.py` and `paddleseg/models/backbones/mobilenetv2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 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) contrib/AutoNUE/scripts/train.py:142 — contrib/AutoNUE/scripts/train.py:142-167 | contrib/CityscapesSOTA/scripts/train.py:145-170 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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) contrib/LaneSeg/train.py:160 — contrib/LaneSeg/train.py:160-185 | contrib/PanopticDeepLab/train.py:138-163 — `contrib/LaneSeg/train.py` and `contrib/PanopticDeepLab/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/LaneSeg/train.py:160` 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 (26 lines × 2) contrib/MedicalSeg/test.py:96 — contrib/MedicalSeg/test.py:96-121 | contrib/MedicalSeg/val.py:104-129 — before extracting anything, compare `contrib/MedicalSeg/test.py` and `contrib/MedicalSeg/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 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 (26 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:149 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:149-174 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:155-180 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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 `contrib/PanopticDeepLab/models/panoptic_deeplab.py:149` 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 (26 lines × 2) paddleseg/models/danet.py:156 — paddleseg/models/danet.py:156-181 | paddleseg/models/layers/attention.py:204-229 — before extracting anything, compare `paddleseg/models/danet.py` and `paddleseg/models/layers/attention.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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) Matting/ppmatting/models/backbone/hrnet.py:107 — Matting/ppmatting/models/backbone/hrnet.py:107-132 | paddleseg/models/backbones/hrnet.py:107-132 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 `Matting/ppmatting/models/backbone/hrnet.py:107` 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 (26 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:200 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:200-225 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java:196-221 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 139 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 `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:200` 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 first that the copies are not typed on the same thing: `Preprocess` names `com.baidu.paddle.lite.demo.segmentation.preprocess.Preprocess` in one and `com.paddle.demo.matting.preprocess.Preprocess` 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 (8–9 lines × 2) · ×8
  • Duplicated block (8–9 lines × 2) EISeg/eiseg/inference/predictor/ops.py:48 — EISeg/eiseg/inference/predictor/ops.py:48-55 | EISeg/med3d/EISegMed3D/inference/ops.py:101-109 — 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.
  • Duplicated block (8–9 lines × 2) contrib/DomainAdaptation/script/train.py:309 — contrib/DomainAdaptation/script/train.py:309-317 | contrib/DomainAdaptation/script/train.py:323-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note 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 (8–9 lines × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:440 — contrib/MedicalSeg/medicalseg/models/nnformer.py:440-447 | contrib/MedicalSeg/medicalseg/models/nnformer.py:550-558 — 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 `contrib/MedicalSeg/medicalseg/models/nnformer.py:440` 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–9 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:310 — contrib/MedicalSeg/medicalseg/transforms/functional.py:310-318 | contrib/MedicalSeg/nnunet/transforms/functional.py:216-223 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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–9 lines × 2) paddleseg/models/efficientformerv2_seg.py:234 — paddleseg/models/efficientformerv2_seg.py:234-241 | paddleseg/models/pointrend.py:583-591 — 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 `paddleseg/models/efficientformerv2_seg.py:234` 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, `paddleseg/models/efficientformerv2_seg.py:232` calls `Dropout2D` and `paddleseg/models/pointrend.py:582` 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 (8–9 lines × 2) paddleseg/models/losses/lovasz_loss.py:127 — paddleseg/models/losses/lovasz_loss.py:127-134 | paddleseg/models/losses/lovasz_loss.py:188-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.
  • Duplicated block (8–9 lines × 2) paddleseg/models/sinet.py:139 — paddleseg/models/sinet.py:139-147 | paddleseg/models/sinet.py:262-269 — 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, `paddleseg/models/sinet.py:148` calls `PReLU` and `paddleseg/models/sinet.py:271` 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 (8–9 lines × 2) Matting/ppmatting/transforms/transforms.py:172 — Matting/ppmatting/transforms/transforms.py:172-179 | Matting/ppmatting/transforms/transforms.py:245-253 — 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.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) contrib/MedicalSeg/medicalseg/transforms/functional.py:418 — contrib/MedicalSeg/medicalseg/transforms/functional.py:418-435 | contrib/MedicalSeg/nnunet/transforms/functional.py:134-151 — 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) paddleseg/models/backbones/strideformer.py:683 — paddleseg/models/backbones/strideformer.py:683-705 | paddleseg/models/backbones/strideformer.py:727-744 — 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) contrib/QualityInspector/qinspector/uad/models/patchcore.py:154 — contrib/QualityInspector/qinspector/uad/models/patchcore.py:154-171 | contrib/QualityInspector/qinspector/uad/models/patchcore.py:319-336 — 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) contrib/MedicalSeg/nnunet/datasets/dataloader.py:62 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:62-82 | contrib/MedicalSeg/nnunet/datasets/dataloader.py:272-289 — 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) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:304 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:304-321 | paddleseg/models/fcn.py:109-126 — 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) contrib/MedicalSeg/medicalseg/transforms/transform.py:236 — contrib/MedicalSeg/medicalseg/transforms/transform.py:236-253 | contrib/MedicalSeg/medicalseg/transforms/transform.py:524-541 — 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) contrib/MedicalSeg/nnunet/infer.py:220 — contrib/MedicalSeg/nnunet/infer.py:220-237 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:753-771 — 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 (29 corresponding lines) · ×7
  • Edited copy of a member (29 corresponding lines) contrib/QualityInspector/tools/seg/val.py:119 — contrib/QualityInspector/tools/seg/val.py:119-147 | tools/val.py:127-155 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) contrib/CrossPseudoSupervision/val.py:120 — contrib/CrossPseudoSupervision/val.py:120-148 | deploy/slim/quant/qat_val.py:130-164 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) contrib/CrossPseudoSupervision/cvlibs/builder.py:172 — contrib/CrossPseudoSupervision/cvlibs/builder.py:172-200 | paddleseg/cvlibs/builder.py:227-256 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) paddleseg/models/layers/vit_adapter_layers.py:245 — paddleseg/models/layers/vit_adapter_layers.py:245-275 | paddleseg/models/layers/vit_adapter_layers.py:330-358 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) contrib/MedicalSeg/medicalseg/cvlibs/config.py:173 — contrib/MedicalSeg/medicalseg/cvlibs/config.py:173-201 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:223-251 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) contrib/CrossPseudoSupervision/models/backbones/resnet.py:270 — contrib/CrossPseudoSupervision/models/backbones/resnet.py:270-298 | contrib/RSSegBenchmark/backbones/resnet.py:198-228 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) contrib/LaneSeg/export.py:27 — contrib/LaneSeg/export.py:27-55 | contrib/LaneSeg/predict.py:27-59 — These two members are one piece of code written twice and then edited apart: 29 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 (20 corresponding lines) · ×7
  • Edited copy of a member (20 corresponding lines) contrib/AutoNUE/models/ocrnet_nv.py:110 — contrib/AutoNUE/models/ocrnet_nv.py:110-131 | paddleseg/models/ocrnet.py:106-125 — 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.
  • Edited copy of a member (20 corresponding lines) contrib/AutoNUE/datasets/auto_nue.py:156 — contrib/AutoNUE/datasets/auto_nue.py:156-176 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:169-188 — 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.
  • Edited copy of a member (20 corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:338 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:338-366 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:254-273 — 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.
  • Edited copy of a member (20 corresponding lines) paddleseg/models/ann.py:299 — paddleseg/models/ann.py:299-323 | paddleseg/models/ann.py:374-393 — 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.
  • Edited copy of a member (20 corresponding lines) contrib/QualityInspector/qinspector/uad/utils/utils.py:180 — contrib/QualityInspector/qinspector/uad/utils/utils.py:180-207 | contrib/QualityInspector/qinspector/uad/utils/utils.py:241-260 — 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.
  • Edited copy of a member (20 corresponding lines) deploy/python/infer_onnx_trt.py:233 — deploy/python/infer_onnx_trt.py:233-252 | deploy/python/infer_onnx_trt.py:339-359 — 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.
  • Edited copy of a member (20 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/instance.py:332 — contrib/PanopticDeepLab/utils/evaluation/instance.py:332-351 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:312-332 — 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 copy of a member (17 corresponding lines) · ×7
  • Edited copy of a member (17 corresponding lines) Matting/ppmatting/models/backbone/stdcnet.py:85 — Matting/ppmatting/models/backbone/stdcnet.py:85-101 | paddleseg/models/backbones/stdcnet.py:90-108 — 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) contrib/DomainAdaptation/datasets/gta5_noconfig.py:100 — contrib/DomainAdaptation/datasets/gta5_noconfig.py:100-118 | contrib/DomainAdaptation/datasets/synthia.py:99-115 — 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) paddleseg/models/ddrnet.py:148 — paddleseg/models/ddrnet.py:148-166 | paddleseg/models/rtformer.py:169-185 — 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) Matting/ppmatting/models/backbone/resnet_vd.py:40 — Matting/ppmatting/models/backbone/resnet_vd.py:40-56 | paddleseg/models/backbones/resnet_vd.py:39-65 — 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) paddleseg/models/backbones/pidnet.py:42 — paddleseg/models/backbones/pidnet.py:42-59 | paddleseg/models/ddrnet.py:220-236 — 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) paddleseg/models/pfpnnet.py:55 — paddleseg/models/pfpnnet.py:55-71 | paddleseg/models/upernet.py:54-73 — 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) contrib/PanopticSeg/deploy/python/infer.py:369 — contrib/PanopticSeg/deploy/python/infer.py:369-385 | deploy/python/infer.py:369-385 — 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 · Duplicated block (23 lines × 2) · ×7
  • Duplicated block (23 lines × 2) Matting/ppmatting/models/backbone/stdcnet.py:162 — Matting/ppmatting/models/backbone/stdcnet.py:162-184 | Matting/ppmatting/models/backbone/stdcnet.py:218-240 — 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 `Matting/ppmatting/models/backbone/stdcnet.py:162` 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 (23 lines × 2) contrib/AutoNUE/core/predict_ensemble.py:99 — contrib/AutoNUE/core/predict_ensemble.py:99-121 | contrib/AutoNUE/core/predict_ensemble_three.py:118-140 — before extracting anything, compare `contrib/AutoNUE/core/predict_ensemble.py` and `contrib/AutoNUE/core/predict_ensemble_three.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 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 (23 lines × 2) contrib/AutoNUE/predict_ensemble.py:31 — contrib/AutoNUE/predict_ensemble.py:31-53 | contrib/AutoNUE/predict_ensemble_three.py:31-53 — before extracting anything, compare `contrib/AutoNUE/predict_ensemble.py` and `contrib/AutoNUE/predict_ensemble_three.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 211 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 `contrib/AutoNUE/predict_ensemble.py:31` 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.
  • Duplicated block (23 lines × 2) contrib/AutoNUE/val.py:95 — contrib/AutoNUE/val.py:95-117 | contrib/CityscapesSOTA/val.py:95-117 — `contrib/AutoNUE/val.py` and `contrib/CityscapesSOTA/val.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 162 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/CityscapesSOTA/val.py:118` calls `info`, `format` and `contrib/AutoNUE/val.py:119` 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 (23 lines × 2) contrib/MedicalSeg/medicalseg/models/layers/layer_libs.py:42 — contrib/MedicalSeg/medicalseg/models/layers/layer_libs.py:42-64 | contrib/MedicalSeg/medicalseg/models/nnunet.py:190-212 — 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 (23 lines × 2) contrib/MedicalSeg/medicalseg/utils/download.py:123 — contrib/MedicalSeg/medicalseg/utils/download.py:123-145 | paddleseg/utils/download.py:124-146 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `paddleseg/utils/download.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 122 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 (23 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:306 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:306-328 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:234-256 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 180 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×7
  • Duplicated block (16–17 lines × 2) Matting/tools/bg_replace_video.py:38 — Matting/tools/bg_replace_video.py:38-54 | Matting/tools/predict_video.py:38-53 — before extracting anything, compare `Matting/tools/bg_replace_video.py` and `Matting/tools/predict_video.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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 `Matting/tools/bg_replace_video.py:38` 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.
  • Duplicated block (16–17 lines × 2) contrib/AutoNUE/models/mscale_ocrnet.py:22 — contrib/AutoNUE/models/mscale_ocrnet.py:22-38 | contrib/CityscapesSOTA/models/mscale_ocrnet.py:23-38 — before extracting anything, compare `contrib/AutoNUE/models/mscale_ocrnet.py` and `contrib/CityscapesSOTA/models/mscale_ocrnet.py` as WHOLE FILES: this scan already matched 5 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 (16–17 lines × 2) contrib/DomainAdaptation/models/backbones/resnet.py:87 — contrib/DomainAdaptation/models/backbones/resnet.py:87-103 | contrib/DomainAdaptation/models/deeplabv2.py:142-157 — 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 (16–17 lines × 2) contrib/LaneSeg/core/train.py:109 — contrib/LaneSeg/core/train.py:109-125 | contrib/RSSegBenchmark/c2fnet/core/train.py:147-162 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 284 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, `contrib/LaneSeg/core/train.py:126` calls `info`, `GradScaler` and `contrib/RSSegBenchmark/c2fnet/core/train.py:163` 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 (16–17 lines × 2) contrib/LaneSeg/core/train.py:191 — contrib/LaneSeg/core/train.py:191-207 | paddleseg/core/train.py:259-274 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `paddleseg/core/train.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 74 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, `paddleseg/core/train.py:275` calls `isinstance`, `step` and `contrib/LaneSeg/core/train.py:208` 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 (16–17 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:458 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:458-474 | paddleseg/models/backbones/swin_transformer.py:415-430 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py` and `paddleseg/models/backbones/swin_transformer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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 `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:458` 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.
  • Duplicated block (16–17 lines × 2) contrib/QualityInspector/tools/uad/padim/predict.py:43 — contrib/QualityInspector/tools/uad/padim/predict.py:43-58 | contrib/QualityInspector/tools/uad/patchcore/predict.py:35-51 — 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 `contrib/QualityInspector/tools/uad/patchcore/predict.py:35` 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 · Edited copy of a member (22 corresponding lines) · ×6
  • Edited copy of a member (22 corresponding lines) contrib/MedicalSeg/medicalseg/utils/metric.py:22 — contrib/MedicalSeg/medicalseg/utils/metric.py:22-61 | paddleseg/utils/metrics.py:26-72 — 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.
  • Edited copy of a member (22 corresponding lines) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:392 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:392-413 | paddleseg/models/backbones/swin_transformer.py:345-372 — 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.
  • Edited copy of a member (22 corresponding lines) Matting/ppmatting/models/backbone/gca_enc.py:81 — Matting/ppmatting/models/backbone/gca_enc.py:81-102 | Matting/ppmatting/models/gca.py:188-217 — 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.
  • Edited copy of a member (22 corresponding lines) EISeg/eiseg/inference/predictor/base.py:145 — EISeg/eiseg/inference/predictor/base.py:145-169 | EISeg/med3d/EISegMed3D/inference/predictor.py:202-223 — 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.
  • Edited copy of a member (22 corresponding lines) deploy/python/infer_onnx_trt.py:154 — deploy/python/infer_onnx_trt.py:154-175 | deploy/python/infer_onnx_trt.py:310-335 — 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.
  • Edited copy of a member (22 corresponding lines) Matting/ppmatting/utils/estimate_foreground_ml.py:9 — Matting/ppmatting/utils/estimate_foreground_ml.py:9-31 | Matting/ppmatting/utils/estimate_foreground_ml.py:36-57 — 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 (32 corresponding lines) · ×6
  • Edited copy of a member (32 corresponding lines) paddleseg/models/backbones/mobilenetv3.py:283 — paddleseg/models/backbones/mobilenetv3.py:283-314 | paddleseg/models/backbones/strideformer.py:281-312 — 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) Matting/tools/export.py:36 — Matting/tools/export.py:36-73 | contrib/MedicalSeg/export.py:26-64 — 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) paddleseg/models/backbones/efficientformerv2.py:310 — paddleseg/models/backbones/efficientformerv2.py:310-350 | paddleseg/models/backbones/efficientformerv2.py:482-513 — 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) Matting/ppmatting/models/backbone/hrnet.py:384 — Matting/ppmatting/models/backbone/hrnet.py:384-415 | paddleseg/models/backbones/hrnet.py:401-434 — 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) contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:39 — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:39-70 | paddleseg/models/pointrend.py:346-400 — 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) Matting/ppmatting/models/backbone/resnet_vd.py:76 — Matting/ppmatting/models/backbone/resnet_vd.py:76-107 | paddleseg/models/backbones/resnet_vd.py:86-125 — 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 (6 corresponding lines) · ×6
  • Edited copy of a member (6 corresponding lines) contrib/PanopticSeg/paddlepanseg/models/param_init.py:52 — contrib/PanopticSeg/paddlepanseg/models/param_init.py:52-57 | paddleseg/cvlibs/param_init.py:221-237 — 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.
  • Edited copy of a member (6 corresponding lines) EISeg/eiseg/inference/predictor/ops.py:114 — EISeg/eiseg/inference/predictor/ops.py:114-119 | EISeg/med3d/EISegMed3D/inference/ops.py:50-55 — 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.
  • Edited copy of a member (6 corresponding lines) contrib/MedicalSeg/nnunet/transforms/functional.py:463 — contrib/MedicalSeg/nnunet/transforms/functional.py:463-468 | contrib/MedicalSeg/nnunet/transforms/functional.py:472-477 — 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.
  • Edited copy of a member (6 corresponding lines) contrib/MedicalSeg/medicalseg/models/unetr.py:138 — contrib/MedicalSeg/medicalseg/models/unetr.py:138-143 | paddleseg/models/backbones/seaformer.py:287-294 — 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.
  • Edited copy of a member (6 corresponding lines) contrib/QualityInspector/qinspector/cvlib/framework.py:53 — contrib/QualityInspector/qinspector/cvlib/framework.py:53-60 | contrib/QualityInspector/tools/end2end/eval.py:218-223 — 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.
  • Edited copy of a member (6 corresponding lines) EISeg/eiseg/inference/predictor/ops.py:100 — EISeg/eiseg/inference/predictor/ops.py:100-105 | EISeg/med3d/EISegMed3D/inference/ops.py:65-70 — 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 · Edited copy of a member (3 corresponding lines) · ×6
  • Edited copy of a member (3 corresponding lines) paddleseg/models/backbones/mix_transformer.py:201 — paddleseg/models/backbones/mix_transformer.py:201-204 | REDACTED:122-124 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:42 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:42-44 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:41-43 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:178 — contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:178-180 | paddleseg/models/maskformer.py:601-604 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) EISeg/eiseg/inference/predictor/base.py:175 — EISeg/eiseg/inference/predictor/base.py:175-177 | EISeg/med3d/EISegMed3D/inference/predictor.py:229-231 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) contrib/MedicalSeg/medicalseg/models/swinunet.py:209 — contrib/MedicalSeg/medicalseg/models/swinunet.py:209-211 | contrib/MedicalSeg/medicalseg/models/transunet.py:382-384 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) paddleseg/models/backbones/seaformer.py:430 — paddleseg/models/backbones/seaformer.py:430-432 | paddleseg/models/backbones/strideformer.py:596-599 — These two members are one piece of code written twice and then edited apart: 3 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 (27 lines × 2) · ×6
  • Duplicated block (27 lines × 2) contrib/AutoNUE/train.py:108 — contrib/AutoNUE/train.py:108-134 | contrib/CityscapesSOTA/train.py:108-134 — `contrib/AutoNUE/train.py` and `contrib/CityscapesSOTA/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 185 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/AutoNUE/train.py:108` 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 (27 lines × 2) contrib/DomainAdaptation/datasets/gta5_noconfig.py:68 — contrib/DomainAdaptation/datasets/gta5_noconfig.py:68-94 | contrib/DomainAdaptation/datasets/synthia.py:62-88 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/DomainAdaptation/datasets/synthia.py:92` calls `enumerate` and `contrib/DomainAdaptation/datasets/gta5_noconfig.py:96` 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 (27 lines × 2) contrib/MedicalSeg/medicalseg/core/train.py:246 — contrib/MedicalSeg/medicalseg/core/train.py:246-272 | contrib/MedicalSeg/nnunet/core/train.py:222-248 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/core/train.py` and `contrib/MedicalSeg/nnunet/core/train.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 (27 lines × 2) contrib/MedicalSeg/nnunet/transforms/augmentation.py:188 — contrib/MedicalSeg/nnunet/transforms/augmentation.py:188-214 | contrib/MedicalSeg/nnunet/transforms/augmentation.py:233-259 — 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 `contrib/MedicalSeg/nnunet/transforms/augmentation.py:188` 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 (27 lines × 2) deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/models/postprocess/1/model.py:34 — deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/models/postprocess/1/model.py:34-60 | deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/models/preprocess/1/model.py:34-60 — 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 (27 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:58 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:58-84 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java:57-83 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 139 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `Config` names `com.baidu.paddle.lite.demo.segmentation.config.Config` in one and `com.paddle.demo.matting.config.Config` 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 (25 lines × 2) · ×6
  • Duplicated block (25 lines × 2) Matting/deploy/python/infer.py:298 — Matting/deploy/python/infer.py:298-322 | contrib/MedicalSeg/deploy/python/infer.py:344-368 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 (25 lines × 2) contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:159 — contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:159-183 | paddleseg/models/backbones/hrnet.py:172-196 — before extracting anything, compare `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 (25 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:157 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:157-181 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:144-168 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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.
  • Duplicated block (25 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:282 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:282-306 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:287-311 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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 (25 lines × 2) contrib/QualityInspector/tools/uad/stfpm/train.py:111 — contrib/QualityInspector/tools/uad/stfpm/train.py:111-135 | contrib/QualityInspector/tools/uad/stfpm/val.py:82-106 — before extracting anything, compare `contrib/QualityInspector/tools/uad/stfpm/train.py` and `contrib/QualityInspector/tools/uad/stfpm/val.py` as WHOLE FILES: this scan already matched 4 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.
  • Duplicated block (25 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:480 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:480-504 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:344-368 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 180 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 `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:480` 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 (14 lines × 3) · ×6
  • Duplicated block (14 lines × 3) REDACTED:162 — REDACTED:162-175 | contrib/CityscapesSOTA/scripts/train.py:113-126 | contrib/PanopticDeepLab/core/train.py:128-141 — before extracting anything, compare `REDACTED` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 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 (14 lines × 3) contrib/AutoNUE/core/predict_ensemble.py:83 — contrib/AutoNUE/core/predict_ensemble.py:83-96 | contrib/AutoNUE/core/predict_ensemble_three.py:90-103 | contrib/AutoNUE/core/predict_generate_autolabel.py:79-92 — before extracting anything, compare `contrib/AutoNUE/core/predict_ensemble.py` and `contrib/AutoNUE/core/predict_ensemble_three.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 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 `contrib/AutoNUE/core/predict_ensemble.py:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) contrib/AutoNUE/models/backbones/hrnet_nv.py:361 — contrib/AutoNUE/models/backbones/hrnet_nv.py:361-374 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:351-364 | paddleseg/models/backbones/uhrnet.py:553-566 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 (14 lines × 3) contrib/AutoNUE/scripts/train.py:152 — contrib/AutoNUE/scripts/train.py:152-165 | contrib/CityscapesSOTA/scripts/train.py:155-168 | contrib/LaneSeg/core/train.py:187-200 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 (14 lines × 3) contrib/QualityInspector/tools/uad/padim/predict.py:107 — contrib/QualityInspector/tools/uad/padim/predict.py:107-120 | contrib/QualityInspector/tools/uad/padim/train.py:183-196 | contrib/QualityInspector/tools/uad/padim/val.py:157-170 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/QualityInspector/tools/uad/padim/val.py:155` calls `now`, `strftime` and `contrib/QualityInspector/tools/uad/padim/predict.py:106` 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 (14 lines × 3) Matting/ppmatting/models/ppmatting.py:321 — Matting/ppmatting/models/ppmatting.py:321-334 | contrib/DomainAdaptation/models/gscnn.py:168-181 | paddleseg/models/gscnn.py:231-244 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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 × 4) · ×6
  • Duplicated block (9 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:206 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:206-214 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:500-508 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:193-201 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:475-483 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 (9 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:297 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:297-305 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:339-347 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:283-291 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:325-333 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 (9 lines × 4) paddleseg/models/backbones/uhrnet.py:211 — paddleseg/models/backbones/uhrnet.py:211-219 | paddleseg/models/backbones/uhrnet.py:230-238 | paddleseg/models/backbones/uhrnet.py:249-257 | paddleseg/models/backbones/uhrnet.py:268-276 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `paddleseg/models/backbones/uhrnet.py:211` 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 (9 lines × 4) paddleseg/models/u2net.py:361 — paddleseg/models/u2net.py:361-369 | paddleseg/models/u2net.py:430-438 | paddleseg/models/u2net.py:489-497 | paddleseg/models/u2net.py:538-546 — 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. 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 (9 lines × 4) paddleseg/models/u2net.py:300 — paddleseg/models/u2net.py:300-308 | paddleseg/models/u2net.py:378-386 | paddleseg/models/u2net.py:447-455 | paddleseg/models/u2net.py:506-514 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `paddleseg/models/u2net.py:456` calls `MaxPool2D`, `REBNCONV` and `paddleseg/models/u2net.py:516` 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 × 4) REDACTED:495 — REDACTED:495-503 | REDACTED:536-544 | REDACTED:304-312 | REDACTED:345-353 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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 (8 lines × 3) · ×6
  • Duplicated block (8 lines × 3) contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:56 — contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:56-63 | paddleseg/models/losses/ohem_cross_entropy_loss.py:78-85 | paddleseg/models/losses/ohem_edge_attention_loss.py:75-82 — before extracting anything, compare `contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py` and `paddleseg/models/losses/ohem_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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) contrib/MedicalSeg/deploy/python/infer.py:378 — contrib/MedicalSeg/deploy/python/infer.py:378-385 | contrib/PanopticSeg/deploy/python/infer.py:297-304 | deploy/python/infer.py:200-207 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `contrib/PanopticSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 141 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) contrib/QualityInspector/qinspector/uad/utils/utils.py:306 — contrib/QualityInspector/qinspector/uad/utils/utils.py:306-313 | contrib/QualityInspector/tools/uad/padim/predict.py:170-177 | contrib/QualityInspector/tools/uad/padim/val.py:266-273 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/QualityInspector/tools/uad/padim/val.py:265` calls `transpose`, `squeeze` and `contrib/QualityInspector/qinspector/uad/utils/utils.py:305` 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 (8 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:351 — EISeg/med3d/EISegMed3D/inference/models.py:351-358 | contrib/MedicalSeg/medicalseg/models/vnet.py:149-156 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:155-162 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 (8 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:242 — EISeg/med3d/EISegMed3D/inference/models.py:242-249 | contrib/MedicalSeg/medicalseg/models/vnet.py:47-54 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:48-55 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 (8 lines × 3) contrib/MedicalSeg/medicalseg/utils/download.py:30 — contrib/MedicalSeg/medicalseg/utils/download.py:30-37 | contrib/MedicalSeg/tools/preprocess_utils/uncompress.py:53-60 | paddleseg/utils/download.py:30-37 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `contrib/MedicalSeg/tools/preprocess_utils/uncompress.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 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 × 3) · ×6
  • Duplicated block (6 lines × 3) Matting/ppmatting/models/backbone/gca_enc.py:133 — Matting/ppmatting/models/backbone/gca_enc.py:133-138 | Matting/ppmatting/models/backbone/gca_enc.py:274-279 | Matting/ppmatting/models/gca.py:247-252 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/ppmatting/models/backbone/gca_enc.py:133` 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 × 3) paddleseg/models/bisenet.py:98 — paddleseg/models/bisenet.py:98-103 | paddleseg/models/efficientformerv2_seg.py:200-205 | paddleseg/models/efficientformerv2_seg.py:282-287 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `paddleseg/models/bisenet.py:96` calls `load_entire_model` and `paddleseg/models/efficientformerv2_seg.py:281` 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 (6 lines × 3) EISeg/eiseg/inference/predictor/base.py:137 — EISeg/eiseg/inference/predictor/base.py:137-142 | EISeg/med3d/EISegMed3D/inference/models.py:172-180 | EISeg/med3d/EISegMed3D/inference/predictor.py:191-197 — 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.
  • Duplicated block (6 lines × 3) Matting/ppmatting/models/backbone/mobilenetv3.py:138 — Matting/ppmatting/models/backbone/mobilenetv3.py:138-143 | paddleseg/models/backbones/mobilenetv3.py:119-124 | paddleseg/models/backbones/seaformer.py:145-151 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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 `Matting/ppmatting/models/backbone/mobilenetv3.py:138` 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 (6 lines × 3) contrib/QualityInspector/tools/seg/model/export_onnx.py:61 — contrib/QualityInspector/tools/seg/model/export_onnx.py:61-66 | deploy/python/infer_onnx_trt.py:363-368 | tools/model/export_onnx.py:61-66 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/export_onnx.py` and `deploy/python/infer_onnx_trt.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 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 (6 lines × 3) contrib/RSSegBenchmark/c2fnet/core/predict.py:40 — contrib/RSSegBenchmark/c2fnet/core/predict.py:40-45 | paddleseg/core/analyse.py:43-48 | paddleseg/core/predict.py:40-45 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/predict.py` and `paddleseg/core/analyse.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 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 · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (7 members, 50+ identical tokens) REDACTED:600 — REDACTED:600-617 | contrib/CityscapesSOTA/tools/convert_cityscapes_autolabeling.py:20-38 | contrib/MedicalSeg/medicalseg/utils/visualize.py:100-127 | contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:38-59 | paddleseg/utils/visualize.py:100-127 | tools/data/gray2pseudo_color.py:38-59 | tools/data/labelme2seg.py:41-53 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) contrib/AutoNUE/core/infer.py:24 — contrib/AutoNUE/core/infer.py:24-62 | contrib/AutoNUE/core/infer_crop.py:24-62 | contrib/AutoNUE/core/infer_ensemble.py:24-62 | contrib/AutoNUE/core/infer_ensemble_three.py:24-62 | contrib/AutoNUE/core/infer_generate_autolabel.py:24-62 | contrib/LaneSeg/core/infer.py:25-104 | contrib/PanopticDeepLab/core/infer.py:25-75 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) contrib/AutoNUE/core/infer.py:215 — contrib/AutoNUE/core/infer.py:215-262 | contrib/AutoNUE/core/infer_crop.py:215-260 | contrib/AutoNUE/core/infer_ensemble.py:168-216 | contrib/AutoNUE/core/infer_ensemble_three.py:168-214 | contrib/AutoNUE/core/infer_generate_autolabel.py:215-267 | contrib/RSSegBenchmark/c2fnet/core/infer.py:217-264 | paddleseg/core/infer.py:204-256 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) contrib/AutoNUE/datasets/auto_nue.py:64 — contrib/AutoNUE/datasets/auto_nue.py:64-126 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:64-156 | contrib/AutoNUE/datasets/auto_nue_crop.py:64-126 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:83-166 | contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py:73-140 | paddleseg/datasets/cityscapes.py:54-90 | paddleseg/datasets/cocostuff.py:51-85 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) contrib/QualityInspector/tools/uad/padim/train.py:48 — contrib/QualityInspector/tools/uad/padim/train.py:48-74 | contrib/QualityInspector/tools/uad/padim/val.py:56-82 | contrib/QualityInspector/tools/uad/patchcore/train.py:46-97 | contrib/QualityInspector/tools/uad/patchcore/val.py:46-89 | contrib/QualityInspector/tools/uad/stfpm/predict.py:36-56 | contrib/QualityInspector/tools/uad/stfpm/train.py:41-66 | contrib/QualityInspector/tools/uad/stfpm/val.py:39-58 — These 7 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 7 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 7 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Matting/ppmatting/utils/utils.py:32 — Matting/ppmatting/utils/utils.py:32-69 | contrib/AutoNUE/predict.py:100-125 | contrib/AutoNUE/predict_ensemble.py:112-137 | contrib/AutoNUE/predict_ensemble_three.py:124-149 | contrib/AutoNUE/tools/IDD_labeling.py:16-41 | contrib/PanopticDeepLab/predict.py:74-99 — 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) contrib/AutoNUE/core/infer.py:172 — contrib/AutoNUE/core/infer.py:172-202 | contrib/AutoNUE/core/infer_crop.py:172-202 | contrib/AutoNUE/core/infer_generate_autolabel.py:172-202 | contrib/RSSegBenchmark/c2fnet/core/infer.py:140-173 | contrib/RSSegBenchmark/c2fnet/core/infer.py:184-205 | paddleseg/core/infer.py:152-191 — 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) contrib/AutoNUE/core/val.py:39 — contrib/AutoNUE/core/val.py:39-172 | contrib/AutoNUE/core/val_crop.py:39-188 | contrib/LaneSeg/core/val.py:35-112 | contrib/MedicalSeg/medicalseg/core/val.py:41-209 | contrib/RSSegBenchmark/c2fnet/core/val.py:44-247 | paddleseg/core/val.py:43-244 — 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) paddleseg/models/backbones/mix_transformer.py:48 — paddleseg/models/backbones/mix_transformer.py:48-60 | paddleseg/models/backbones/mix_transformer.py:105-117 | paddleseg/models/backbones/mix_transformer.py:186-198 | paddleseg/models/backbones/mix_transformer.py:236-248 | paddleseg/models/backbones/mix_transformer.py:380-392 | paddleseg/models/backbones/swin_transformer.py:662-679 — 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) paddleseg/models/backbones/mix_transformer.py:491 — paddleseg/models/backbones/mix_transformer.py:491-501 | paddleseg/models/backbones/mix_transformer.py:506-516 | paddleseg/models/backbones/mix_transformer.py:521-531 | paddleseg/models/backbones/mix_transformer.py:536-546 | paddleseg/models/backbones/mix_transformer.py:551-561 | paddleseg/models/backbones/mix_transformer.py:566-576 — 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 · Edited copy of a member (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) EISeg/eiseg/plugin/n2grid/grid.py:81 — EISeg/eiseg/plugin/n2grid/grid.py:81-119 | EISeg/eiseg/plugin/remotesensing/raster.py:187-213 — 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) paddleseg/models/dnlnet.py:116 — paddleseg/models/dnlnet.py:116-147 | paddleseg/models/emanet.py:119-145 — 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) contrib/MedicalSeg/medicalseg/models/nnformer.py:378 — contrib/MedicalSeg/medicalseg/models/nnformer.py:378-404 | contrib/MedicalSeg/medicalseg/models/nnformer.py:482-508 — 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) contrib/PanopticDeepLab/utils/visualize.py:114 — contrib/PanopticDeepLab/utils/visualize.py:114-140 | contrib/PanopticSeg/paddlepanseg/utils/visualize.py:146-179 — 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) paddleseg/models/backbones/seaformer.py:198 — paddleseg/models/backbones/seaformer.py:198-227 | paddleseg/models/backbones/top_transformer.py:173-199 — 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 (34 corresponding lines) · ×5
  • Edited copy of a member (34 corresponding lines) contrib/LaneSeg/transforms/lane_transforms.py:45 — contrib/LaneSeg/transforms/lane_transforms.py:45-91 | paddleseg/transforms/transforms.py:911-944 — 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.
  • Edited copy of a member (34 corresponding lines) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:423 — contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:423-458 | contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:478-511 — 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.
  • Edited copy of a member (34 corresponding lines) EISeg/eiseg/inference/predictor/base.py:188 — EISeg/eiseg/inference/predictor/base.py:188-221 | EISeg/med3d/EISegMed3D/inference/predictor.py:242-278 — 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.
  • Edited copy of a member (34 corresponding lines) contrib/CrossPseudoSupervision/cvlibs/builder.py:85 — contrib/CrossPseudoSupervision/cvlibs/builder.py:85-124 | paddleseg/cvlibs/builder.py:177-210 — 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.
  • Edited copy of a member (34 corresponding lines) deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/models/postprocess/1/model.py:34 — deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/models/postprocess/1/model.py:34-67 | deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/models/preprocess/1/model.py:34-69 — 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 (19 corresponding lines) · ×5
  • Edited copy of a member (19 corresponding lines) Matting/ppmatting/transforms/transforms.py:420 — Matting/ppmatting/transforms/transforms.py:420-438 | Matting/ppmatting/transforms/transforms.py:479-497 — 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.
  • Edited copy of a member (19 corresponding lines) contrib/QualityInspector/qinspector/ops/postprocess.py:85 — contrib/QualityInspector/qinspector/ops/postprocess.py:85-103 | contrib/QualityInspector/qinspector/ops/postprocess.py:113-136 — 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.
  • Edited copy of a member (19 corresponding lines) contrib/MedicalSeg/medicalseg/transforms/transform.py:272 — contrib/MedicalSeg/medicalseg/transforms/transform.py:272-290 | contrib/MedicalSeg/medicalseg/transforms/transform.py:565-584 — 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.
  • Edited copy of a member (19 corresponding lines) contrib/QualityInspector/qinspector/utils/bbox_utils.py:6 — contrib/QualityInspector/qinspector/utils/bbox_utils.py:6-25 | contrib/QualityInspector/qinspector/utils/bbox_utils.py:29-47 — 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.
  • Edited copy of a member (19 corresponding lines) contrib/MedicalSeg/medicalseg/utils/metric.py:192 — contrib/MedicalSeg/medicalseg/utils/metric.py:192-210 | paddleseg/utils/metrics.py:236-254 — 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 · Duplicated block (36 lines × 2) · ×5
  • Duplicated block (36 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:195 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:195-230 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:182-217 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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, `contrib/MedicalSeg/nnunet/utils/base_predictor.py:232` calls `to_tensor` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py:219` 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.
  • Duplicated block (36 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:488 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:488-523 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:463-498 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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, `contrib/MedicalSeg/nnunet/utils/base_predictor.py:525` calls `to_tensor` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py:500` 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.
  • Duplicated block (36 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:156 — contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:156-191 | contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:691-726 — 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 (36 lines × 2) paddleseg/models/layers/vit_adapter_layers.py:207 — paddleseg/models/layers/vit_adapter_layers.py:207-242 | paddleseg/models/layers/vit_adapter_layers.py:292-327 — 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 (36 lines × 2) contrib/DomainAdaptation/models/gscnn.py:50 — contrib/DomainAdaptation/models/gscnn.py:50-85 | paddleseg/models/gscnn.py:106-141 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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 lines × 2) · ×5
  • Duplicated block (21 lines × 2) Matting/tools/export.py:43 — Matting/tools/export.py:43-63 | contrib/MedicalSeg/export.py:33-53 — before extracting anything, compare `Matting/tools/export.py` and `contrib/MedicalSeg/export.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. 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 `Matting/tools/export.py:43` 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.
  • Duplicated block (21 lines × 2) contrib/AutoNUE/core/val.py:69 — contrib/AutoNUE/core/val.py:69-89 | contrib/AutoNUE/core/val_crop.py:69-89 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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 (21 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:260 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:260-280 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:246-266 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 (21 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:408 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:408-428 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:413-433 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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 (21 lines × 2) paddleseg/models/danet.py:197 — paddleseg/models/danet.py:197-217 | paddleseg/models/layers/attention.py:249-269 — before extracting anything, compare `paddleseg/models/danet.py` and `paddleseg/models/layers/attention.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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 (16 lines × 4) · ×5
  • Duplicated block (16 lines × 4) Matting/deploy/python/infer.py:54 — Matting/deploy/python/infer.py:54-69 | contrib/LaneSeg/val.py:38-54 | contrib/PanopticDeepLab/val.py:34-49 | deploy/slim/quant/ptq.py:33-48 — `contrib/LaneSeg/val.py` and `contrib/PanopticDeepLab/val.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/deploy/python/infer.py:54` 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 (16 lines × 4) Matting/deploy/python/infer.py:201 — Matting/deploy/python/infer.py:201-216 | contrib/MedicalSeg/deploy/python/infer.py:230-245 | contrib/PanopticSeg/deploy/python/infer.py:149-164 | deploy/python/infer.py:50-65 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 (16 lines × 4) contrib/AutoNUE/scripts/train.py:256 — contrib/AutoNUE/scripts/train.py:256-271 | contrib/CityscapesSOTA/scripts/train.py:260-275 | contrib/PanopticDeepLab/core/train.py:294-309 | deploy/slim/distill/distill_utils.py:344-359 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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, `contrib/AutoNUE/scripts/train.py:272` calls `info` and `deploy/slim/distill/distill_utils.py:362` 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 (16 lines × 4) contrib/MedicalSeg/deploy/python/infer.py:91 — contrib/MedicalSeg/deploy/python/infer.py:91-108 | contrib/PanopticSeg/deploy/python/infer.py:82-99 | deploy/python/infer.py:321-336 | deploy/python/infer_benchmark.py:92-109 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `contrib/PanopticSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 141 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 `contrib/MedicalSeg/deploy/python/infer.py:91` 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 (16 lines × 4) contrib/MedicalSeg/medicalseg/utils/visualize.py:100 — contrib/MedicalSeg/medicalseg/utils/visualize.py:100-118 | contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:38-53 | paddleseg/utils/visualize.py:100-118 | tools/data/gray2pseudo_color.py:38-53 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/visualize.py` and `paddleseg/utils/visualize.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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 lines × 3) · ×5
  • Duplicated block (15 lines × 3) Matting/ppmatting/transforms/transforms.py:401 — Matting/ppmatting/transforms/transforms.py:401-415 | Matting/ppmatting/transforms/transforms.py:460-474 | paddleseg/transforms/transforms.py:299-313 — before extracting anything, compare `Matting/ppmatting/transforms/transforms.py` and `paddleseg/transforms/transforms.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `Matting/ppmatting/transforms/transforms.py:401` 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 (15 lines × 3) contrib/CrossPseudoSupervision/models/backbones/resnet.py:119 — contrib/CrossPseudoSupervision/models/backbones/resnet.py:119-133 | contrib/DomainAdaptation/models/backbones/resnet.py:62-76 | contrib/RSSegBenchmark/backbones/resnet.py:115-129 — 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 (15 lines × 3) contrib/CrossPseudoSupervision/predict.py:102 — contrib/CrossPseudoSupervision/predict.py:102-116 | contrib/QualityInspector/tools/seg/predict.py:100-114 | tools/analyse.py:113-127 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 × 3) contrib/LaneSeg/train.py:159 — contrib/LaneSeg/train.py:159-173 | contrib/MedicalSeg/train.py:172-186 | contrib/PanopticDeepLab/train.py:137-151 — `contrib/LaneSeg/train.py` and `contrib/MedicalSeg/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 263 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (15 lines × 3) paddleseg/datasets/optic_disc_seg.py:48 — paddleseg/datasets/optic_disc_seg.py:48-62 | paddleseg/datasets/pascal_context.py:46-60 | paddleseg/datasets/pp_humanseg14k.py:48-62 — before extracting anything, compare `paddleseg/datasets/optic_disc_seg.py` and `paddleseg/datasets/pp_humanseg14k.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 × 2) · ×5
  • Duplicated block (13–14 lines × 2) Matting/ppmatting/models/backbone/gca_enc.py:193 — Matting/ppmatting/models/backbone/gca_enc.py:193-205 | Matting/ppmatting/models/backbone/gca_enc.py:323-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Matting/ppmatting/models/backbone/gca_enc.py:322` calls `gca` and `Matting/ppmatting/models/backbone/gca_enc.py:192` 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 (13–14 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:69 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:69-81 | paddleseg/models/backbones/swin_transformer.py:52-65 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py` and `paddleseg/models/backbones/swin_transformer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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 `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:69` 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 (13–14 lines × 2) contrib/MedicalSeg/nnunet/datasets/dataloader.py:176 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:176-189 | contrib/MedicalSeg/nnunet/datasets/dataloader.py:341-353 — 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 `contrib/MedicalSeg/nnunet/datasets/dataloader.py:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) deploy/python/infer_onnx_trt.py:163 — deploy/python/infer_onnx_trt.py:163-175 | deploy/python/infer_onnx_trt.py:322-335 — 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 `deploy/python/infer_onnx_trt.py:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13–14 lines × 2) paddleseg/models/pointrend.py:469 — paddleseg/models/pointrend.py:469-481 | paddleseg/models/pointrend.py:511-524 — 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 `paddleseg/models/pointrend.py:511` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×5
  • Duplicated block (13 lines × 3) Matting/deploy/python/infer.py:312 — Matting/deploy/python/infer.py:312-324 | contrib/MedicalSeg/deploy/python/infer.py:358-370 | deploy/python/infer.py:180-192 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 `Matting/deploy/python/infer.py:312` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) contrib/AutoNUE/models/backbones/hrnet_nv.py:420 — contrib/AutoNUE/models/backbones/hrnet_nv.py:420-432 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:407-419 | paddleseg/models/backbones/uhrnet.py:609-621 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 (13 lines × 3) contrib/CityscapesSOTA/predict.py:154 — contrib/CityscapesSOTA/predict.py:154-166 | contrib/LaneSeg/predict.py:93-105 | contrib/RSSegBenchmark/predict.py:171-183 — `contrib/CityscapesSOTA/predict.py` and `contrib/LaneSeg/predict.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/RSSegBenchmark/predict.py:170` calls `Compose` and `contrib/LaneSeg/predict.py:92` 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.
  • Duplicated block (13 lines × 3) contrib/CrossPseudoSupervision/predict.py:130 — contrib/CrossPseudoSupervision/predict.py:130-142 | contrib/QualityInspector/tools/seg/predict.py:128-140 | tools/predict.py:148-160 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 (13 lines × 3) contrib/MedicalSeg/deploy/python/infer.py:400 — contrib/MedicalSeg/deploy/python/infer.py:400-412 | contrib/PanopticSeg/deploy/python/infer.py:313-325 | deploy/python/infer.py:216-228 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `contrib/PanopticSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 141 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–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) contrib/DomainAdaptation/cvlibs/config.py:152 — contrib/DomainAdaptation/cvlibs/config.py:152-164 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:158-169 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 (12–13 lines × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:240 — contrib/MedicalSeg/medicalseg/models/nnformer.py:240-251 | contrib/MedicalSeg/medicalseg/models/nnformer.py:331-343 — 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 `contrib/MedicalSeg/medicalseg/models/nnformer.py:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) paddleseg/transforms/transforms.py:476 — paddleseg/transforms/transforms.py:476-487 | paddleseg/transforms/transforms.py:752-764 — 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–13 lines × 2) EISeg/eiseg/plugin/n2grid/grid.py:105 — EISeg/eiseg/plugin/n2grid/grid.py:105-117 | EISeg/eiseg/plugin/remotesensing/raster.py:199-210 — 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 (12–13 lines × 2) REDACTED:452 — REDACTED:452-463 | REDACTED:266-278 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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, `REDACTED:465` calls `rel_pos_bias` and `REDACTED:280` 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 × 4) · ×5
  • Duplicated block (11–12 lines × 4) contrib/CrossPseudoSupervision/val.py:126 — contrib/CrossPseudoSupervision/val.py:126-137 | contrib/QualityInspector/tools/seg/val.py:125-136 | deploy/slim/quant/qat_val.py:135-145 | tools/val.py:133-144 — before extracting anything, compare `contrib/CrossPseudoSupervision/val.py` and `contrib/QualityInspector/tools/seg/val.py` as WHOLE FILES: this scan already matched 5 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/QualityInspector/tools/seg/val.py:123` calls `merge_test_config` and `deploy/slim/quant/qat_val.py:133` 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 (11–12 lines × 4) contrib/LaneSeg/core/predict.py:99 — contrib/LaneSeg/core/predict.py:99-110 | contrib/RSSegBenchmark/c2fnet/core/predict.py:132-143 | paddleseg/core/analyse.py:142-152 | paddleseg/core/predict.py:127-138 — before extracting anything, compare `contrib/LaneSeg/core/predict.py` and `contrib/RSSegBenchmark/c2fnet/core/predict.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 `contrib/LaneSeg/core/predict.py:99` 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–12 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:307 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:307-317 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:349-359 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:293-304 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:335-346 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 `contrib/MedicalSeg/nnunet/utils/base_predictor.py:307` 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.
  • Duplicated block (11–12 lines × 4) paddleseg/models/emanet.py:75 — paddleseg/models/emanet.py:75-86 | paddleseg/models/sfnet.py:76-86 | paddleseg/models/upernet.py:76-86 | paddleseg/models/upernet_vit_adapter.py:84-94 — 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. 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–12 lines × 4) paddleseg/models/knet.py:61 — paddleseg/models/knet.py:61-71 | paddleseg/models/lraspp.py:63-74 | REDACTED:59-70 | REDACTED:64-75 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 (11–12 lines × 2) · ×5
  • Duplicated block (11–12 lines × 2) contrib/PP-HumanSeg/src/seg_demo.py:125 — contrib/PP-HumanSeg/src/seg_demo.py:125-136 | contrib/PP-HumanSeg/src/seg_demo.py:175-185 — 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 `contrib/PP-HumanSeg/src/seg_demo.py:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/PP-HumanSeg/src/seg_demo.py:137` calls `tqdm` and `contrib/PP-HumanSeg/src/seg_demo.py:186` 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–12 lines × 2) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:165 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:165-176 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:177-187 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/panoptic.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 (11–12 lines × 2) contrib/SegmentAnything/scripts/amg_paddle.py:168 — contrib/SegmentAnything/scripts/amg_paddle.py:168-179 | contrib/SegmentAnything/scripts/text_to_sam_clip.py:62-72 — before extracting anything, compare `contrib/SegmentAnything/scripts/amg_paddle.py` and `contrib/SegmentAnything/scripts/text_to_sam_clip.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 (11–12 lines × 2) paddleseg/models/dnlnet.py:72 — paddleseg/models/dnlnet.py:72-82 | paddleseg/models/isanet.py:65-76 — 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 (11–12 lines × 2) paddleseg/models/encnet.py:107 — paddleseg/models/encnet.py:107-118 | paddleseg/models/fastfcn.py:128-138 — before extracting anything, compare `paddleseg/models/encnet.py` and `paddleseg/models/fastfcn.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 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 (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) contrib/AutoNUE/predict.py:156 — contrib/AutoNUE/predict.py:156-166 | contrib/AutoNUE/predict_ensemble.py:173-183 | contrib/AutoNUE/predict_ensemble_three.py:192-202 — before extracting anything, compare `contrib/AutoNUE/predict.py` and `contrib/AutoNUE/predict_ensemble.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 188 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 `contrib/AutoNUE/predict.py:156` 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 × 3) contrib/LaneSeg/core/train.py:111 — contrib/LaneSeg/core/train.py:111-121 | contrib/PanopticSeg/paddlepanseg/core/train.py:123-133 | contrib/RSSegBenchmark/c2fnet/core/train.py:149-159 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/PanopticSeg/paddlepanseg/core/train.py` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 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 `contrib/LaneSeg/core/train.py:111` 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.
  • Duplicated block (11 lines × 3) contrib/MedicalSeg/medicalseg/utils/download.py:50 — contrib/MedicalSeg/medicalseg/utils/download.py:50-60 | contrib/MedicalSeg/tools/preprocess_utils/uncompress.py:114-124 | paddleseg/utils/download.py:50-60 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/download.py` and `contrib/MedicalSeg/tools/preprocess_utils/uncompress.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 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 (11 lines × 3) Matting/ppmatting/core/bg_replace_video.py:49 — Matting/ppmatting/core/bg_replace_video.py:49-59 | Matting/ppmatting/core/predict_video.py:54-64 | Matting/ppmatting/core/val.py:42-52 — before extracting anything, compare `Matting/ppmatting/core/bg_replace_video.py` and `Matting/ppmatting/core/predict_video.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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.
  • Duplicated block (11 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:304 — contrib/DomainAdaptation/cvlibs/config.py:304-314 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:398-408 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:417-427 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 (9–10 lines × 2) · ×5
  • Duplicated block (9–10 lines × 2) contrib/LaneSeg/transforms/lane_transforms.py:63 — contrib/LaneSeg/transforms/lane_transforms.py:63-71 | paddleseg/transforms/transforms.py:918-927 — 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 (9–10 lines × 2) contrib/MedicalSeg/nnunet/utils/postprocessing.py:199 — contrib/MedicalSeg/nnunet/utils/postprocessing.py:199-207 | contrib/MedicalSeg/nnunet/utils/postprocessing.py:299-308 — 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–10 lines × 2) contrib/PanopticDeepLab/core/train.py:248 — contrib/PanopticDeepLab/core/train.py:248-257 | contrib/PanopticSeg/paddlepanseg/core/train.py:235-243 — before extracting anything, compare `contrib/PanopticDeepLab/core/train.py` and `contrib/PanopticSeg/paddlepanseg/core/train.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 226 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 `contrib/PanopticDeepLab/core/train.py:248` 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 (9–10 lines × 2) contrib/RSSegBenchmark/c2fnet/train.py:203 — contrib/RSSegBenchmark/c2fnet/train.py:203-212 | contrib/RSSegBenchmark/c2fnet/val.py:164-172 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/train.py` and `contrib/RSSegBenchmark/c2fnet/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 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 `contrib/RSSegBenchmark/c2fnet/train.py:203` 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 (9–10 lines × 2) paddleseg/models/dnlnet.py:134 — paddleseg/models/dnlnet.py:134-142 | paddleseg/models/isanet.py:111-120 — 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 `paddleseg/models/dnlnet.py:134` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: APP_EISeg (LCOM4 7) REDACTED:57 — APP_EISeg's methods fall into 7 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 7 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: PaDiMPlus (LCOM4 6) contrib/QualityInspector/qinspector/uad/models/patchcore.py:59 — PaDiMPlus's methods fall into 6 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 6 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: EISegMed3DWidget (LCOM4 5) EISeg/med3d/EISegMed3D/EISegMed3D.py:184 — EISegMed3DWidget's methods fall into 5 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 5 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: GripItem (LCOM4 4) EISeg/eiseg/widget/grip.py:19 — GripItem'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: StaticPredictor (LCOM4 4) contrib/MedicalSeg/nnunet/utils/static_predictor.py:603 — StaticPredictor'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.
D17 · Explicit Debt · FixmeComment · ×4
  • FixmeComment contrib/QualityInspector/tools/det/train.py:184 — # FIXME: Temporarily solve the priority problem of FLAGS.opt — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment contrib/PanopticSeg/paddlepanseg/utils/visualize.py:228 — # FIXME: This might result in an infinite loop — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment REDACTED:1979 — # FIXME: when big map saved, self.raster is None, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment REDACTED:3207 — # FIXME: 标签在其他图像存在标注但当前图像不存在时可以删除 — 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 · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) paddleseg/models/backbones/seaformer.py:69 — paddleseg/models/backbones/seaformer.py:69-101 | paddleseg/models/backbones/strideformer.py:49-124 — 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.
  • Edited copy of a member (23 corresponding lines) paddleseg/models/backbones/seaformer.py:244 — paddleseg/models/backbones/seaformer.py:244-274 | paddleseg/models/backbones/top_transformer.py:218-240 — 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.
  • Edited copy of a member (23 corresponding lines) paddleseg/models/layers/pyramid_pool.py:165 — paddleseg/models/layers/pyramid_pool.py:165-187 | paddleseg/models/upernet_cae.py:192-215 — 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.
  • Edited copy of a member (23 corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:242 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:242-266 | Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:268-290 — 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 (42 corresponding lines) · ×4
  • Edited copy of a member (42 corresponding lines) deploy/python/infer_onnx_trt.py:179 — deploy/python/infer_onnx_trt.py:179-229 | deploy/python/infer_onnx_trt.py:256-297 — 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) contrib/MedicalSeg/nnunet/infer.py:241 — contrib/MedicalSeg/nnunet/infer.py:241-283 | contrib/MedicalSeg/nnunet/predict.py:278-319 — 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) paddleseg/models/enet.py:419 — paddleseg/models/enet.py:419-470 | paddleseg/models/enet.py:533-574 — 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) paddleseg/models/losses/cross_entropy_loss.py:60 — paddleseg/models/losses/cross_entropy_loss.py:60-101 | paddleseg/models/losses/cross_entropy_loss.py:191-232 — 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 (35 corresponding lines) · ×4
  • Edited copy of a member (35 corresponding lines) paddleseg/models/encnet.py:102 — paddleseg/models/encnet.py:102-136 | paddleseg/models/fastfcn.py:121-157 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) contrib/AutoNUE/models/backbones/hrnet_nv.py:319 — contrib/AutoNUE/models/backbones/hrnet_nv.py:319-358 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:314-348 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) Matting/tools/bg_replace_video.py:36 — Matting/tools/bg_replace_video.py:36-77 | Matting/tools/predict_video.py:36-70 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) contrib/AutoNUE/core/infer_ensemble.py:120 — contrib/AutoNUE/core/infer_ensemble.py:120-154 | contrib/AutoNUE/core/infer_ensemble_three.py:120-154 — These two members are one piece of code written twice and then edited apart: 35 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 (37 corresponding lines) · ×4
  • Edited copy of a member (37 corresponding lines) paddleseg/models/espnetv1.py:129 — paddleseg/models/espnetv1.py:129-170 | paddleseg/models/espnetv1.py:201-237 — 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) contrib/CrossPseudoSupervision/cvlibs/builder.py:46 — contrib/CrossPseudoSupervision/cvlibs/builder.py:46-82 | paddleseg/cvlibs/builder.py:117-154 — 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) contrib/PanopticDeepLab/predict.py:28 — contrib/PanopticDeepLab/predict.py:28-70 | contrib/PanopticDeepLab/val.py:29-65 — 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) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:198 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:198-234 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java:194-230 — 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 (5 corresponding lines) · ×4
  • Edited copy of a member (5 corresponding lines) EISeg/eiseg/plugin/video/util/tensor_util.py:119 — EISeg/eiseg/plugin/video/util/tensor_util.py:119-123 | EISeg/eiseg/plugin/video/util/tensor_util.py:127-131 — 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.
  • Edited copy of a member (5 corresponding lines) contrib/QualityInspector/qinspector/uad/models/stfpm.py:32 — contrib/QualityInspector/qinspector/uad/models/stfpm.py:32-36 | paddleseg/models/backbones/resnet_ms3.py:35-40 — 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.
  • Edited copy of a member (5 corresponding lines) paddleseg/models/glore.py:148 — paddleseg/models/glore.py:148-152 | paddleseg/models/ginet.py:257-261 — 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.
  • Edited copy of a member (5 corresponding lines) paddleseg/models/dnlnet.py:177 — paddleseg/models/dnlnet.py:177-182 | paddleseg/models/layers/nonlocal2d.py:97-101 — 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 · Duplicated block (37 lines × 2) · ×4
  • Duplicated block (37 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:319 — Matting/ppmatting/models/backbone/hrnet.py:319-355 | paddleseg/models/backbones/hrnet.py:335-371 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 (37 lines × 2) Matting/ppmatting/models/backbone/hrnet.py:569 — Matting/ppmatting/models/backbone/hrnet.py:569-605 | paddleseg/models/backbones/hrnet.py:593-629 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `paddleseg/models/backbones/hrnet.py` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 430 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 (37 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:243 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:243-279 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:248-284 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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 (37 lines × 2) contrib/RSSegBenchmark/c2fnet/train.py:167 — contrib/RSSegBenchmark/c2fnet/train.py:167-203 | contrib/RSSegBenchmark/train.py:160-196 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/train.py` and `contrib/RSSegBenchmark/train.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 390 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, `contrib/RSSegBenchmark/c2fnet/train.py:204` calls `check_sync_info` and `contrib/RSSegBenchmark/train.py:199` 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 (24 lines × 2) · ×4
  • Duplicated block (24 lines × 2) Matting/ppmatting/models/backbone/mobilenetv3.py:186 — Matting/ppmatting/models/backbone/mobilenetv3.py:186-209 | paddleseg/models/backbones/mobilenetv3.py:163-186 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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 (24 lines × 2) Matting/ppmatting/models/backbone/resnet_vd.py:202 — Matting/ppmatting/models/backbone/resnet_vd.py:202-225 | paddleseg/models/backbones/resnet_vd.py:224-247 — before extracting anything, compare `Matting/ppmatting/models/backbone/resnet_vd.py` and `paddleseg/models/backbones/resnet_vd.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 (24 lines × 2) Matting/tools/train.py:89 — Matting/tools/train.py:89-112 | Matting/tools/val.py:55-78 — before extracting anything, compare `Matting/tools/train.py` and `Matting/tools/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/tools/train.py:89` 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.
  • Duplicated block (24 lines × 2) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:151 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:151-174 | paddleseg/models/losses/binary_cross_entropy_loss.py:154-177 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py` and `paddleseg/models/losses/binary_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×4
  • Duplicated block (21–22 lines × 2) Matting/deploy/python/infer.py:186 — Matting/deploy/python/infer.py:186-207 | contrib/MedicalSeg/deploy/python/infer.py:216-236 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 (21–22 lines × 2) Matting/ppmatting/core/bg_replace_video.py:158 — Matting/ppmatting/core/bg_replace_video.py:158-179 | Matting/ppmatting/core/predict_video.py:123-143 — before extracting anything, compare `Matting/ppmatting/core/bg_replace_video.py` and `Matting/ppmatting/core/predict_video.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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, `Matting/ppmatting/core/bg_replace_video.py:155` calls `get_bg` and `Matting/ppmatting/core/predict_video.py:121` 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 (21–22 lines × 2) REDACTED:405 — REDACTED:405-425 | REDACTED:218-239 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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 (21–22 lines × 2) paddleseg/models/losses/edge_attention_loss.py:42 — paddleseg/models/losses/edge_attention_loss.py:42-62 | paddleseg/models/losses/ohem_edge_attention_loss.py:49-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.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×4
  • Duplicated block (19 lines × 3) contrib/CityscapesSOTA/predict.py:110 — contrib/CityscapesSOTA/predict.py:110-128 | contrib/RSSegBenchmark/c2fnet/predict.py:129-147 | contrib/RSSegBenchmark/predict.py:122-140 — before extracting anything, compare `contrib/CityscapesSOTA/predict.py` and `contrib/RSSegBenchmark/c2fnet/predict.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 185 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/RSSegBenchmark/c2fnet/predict.py:128` calls `pop` and `contrib/CityscapesSOTA/predict.py:109` 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 (19 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:173 — contrib/DomainAdaptation/cvlibs/config.py:173-191 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:183-201 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:233-251 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 before the matched lines, `contrib/MedicalSeg/medicalseg/cvlibs/config.py:179` calls `get`, `isinstance` and `contrib/DomainAdaptation/cvlibs/config.py:172` 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 (19 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:317 — contrib/DomainAdaptation/cvlibs/config.py:317-335 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:411-429 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:430-448 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 (19 lines × 3) contrib/QualityInspector/tools/uad/stfpm/predict.py:60 — contrib/QualityInspector/tools/uad/stfpm/predict.py:60-78 | contrib/QualityInspector/tools/uad/stfpm/train.py:70-88 | contrib/QualityInspector/tools/uad/stfpm/val.py:62-80 — before extracting anything, compare `contrib/QualityInspector/tools/uad/stfpm/predict.py` and `contrib/QualityInspector/tools/uad/stfpm/val.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) contrib/MedicalSeg/medicalseg/core/train.py:109 — contrib/MedicalSeg/medicalseg/core/train.py:109-123 | contrib/MedicalSeg/nnunet/core/train.py:85-100 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/core/train.py` and `contrib/MedicalSeg/nnunet/core/train.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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, `contrib/MedicalSeg/nnunet/core/train.py:103` calls `GradScaler` and `contrib/MedicalSeg/medicalseg/core/train.py:125` 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 (15–16 lines × 2) contrib/MedicalSeg/tools/prepare.py:235 — contrib/MedicalSeg/tools/prepare.py:235-250 | contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:138-152 — before extracting anything, compare `contrib/MedicalSeg/tools/prepare.py` and `contrib/MedicalSeg/tools/prepare_msd_brain_seg.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15–16 lines × 2) contrib/RSSegBenchmark/c2fnet/core/train.py:183 — contrib/RSSegBenchmark/c2fnet/core/train.py:183-197 | paddleseg/core/train.py:200-215 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/train.py` and `paddleseg/core/train.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 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 (15–16 lines × 2) paddleseg/models/backbones/top_transformer.py:437 — paddleseg/models/backbones/top_transformer.py:437-452 | paddleseg/models/backbones/top_transformer.py:480-494 — 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×4
  • Duplicated block (13–15 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:245 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:245-257 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:231-245 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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.
  • Duplicated block (13–15 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:106 — contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:106-120 | contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:643-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note 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 (13–15 lines × 2) paddleseg/models/backbones/seaformer.py:352 — paddleseg/models/backbones/seaformer.py:352-366 | paddleseg/models/backbones/strideformer.py:485-497 — 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. 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 (13–15 lines × 2) contrib/MedicalSeg/tools/prepare_msd.py:110 — contrib/MedicalSeg/tools/prepare_msd.py:110-124 | contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:40-52 — 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 `contrib/MedicalSeg/tools/prepare_msd.py:110` 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 (12 lines × 4) · ×4
  • Duplicated block (12 lines × 4) Matting/ppmatting/models/backbone/hrnet.py:167 — Matting/ppmatting/models/backbone/hrnet.py:167-178 | contrib/AutoNUE/models/backbones/hrnet_nv.py:161-172 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:155-166 | paddleseg/models/backbones/hrnet.py:168-179 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 (12 lines × 4) contrib/LaneSeg/train.py:155 — contrib/LaneSeg/train.py:155-166 | contrib/MedicalSeg/train.py:168-179 | contrib/RSSegBenchmark/c2fnet/train.py:213-224 | contrib/RSSegBenchmark/train.py:205-216 — `contrib/LaneSeg/train.py` and `contrib/MedicalSeg/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 263 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:274 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:274-285 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:563-574 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:260-271 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:537-548 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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.
  • Duplicated block (12 lines × 4) contrib/MedicalSeg/nnunet/utils/metrics.py:145 — contrib/MedicalSeg/nnunet/utils/metrics.py:145-156 | contrib/MedicalSeg/nnunet/utils/metrics.py:164-175 | contrib/MedicalSeg/nnunet/utils/metrics.py:192-203 | contrib/MedicalSeg/nnunet/utils/metrics.py:241-252 — 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 (11 lines × 4) · ×4
  • Duplicated block (11 lines × 4) Matting/deploy/python/infer.py:318 — Matting/deploy/python/infer.py:318-328 | contrib/MedicalSeg/deploy/python/infer.py:364-374 | contrib/PanopticSeg/deploy/python/infer.py:283-293 | deploy/python/infer.py:186-196 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 (11 lines × 4) Matting/tools/bg_replace.py:94 — Matting/tools/bg_replace.py:94-104 | Matting/tools/bg_replace_video.py:81-91 | Matting/tools/predict.py:82-92 | Matting/tools/predict_video.py:74-84 — before extracting anything, compare `Matting/tools/bg_replace_video.py` and `Matting/tools/predict.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 (11 lines × 4) contrib/AutoNUE/core/predict_ensemble.py:119 — contrib/AutoNUE/core/predict_ensemble.py:119-129 | contrib/AutoNUE/core/predict_generate_autolabel.py:113-123 | contrib/RSSegBenchmark/c2fnet/core/predict.py:128-138 | paddleseg/core/predict.py:123-133 — before extracting anything, compare `contrib/AutoNUE/core/predict_ensemble.py` and `contrib/AutoNUE/core/predict_generate_autolabel.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 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 `contrib/AutoNUE/core/predict_ensemble.py:119` 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 × 4) paddleseg/models/backbones/mix_transformer.py:312 — paddleseg/models/backbones/mix_transformer.py:312-322 | paddleseg/models/backbones/mix_transformer.py:327-337 | paddleseg/models/backbones/mix_transformer.py:342-352 | paddleseg/models/backbones/mix_transformer.py:357-367 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `paddleseg/models/backbones/mix_transformer.py:312` 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 (10 lines × 4) · ×4
  • Duplicated block (10 lines × 4) Matting/ppmatting/models/backbone/hrnet.py:260 — Matting/ppmatting/models/backbone/hrnet.py:260-269 | contrib/AutoNUE/models/backbones/hrnet_nv.py:264-273 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:258-267 | paddleseg/models/backbones/hrnet.py:274-283 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 (10 lines × 4) Matting/ppmatting/models/backbone/hrnet.py:458 — Matting/ppmatting/models/backbone/hrnet.py:458-467 | contrib/AutoNUE/models/backbones/hrnet_nv.py:459-468 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:447-456 | paddleseg/models/backbones/hrnet.py:478-487 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 (10 lines × 4) contrib/LaneSeg/train.py:124 — contrib/LaneSeg/train.py:124-133 | contrib/MedicalSeg/train.py:137-146 | contrib/RSSegBenchmark/c2fnet/train.py:162-171 | contrib/RSSegBenchmark/train.py:155-164 — `contrib/LaneSeg/train.py` and `contrib/MedicalSeg/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 263 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 4) contrib/MedicalSeg/nnunet/utils/metrics.py:340 — contrib/MedicalSeg/nnunet/utils/metrics.py:340-349 | contrib/MedicalSeg/nnunet/utils/metrics.py:360-370 | contrib/MedicalSeg/nnunet/utils/metrics.py:381-390 | contrib/MedicalSeg/nnunet/utils/metrics.py:401-411 — 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. 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 (7 lines × 4) · ×4
  • Duplicated block (7 lines × 4) Matting/ppmatting/models/human_matting.py:137 — Matting/ppmatting/models/human_matting.py:137-143 | Matting/ppmatting/models/human_matting.py:146-152 | Matting/ppmatting/models/human_matting.py:155-161 | Matting/ppmatting/models/human_matting.py:164-170 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/ppmatting/models/human_matting.py:137` 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 × 4) contrib/AutoNUE/core/predict_ensemble.py:91 — contrib/AutoNUE/core/predict_ensemble.py:91-97 | contrib/AutoNUE/core/predict_ensemble_three.py:98-104 | contrib/AutoNUE/core/predict_generate_autolabel.py:87-93 | contrib/LaneSeg/core/predict.py:81-87 — before extracting anything, compare `contrib/AutoNUE/core/predict_ensemble.py` and `contrib/AutoNUE/core/predict_ensemble_three.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 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, `contrib/LaneSeg/core/predict.py:80` calls `get_color_map_list` and `contrib/AutoNUE/core/predict_ensemble.py:90` 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 (7 lines × 4) contrib/AutoNUE/scripts/train.py:140 — contrib/AutoNUE/scripts/train.py:140-148 | contrib/CityscapesSOTA/scripts/train.py:143-151 | contrib/LaneSeg/core/train.py:152-158 | deploy/slim/distill/distill_utils.py:174-181 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:140` 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. 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 (7 lines × 4) contrib/LaneSeg/deploy/python/infer.py:105 — contrib/LaneSeg/deploy/python/infer.py:105-111 | contrib/MedicalSeg/deploy/python/infer.py:377-383 | contrib/PanopticSeg/deploy/python/infer.py:296-302 | deploy/python/infer.py:199-205 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `contrib/PanopticSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 141 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.
D1 · Cyclomatic Complexity · val.evaluate (cyclomatic 19) · ×3
  • val.evaluate (cyclomatic 19) Matting/ppmatting/core/val.py:55 — val.evaluate 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.
  • val.evaluate (cyclomatic 19) contrib/RSSegBenchmark/c2fnet/core/val.py:28 — val.evaluate 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.
  • val.evaluate (cyclomatic 19) paddleseg/core/val.py:28 — val.evaluate 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.
D2 · Cognitive Complexity · Config._prepare_loss (cognitive 26) · ×3
  • Config._prepare_loss (cognitive 26) contrib/DomainAdaptation/cvlibs/config.py:247 — Config._prepare_loss has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 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.
  • Config._prepare_loss (cognitive 26) contrib/MedicalSeg/medicalseg/cvlibs/config.py:252 — Config._prepare_loss has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 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.
  • Config._prepare_loss (cognitive 26) contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:324 — Config._prepare_loss has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×3
  • Edited copy of a member (40 corresponding lines) contrib/QualityInspector/tools/dataset/visualize_annotation.py:87 — contrib/QualityInspector/tools/dataset/visualize_annotation.py:87-132 | tools/data/visualize_annotation.py:78-122 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) EISeg/tool/medical2video.py:11 — EISeg/tool/medical2video.py:11-50 | contrib/MedicalSeg/tools/prepare.py:151-195 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) contrib/SegmentAnything/segment_anything/build_sam.py:56 — contrib/SegmentAnything/segment_anything/build_sam.py:56-99 | contrib/SegmentAnything/segment_anything/build_sam.py:115-154 — These two members are one piece of code written twice and then edited apart: 40 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) · ×3
  • Edited copy of a member (28 corresponding lines) contrib/AutoNUE/models/ocrnet_nv.py:233 — contrib/AutoNUE/models/ocrnet_nv.py:233-260 | contrib/CityscapesSOTA/models/ocrnet_nv.py:242-269 — 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.
  • Edited copy of a member (28 corresponding lines) contrib/DomainAdaptation/utils/config_check.py:32 — contrib/DomainAdaptation/utils/config_check.py:32-60 | contrib/MedicalSeg/medicalseg/utils/config_check.py:32-59 — 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.
  • Edited copy of a member (28 corresponding lines) contrib/PanopticDeepLab/models/panoptic_deeplab.py:148 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:148-175 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:153-181 — 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 (38 corresponding lines) · ×3
  • Edited copy of a member (38 corresponding lines) contrib/CrossPseudoSupervision/cvlibs/config.py:207 — contrib/CrossPseudoSupervision/cvlibs/config.py:207-246 | paddleseg/cvlibs/config.py:200-237 — 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.
  • Edited copy of a member (38 corresponding lines) paddleseg/datasets/optic_disc_seg.py:47 — paddleseg/datasets/optic_disc_seg.py:47-99 | paddleseg/datasets/pp_humanseg14k.py:47-84 — 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.
  • Edited copy of a member (38 corresponding lines) contrib/MedicalSeg/test.py:84 — contrib/MedicalSeg/test.py:84-121 | contrib/MedicalSeg/val.py:83-129 — 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 (51 corresponding lines) · ×3
  • Edited copy of a member (51 corresponding lines) Matting/ppmatting/models/backbone/stdcnet.py:134 — Matting/ppmatting/models/backbone/stdcnet.py:134-184 | paddleseg/models/backbones/stdcnet.py:154-228 — These two members are one piece of code written twice and then edited apart: 51 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 (51 corresponding lines) paddleseg/models/backbones/lite_hrnet.py:324 — paddleseg/models/backbones/lite_hrnet.py:324-374 | paddleseg/models/backbones/lite_hrnet.py:456-513 — These two members are one piece of code written twice and then edited apart: 51 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 (51 corresponding lines) contrib/DomainAdaptation/datasets/gta5_noconfig.py:44 — contrib/DomainAdaptation/datasets/gta5_noconfig.py:44-97 | contrib/DomainAdaptation/datasets/synthia.py:46-96 — These two members are one piece of code written twice and then edited apart: 51 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) · ×3
  • Edited copy of a member (25 corresponding lines) contrib/PanopticSeg/paddlepanseg/models/mask2former/common.py:41 — contrib/PanopticSeg/paddlepanseg/models/mask2former/common.py:41-65 | paddleseg/models/maskformer.py:250-284 — 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) contrib/PanopticDeepLab/utils/evaluation/semantic.py:53 — contrib/PanopticDeepLab/utils/evaluation/semantic.py:53-84 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/sem_seg_evaluator.py:40-64 — 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) contrib/MedicalSeg/medicalseg/utils/utils.py:49 — contrib/MedicalSeg/medicalseg/utils/utils.py:49-73 | paddleseg/utils/utils.py:121-148 — 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 (39 corresponding lines) · ×3
  • Edited copy of a member (39 corresponding lines) contrib/AutoNUE/tools/IDD_labeling.py:45 — contrib/AutoNUE/tools/IDD_labeling.py:45-85 | contrib/AutoNUE/tools/IDD_labeling.py:89-127 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) REDACTED:356 — REDACTED:356-401 | REDACTED:177-215 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) paddleseg/models/efficientformerv2_seg.py:217 — paddleseg/models/efficientformerv2_seg.py:217-261 | paddleseg/models/pointrend.py:571-609 — These two members are one piece of code written twice and then edited apart: 39 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 (43 corresponding lines) · ×3
  • Edited copy of a member (43 corresponding lines) REDACTED:956 — REDACTED:956-1007 | REDACTED:1010-1052 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) contrib/AutoNUE/predict_ensemble.py:141 — contrib/AutoNUE/predict_ensemble.py:141-183 | contrib/AutoNUE/predict_ensemble_three.py:153-202 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) paddleseg/models/encnet.py:53 — paddleseg/models/encnet.py:53-95 | paddleseg/models/fastfcn.py:56-114 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×3
  • Edited copy of a member (21 corresponding lines) REDACTED:452 — REDACTED:452-472 | REDACTED:266-287 — 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) contrib/MedicalSeg/medicalseg/models/nnformer.py:896 — contrib/MedicalSeg/medicalseg/models/nnformer.py:896-916 | paddleseg/models/backbones/swin_transformer.py:682-708 — 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) paddleseg/models/layers/pyramid_pool.py:142 — paddleseg/models/layers/pyramid_pool.py:142-162 | paddleseg/models/upernet_cae.py:168-189 — 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 · Edited copies of one member (3 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 8+ corresponding lines) paddleseg/models/encnet.py:157 — paddleseg/models/encnet.py:157-165 | paddleseg/models/fastfcn.py:177-184 | paddleseg/models/fastfcn.py:187-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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, 8+ corresponding lines) paddleseg/models/bisenet.py:95 — paddleseg/models/bisenet.py:95-103 | paddleseg/models/ddrnet.py:137-145 | paddleseg/models/unet_plusplus.py:135-142 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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, 8+ corresponding lines) contrib/MedicalSeg/medicalseg/models/losses/cross_entropy_loss.py:38 — contrib/MedicalSeg/medicalseg/models/losses/cross_entropy_loss.py:38-45 | paddleseg/models/losses/cross_entropy_loss.py:48-57 | paddleseg/models/losses/ohem_cross_entropy_loss.py:45-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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 (34–35 lines × 2) · ×3
  • Duplicated block (34–35 lines × 2) contrib/AutoNUE/core/val.py:139 — contrib/AutoNUE/core/val.py:139-172 | contrib/AutoNUE/core/val_crop.py:154-188 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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.
  • Duplicated block (34–35 lines × 2) contrib/MedicalSeg/nnunet/utils/base_predictor.py:100 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:100-134 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:88-121 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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.
  • Duplicated block (34–35 lines × 2) paddleseg/models/losses/point_cross_entropy_loss.py:129 — paddleseg/models/losses/point_cross_entropy_loss.py:129-162 | paddleseg/models/pointrend.py:778-812 — 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 (29 lines × 2) · ×3
  • Duplicated block (29 lines × 2) Matting/ppmatting/models/backbone/mobilenet_v2.py:88 — Matting/ppmatting/models/backbone/mobilenet_v2.py:88-116 | paddleseg/models/backbones/mobilenetv2.py:157-185 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenet_v2.py` and `paddleseg/models/backbones/mobilenetv2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 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 (29 lines × 2) contrib/DomainAdaptation/models/gscnn.py:255 — contrib/DomainAdaptation/models/gscnn.py:255-283 | paddleseg/models/gscnn.py:318-346 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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 (29 lines × 2) paddleseg/models/backbones/uhrnet.py:860 — paddleseg/models/backbones/uhrnet.py:860-888 | paddleseg/models/backbones/uhrnet.py:893-921 — 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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×3
  • Duplicated block (28 lines × 2) Matting/ppmatting/models/backbone/resnet_vd.py:255 — Matting/ppmatting/models/backbone/resnet_vd.py:255-282 | paddleseg/models/backbones/resnet_vd.py:280-307 — before extracting anything, compare `Matting/ppmatting/models/backbone/resnet_vd.py` and `paddleseg/models/backbones/resnet_vd.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `Matting/ppmatting/models/backbone/resnet_vd.py:255` 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 (28 lines × 2) contrib/MedicalSeg/medicalseg/cvlibs/manager.py:94 — contrib/MedicalSeg/medicalseg/cvlibs/manager.py:94-121 | paddleseg/cvlibs/manager.py:92-119 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/cvlibs/manager.py` and `paddleseg/cvlibs/manager.py` as WHOLE FILES: 98% 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.
  • Duplicated block (28 lines × 2) paddleseg/models/backbones/strideformer.py:749 — paddleseg/models/backbones/strideformer.py:749-776 | paddleseg/models/backbones/strideformer.py:781-808 — 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.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×3
  • Duplicated block (23–25 lines × 2) contrib/MedicalSeg/medicalseg/core/train.py:155 — contrib/MedicalSeg/medicalseg/core/train.py:155-179 | contrib/MedicalSeg/nnunet/core/train.py:137-159 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/core/train.py` and `contrib/MedicalSeg/nnunet/core/train.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 (23–25 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:82 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:82-106 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:84-106 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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 (23–25 lines × 2) contrib/QualityInspector/tools/seg/export.py:28 — contrib/QualityInspector/tools/seg/export.py:28-50 | tools/export.py:29-53 — 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, `tools/export.py:54` calls `add_argument` and `contrib/QualityInspector/tools/seg/export.py:52` 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 (19–21 lines × 2) · ×3
  • Duplicated block (19–21 lines × 2) Matting/deploy/python/infer.py:347 — Matting/deploy/python/infer.py:347-367 | Matting/deploy/python/infer.py:382-400 — 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, `Matting/deploy/python/infer.py:403` calls `stamp` and `Matting/deploy/python/infer.py:368` 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 (19–21 lines × 2) contrib/AutoNUE/models/backbones/hrnet_nv.py:241 — contrib/AutoNUE/models/backbones/hrnet_nv.py:241-261 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:237-255 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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–21 lines × 2) contrib/MedicalSeg/nnunet/utils/postprocessing.py:163 — contrib/MedicalSeg/nnunet/utils/postprocessing.py:163-181 | contrib/MedicalSeg/nnunet/utils/postprocessing.py:264-284 — 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 `contrib/MedicalSeg/nnunet/utils/postprocessing.py:264` 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 (18–21 lines × 2) · ×3
  • Duplicated block (18–21 lines × 2) Matting/tools/train.py:108 — Matting/tools/train.py:108-128 | contrib/DomainAdaptation/train.py:87-104 — before extracting anything, compare `Matting/tools/train.py` and `contrib/DomainAdaptation/train.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 133 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 `Matting/tools/train.py:108` 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 (18–21 lines × 2) contrib/AutoNUE/models/mscale_ocrnet.py:232 — contrib/AutoNUE/models/mscale_ocrnet.py:232-252 | contrib/CityscapesSOTA/models/mscale_ocrnet.py:152-169 — before extracting anything, compare `contrib/AutoNUE/models/mscale_ocrnet.py` and `contrib/CityscapesSOTA/models/mscale_ocrnet.py` as WHOLE FILES: this scan already matched 5 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.
  • Duplicated block (18–21 lines × 2) paddleseg/models/layers/vit_adapter_layers.py:255 — paddleseg/models/layers/vit_adapter_layers.py:255-275 | paddleseg/models/layers/vit_adapter_layers.py:340-357 — 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. 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 (20 lines × 3) · ×3
  • Duplicated block (20 lines × 3) contrib/AutoNUE/scripts/train.py:157 — contrib/AutoNUE/scripts/train.py:157-176 | contrib/CityscapesSOTA/scripts/train.py:160-179 | contrib/PanopticDeepLab/core/train.py:179-198 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:157` 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 (20 lines × 3) contrib/PanopticDeepLab/predict.py:51 — contrib/PanopticDeepLab/predict.py:51-70 | contrib/PanopticDeepLab/train.py:95-114 | contrib/PanopticDeepLab/val.py:46-65 — before extracting anything, compare `contrib/PanopticDeepLab/predict.py` and `contrib/PanopticDeepLab/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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.
  • Duplicated block (20 lines × 3) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:40 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:40-59 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:81-100 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Utils.java:40-59 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java` and `deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×3
  • Duplicated block (19–20 lines × 2) Matting/deploy/python/infer.py:237 — Matting/deploy/python/infer.py:237-255 | contrib/MedicalSeg/deploy/python/infer.py:282-301 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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) contrib/DomainAdaptation/cvlibs/config.py:195 — contrib/DomainAdaptation/cvlibs/config.py:195-213 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:205-224 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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–20 lines × 2) contrib/LaneSeg/core/train.py:114 — contrib/LaneSeg/core/train.py:114-133 | deploy/slim/distill/distill_utils.py:138-156 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `deploy/slim/distill/distill_utils.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 240 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 (17–18 lines × 3) · ×3
  • Duplicated block (17–18 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:91 — contrib/DomainAdaptation/cvlibs/config.py:91-107 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:95-112 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:106-122 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 (17–18 lines × 3) contrib/MedicalSeg/deploy/python/infer.py:68 — contrib/MedicalSeg/deploy/python/infer.py:68-84 | deploy/python/infer_benchmark.py:63-80 | deploy/python/infer_dataset.py:77-94 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `deploy/python/infer_benchmark.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 98 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 `contrib/MedicalSeg/deploy/python/infer.py:68` 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 (17–18 lines × 3) contrib/QualityInspector/tools/uad/patchcore/predict.py:49 — contrib/QualityInspector/tools/uad/patchcore/predict.py:49-65 | contrib/QualityInspector/tools/uad/patchcore/train.py:59-76 | contrib/QualityInspector/tools/uad/patchcore/val.py:60-76 — before extracting anything, compare `contrib/QualityInspector/tools/uad/patchcore/train.py` and `contrib/QualityInspector/tools/uad/patchcore/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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 `contrib/QualityInspector/tools/uad/patchcore/predict.py:49` 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 (17 lines × 3) · ×3
  • Duplicated block (17 lines × 3) Matting/ppmatting/utils/utils.py:79 — Matting/ppmatting/utils/utils.py:79-95 | contrib/MedicalSeg/medicalseg/utils/utils.py:77-93 | paddleseg/utils/utils.py:152-168 — before extracting anything, compare `Matting/ppmatting/utils/utils.py` and `paddleseg/utils/utils.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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. 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 (17 lines × 3) Matting/tools/export.py:44 — Matting/tools/export.py:44-60 | contrib/MedicalSeg/export.py:34-50 | deploy/slim/prune/prune.py:61-77 — before extracting anything, compare `Matting/tools/export.py` and `contrib/MedicalSeg/export.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. 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 `Matting/tools/export.py:44` 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.
  • Duplicated block (17 lines × 3) contrib/PanopticSeg/tools/analyze_model.py:129 — contrib/PanopticSeg/tools/analyze_model.py:129-145 | contrib/QualityInspector/tools/seg/model/analyze_model.py:60-76 | tools/model/analyze_model.py:60-76 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/analyze_model.py` and `tools/model/analyze_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 118 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 lines × 4) · ×3
  • Duplicated block (15 lines × 4) Matting/ppmatting/models/backbone/hrnet.py:78 — Matting/ppmatting/models/backbone/hrnet.py:78-92 | contrib/AutoNUE/models/backbones/hrnet_nv.py:78-92 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:80-94 | paddleseg/models/backbones/hrnet.py:80-94 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
  • Duplicated block (15 lines × 4) contrib/AutoNUE/core/infer.py:244 — contrib/AutoNUE/core/infer.py:244-258 | contrib/AutoNUE/core/infer_crop.py:244-258 | contrib/AutoNUE/core/infer_generate_autolabel.py:244-258 | contrib/RSSegBenchmark/c2fnet/core/infer.py:245-259 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 4) paddleseg/datasets/chase_db1.py:77 — paddleseg/datasets/chase_db1.py:77-91 | paddleseg/datasets/drive.py:75-89 | paddleseg/datasets/hrf.py:74-88 | paddleseg/datasets/stare.py:74-88 — before extracting anything, compare `paddleseg/datasets/chase_db1.py` and `paddleseg/datasets/drive.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 110 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 `paddleseg/datasets/chase_db1.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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×3
  • Duplicated block (14–15 lines × 2) contrib/AutoNUE/datasets/auto_nue.py:162 — contrib/AutoNUE/datasets/auto_nue.py:162-176 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:175-188 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 142 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, `contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:190` calls `shuffle` and `contrib/AutoNUE/datasets/auto_nue.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 (14–15 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:323 — contrib/MedicalSeg/medicalseg/transforms/functional.py:323-337 | contrib/MedicalSeg/nnunet/transforms/functional.py:228-241 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 `contrib/MedicalSeg/medicalseg/transforms/functional.py:323` 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 (14–15 lines × 2) contrib/RSSegBenchmark/c2fnet/core/train.py:290 — contrib/RSSegBenchmark/c2fnet/core/train.py:290-303 | deploy/slim/distill/distill_utils.py:297-311 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/train.py` and `deploy/slim/distill/distill_utils.py` as WHOLE FILES: this scan already matched 16 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. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/RSSegBenchmark/c2fnet/core/train.py:290` 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 (13 lines × 5) · ×3
  • Duplicated block (13 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:204 — Matting/ppmatting/models/backbone/hrnet.py:204-216 | contrib/AutoNUE/models/backbones/hrnet_nv.py:209-221 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:204-216 | paddleseg/models/backbones/hrnet.py:218-230 | paddleseg/models/backbones/uhrnet.py:384-396 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 5) contrib/AutoNUE/core/val.py:63 — contrib/AutoNUE/core/val.py:63-75 | contrib/AutoNUE/core/val_crop.py:63-75 | contrib/MedicalSeg/medicalseg/core/val.py:64-76 | contrib/RSSegBenchmark/c2fnet/core/val.py:77-89 | paddleseg/core/val.py:71-83 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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, `contrib/MedicalSeg/medicalseg/core/val.py:80` calls `open`, `load` and `contrib/AutoNUE/core/val.py:77` 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 (13 lines × 5) contrib/AutoNUE/scripts/train.py:176 — contrib/AutoNUE/scripts/train.py:176-188 | contrib/CityscapesSOTA/scripts/train.py:179-191 | contrib/LaneSeg/core/train.py:219-231 | contrib/PanopticDeepLab/core/train.py:198-210 | contrib/RSSegBenchmark/c2fnet/core/train.py:258-270 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:176` 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 (12 lines × 5) · ×3
  • Duplicated block (12 lines × 5) Matting/deploy/python/infer.py:203 — Matting/deploy/python/infer.py:203-214 | contrib/MedicalSeg/deploy/python/infer.py:232-243 | contrib/PanopticSeg/deploy/python/infer.py:151-162 | deploy/python/infer.py:52-63 | deploy/python/infer_dataset.py:191-202 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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, `Matting/deploy/python/infer.py:201` calls `isinstance` and `deploy/python/infer_dataset.py:189` 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 (12 lines × 5) contrib/CityscapesSOTA/predict.py:112 — contrib/CityscapesSOTA/predict.py:112-123 | contrib/DomainAdaptation/val.py:34-45 | contrib/RSSegBenchmark/c2fnet/predict.py:131-142 | contrib/RSSegBenchmark/predict.py:124-135 | deploy/slim/quant/qat_val.py:31-42 — before extracting anything, compare `contrib/CityscapesSOTA/predict.py` and `contrib/DomainAdaptation/val.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 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 (12 lines × 5) paddleseg/models/backbones/mix_transformer.py:49 — paddleseg/models/backbones/mix_transformer.py:49-60 | paddleseg/models/backbones/mix_transformer.py:106-117 | paddleseg/models/backbones/mix_transformer.py:187-198 | paddleseg/models/backbones/mix_transformer.py:237-248 | paddleseg/models/backbones/mix_transformer.py:381-392 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) contrib/DomainAdaptation/models/gscnn.py:214 — contrib/DomainAdaptation/models/gscnn.py:214-225 | paddleseg/models/gscnn.py:277-288 | paddleseg/models/layers/pyramid_pool.py:57-68 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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 `contrib/DomainAdaptation/models/gscnn.py:214` 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 (12 lines × 3) contrib/MedicalSeg/deploy/python/infer.py:299 — contrib/MedicalSeg/deploy/python/infer.py:299-310 | contrib/PanopticSeg/deploy/python/infer.py:219-230 | deploy/python/infer.py:122-133 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `contrib/PanopticSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 141 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 `contrib/MedicalSeg/deploy/python/infer.py:299` 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 (12 lines × 3) contrib/RSSegBenchmark/c2fnet/core/predict.py:109 — contrib/RSSegBenchmark/c2fnet/core/predict.py:109-120 | paddleseg/core/analyse.py:106-117 | paddleseg/core/predict.py:103-114 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/predict.py` and `paddleseg/core/analyse.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 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 `contrib/RSSegBenchmark/c2fnet/core/predict.py:109` 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 (10–11 lines × 5) · ×3
  • Duplicated block (10–11 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:591 — Matting/ppmatting/models/backbone/hrnet.py:591-601 | contrib/AutoNUE/models/backbones/hrnet_nv.py:588-598 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:573-582 | paddleseg/models/backbones/hrnet.py:615-625 | paddleseg/models/backbones/uhrnet.py:775-784 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:591` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 5) contrib/CityscapesSOTA/export.py:109 — contrib/CityscapesSOTA/export.py:109-119 | contrib/LaneSeg/export.py:74-83 | contrib/MedicalSeg/export.py:118-127 | contrib/MedicalSeg/nnunet/export.py:92-101 | contrib/PanopticSeg/tools/export.py:71-81 — `contrib/LaneSeg/export.py` and `contrib/MedicalSeg/export.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 42 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/MedicalSeg/export.py:129` calls `get` and `contrib/MedicalSeg/nnunet/export.py:103` 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–11 lines × 5) contrib/CrossPseudoSupervision/val.py:106 — contrib/CrossPseudoSupervision/val.py:106-115 | contrib/QualityInspector/tools/seg/val.py:105-114 | contrib/RSSegBenchmark/c2fnet/val.py:29-39 | contrib/RSSegBenchmark/val.py:28-38 | tools/val.py:111-120 — before extracting anything, compare `contrib/CrossPseudoSupervision/val.py` and `contrib/QualityInspector/tools/seg/val.py` as WHOLE FILES: this scan already matched 5 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 (9–11 lines × 3) · ×3
  • Duplicated block (9–11 lines × 3) contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:78 — contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:78-88 | paddleseg/models/losses/ohem_cross_entropy_loss.py:104-114 | paddleseg/models/losses/ohem_edge_attention_loss.py:97-105 — before extracting anything, compare `contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py` and `paddleseg/models/losses/ohem_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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–11 lines × 3) contrib/MedicalSeg/tools/prepare.py:217 — contrib/MedicalSeg/tools/prepare.py:217-227 | contrib/MedicalSeg/tools/prepare_abdomen.py:131-141 | contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:125-133 — before extracting anything, compare `contrib/MedicalSeg/tools/prepare.py` and `contrib/MedicalSeg/tools/prepare_msd_brain_seg.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 `contrib/MedicalSeg/tools/prepare.py:217` 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 (9–11 lines × 3) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:190 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:190-198 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:201-209 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:220-230 — 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 `contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:190` 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 (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) contrib/QualityInspector/tools/uad/padim/val.py:86 — contrib/QualityInspector/tools/uad/padim/val.py:86-96 | contrib/QualityInspector/tools/uad/patchcore/val.py:94-103 — `contrib/QualityInspector/tools/uad/padim/val.py` and `contrib/QualityInspector/tools/uad/patchcore/val.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (10–11 lines × 2) paddleseg/models/backbones/seaformer.py:369 — paddleseg/models/backbones/seaformer.py:369-378 | paddleseg/models/backbones/strideformer.py:501-511 — 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 `paddleseg/models/backbones/seaformer.py:369` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) contrib/MedicalSeg/nnunet/transforms/functional.py:222 — contrib/MedicalSeg/nnunet/transforms/functional.py:222-232 | contrib/MedicalSeg/nnunet/transforms/functional.py:240-249 — 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 lines × 8) · ×3
  • Duplicated block (10 lines × 8) REDACTED:132 — REDACTED:132-141 | contrib/AutoNUE/scripts/train.py:90-99 | contrib/CityscapesSOTA/scripts/train.py:98-107 | contrib/LaneSeg/core/train.py:96-105 | contrib/MedicalSeg/medicalseg/core/train.py:75-84 | contrib/PanopticDeepLab/core/train.py:109-118 | contrib/PanopticSeg/paddlepanseg/core/train.py:102-111 | contrib/RSSegBenchmark/c2fnet/core/train.py:123-132 — before extracting anything, compare `REDACTED` and `contrib/AutoNUE/scripts/train.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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 × 8) contrib/AutoNUE/train.py:136 — contrib/AutoNUE/train.py:136-145 | contrib/CityscapesSOTA/train.py:136-145 | contrib/LaneSeg/train.py:179-188 | contrib/MedicalSeg/train.py:193-202 | contrib/MedicalSeg/train.py:212-221 | contrib/PanopticDeepLab/train.py:157-166 | contrib/RSSegBenchmark/c2fnet/train.py:249-258 | contrib/RSSegBenchmark/train.py:239-248 — `contrib/AutoNUE/train.py` and `contrib/CityscapesSOTA/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 185 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 8) REDACTED:508 — REDACTED:508-517 | REDACTED:522-531 | REDACTED:549-558 | REDACTED:563-572 | REDACTED:317-326 | REDACTED:331-340 | REDACTED:358-367 | REDACTED:372-381 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 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 (8–9 lines × 3) · ×3
  • Duplicated block (8–9 lines × 3) contrib/CrossPseudoSupervision/utils/utils.py:25 — contrib/CrossPseudoSupervision/utils/utils.py:25-33 | contrib/MedicalSeg/medicalseg/utils/utils.py:116-123 | paddleseg/utils/utils.py:192-199 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/utils.py` and `paddleseg/utils/utils.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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, `contrib/CrossPseudoSupervision/utils/utils.py:35` calls `join`, `load` and `contrib/MedicalSeg/medicalseg/utils/utils.py:124` 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 (8–9 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:155 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:155-163 | contrib/MedicalSeg/medicalseg/models/nnformer.py:305-313 | paddleseg/models/backbones/swin_transformer.py:140-147 — 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 (8–9 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:150 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:150-158 | paddleseg/models/backbones/hrformer.py:115-123 | paddleseg/models/backbones/swin_transformer.py:135-142 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py` and `paddleseg/models/backbones/swin_transformer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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. 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–8 lines × 2) · ×3
  • Duplicated block (6–8 lines × 2) EISeg/med3d/EISegMed3D/EISegMed3D.py:944 — EISeg/med3d/EISegMed3D/EISegMed3D.py:944-949 | EISeg/med3d/EISegMed3D/EISegMed3D.py:960-967 — 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 before the matched lines, `EISeg/med3d/EISegMed3D/EISegMed3D.py:942` calls `GetNumberOfControlPoints` and `EISeg/med3d/EISegMed3D/EISegMed3D.py:958` 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 (6–8 lines × 2) contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:426 — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:426-433 | contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:454-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.
  • Duplicated block (6–8 lines × 2) REDACTED:106 — REDACTED:106-113 | REDACTED:272-277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note 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–7 lines × 2) · ×3
  • Duplicated block (6–7 lines × 2) contrib/MedicalSeg/nnunet/datasets/dataloader.py:106 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:106-111 | contrib/MedicalSeg/nnunet/datasets/dataloader.py:309-315 — 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 (6–7 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:359 — contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:359-365 | contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:376-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:359` 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.
  • Duplicated block (6–7 lines × 2) contrib/SegmentAnything/segment_anything/utils/amg.py:339 — contrib/SegmentAnything/segment_anything/utils/amg.py:339-345 | contrib/SegmentAnything/segment_anything/utils/amg.py:348-353 — 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 (6 lines × 8) · ×3
  • Duplicated block (6 lines × 8) Matting/ppmatting/core/predict.py:85 — Matting/ppmatting/core/predict.py:85-90 | contrib/AutoNUE/core/infer.py:72-77 | contrib/AutoNUE/core/infer_crop.py:72-77 | contrib/AutoNUE/core/infer_ensemble.py:72-77 | contrib/AutoNUE/core/infer_ensemble_three.py:72-77 | contrib/AutoNUE/core/infer_generate_autolabel.py:72-77 | contrib/LaneSeg/core/infer.py:127-132 | contrib/PanopticDeepLab/core/infer.py:85-90 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 `Matting/ppmatting/core/predict.py:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 8) paddleseg/datasets/chase_db1.py:95 — paddleseg/datasets/chase_db1.py:95-100 | paddleseg/datasets/dataset.py:141-146 | paddleseg/datasets/drive.py:93-98 | paddleseg/datasets/hrf.py:92-97 | paddleseg/datasets/mini_deep_globe_road_extraction.py:92-97 | paddleseg/datasets/optic_disc_seg.py:94-99 | paddleseg/datasets/pp_humanseg14k.py:79-84 | paddleseg/datasets/stare.py:92-97 — before extracting anything, compare `paddleseg/datasets/chase_db1.py` and `paddleseg/datasets/drive.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 110 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 (6 lines × 8) contrib/AutoNUE/scripts/train.py:30 — contrib/AutoNUE/scripts/train.py:30-35 | contrib/CityscapesSOTA/scripts/train.py:28-33 | contrib/LaneSeg/core/train.py:29-34 | contrib/MedicalSeg/medicalseg/utils/loss_utils.py:17-22 | contrib/PanopticDeepLab/core/train.py:28-33 | contrib/RSSegBenchmark/c2fnet/core/train.py:29-34 | deploy/slim/distill/distill_utils.py:30-35 | paddleseg/core/train.py:36-41 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 × 4) · ×3
  • Duplicated block (6 lines × 4) contrib/AutoNUE/core/predict_ensemble.py:89 — contrib/AutoNUE/core/predict_ensemble.py:89-94 | contrib/AutoNUE/core/predict_ensemble_three.py:96-101 | contrib/AutoNUE/core/predict_generate_autolabel.py:85-90 | contrib/PanopticDeepLab/core/predict.py:105-110 — before extracting anything, compare `contrib/AutoNUE/core/predict_ensemble.py` and `contrib/AutoNUE/core/predict_ensemble_three.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 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, `contrib/PanopticDeepLab/core/predict.py:103` calls `cityscape_colormap` and `contrib/AutoNUE/core/predict_ensemble.py:87` 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 (6 lines × 4) contrib/AutoNUE/models/ocrnet_nv.py:149 — contrib/AutoNUE/models/ocrnet_nv.py:149-154 | contrib/CityscapesSOTA/models/ocrnet_nv.py:158-163 | paddleseg/models/mscale_ocrnet.py:369-374 | paddleseg/models/ocrnet.py:141-146 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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 × 4) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:143 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:143-148 | contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:154-159 | paddleseg/models/losses/binary_cross_entropy_loss.py:144-149 | paddleseg/models/losses/binary_cross_entropy_loss.py:157-162 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py` and `paddleseg/models/losses/binary_cross_entropy_loss.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
D1 · Cyclomatic Complexity · train.train (cyclomatic 43) · ×2
  • train.train (cyclomatic 43) contrib/LaneSeg/core/train.py:55 — train.train has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • train.train (cyclomatic 43) contrib/PanopticSeg/paddlepanseg/core/train.py:49 — train.train has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · train.train (cyclomatic 38) · ×2
  • train.train (cyclomatic 38) contrib/CrossPseudoSupervision/core/train.py:100 — train.train has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • train.train (cyclomatic 38) contrib/PanopticDeepLab/core/train.py:68 — train.train has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · train.train (cyclomatic 36) · ×2
  • train.train (cyclomatic 36) contrib/AutoNUE/scripts/train.py:52 — train.train has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • train.train (cyclomatic 36) contrib/CityscapesSOTA/scripts/train.py:60 — train.train has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Progbar.update (cyclomatic 32) · ×2
  • Progbar.update (cyclomatic 32) contrib/MedicalSeg/medicalseg/utils/progbar.py:68 — Progbar.update has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Progbar.update (cyclomatic 32) paddleseg/utils/progbar.py:68 — Progbar.update has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · train.main (cyclomatic 22) · ×2
  • train.main (cyclomatic 22) contrib/RSSegBenchmark/c2fnet/train.py:161 — train.main has cyclomatic complexity 22 (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.
  • train.main (cyclomatic 22) contrib/RSSegBenchmark/train.py:154 — train.main has cyclomatic complexity 22 (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 · functional.augment_contrast (cyclomatic 16) · ×2
  • functional.augment_contrast (cyclomatic 16) contrib/MedicalSeg/medicalseg/transforms/functional.py:248 — functional.augment_contrast 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.
  • functional.augment_contrast (cyclomatic 16) contrib/MedicalSeg/nnunet/transforms/functional.py:276 — functional.augment_contrast 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 · val.main (cyclomatic 16) · ×2
  • val.main (cyclomatic 16) contrib/RSSegBenchmark/c2fnet/val.py:144 — val.main has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • val.main (cyclomatic 16) contrib/RSSegBenchmark/val.py:137 — val.main has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · train.train (cognitive 97) · ×2
  • train.train (cognitive 97) contrib/AutoNUE/scripts/train.py:52 — train.train has cognitive complexity 97 (threshold 15). Drivers by points: if/else 25 (68 pts), loops 5 (19 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • train.train (cognitive 97) contrib/CityscapesSOTA/scripts/train.py:60 — train.train has cognitive complexity 97 (threshold 15). Drivers by points: if/else 25 (68 pts), loops 5 (19 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Progbar.update (cognitive 74) · ×2
  • Progbar.update (cognitive 74) contrib/MedicalSeg/medicalseg/utils/progbar.py:68 — Progbar.update has cognitive complexity 74 (threshold 15). Drivers by points: if/else 34 (64 pts), loops 3 (6 pts), boolean chains 4 (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.
  • Progbar.update (cognitive 74) paddleseg/utils/progbar.py:68 — Progbar.update has cognitive complexity 74 (threshold 15). Drivers by points: if/else 34 (64 pts), loops 3 (6 pts), boolean chains 4 (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 · functional.augment_contrast (cognitive 38) · ×2
  • functional.augment_contrast (cognitive 38) contrib/MedicalSeg/medicalseg/transforms/functional.py:248 — functional.augment_contrast has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • functional.augment_contrast (cognitive 38) contrib/MedicalSeg/nnunet/transforms/functional.py:276 — functional.augment_contrast has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · val.evaluate (cognitive 37) · ×2
  • val.evaluate (cognitive 37) contrib/RSSegBenchmark/c2fnet/core/val.py:28 — val.evaluate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 2 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • val.evaluate (cognitive 37) paddleseg/core/val.py:28 — val.evaluate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 2 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · functional.augment_linear_downsampling_scipy (cognitive 31) · ×2
  • functional.augment_linear_downsampling_scipy (cognitive 31) contrib/MedicalSeg/medicalseg/transforms/functional.py:302 — functional.augment_linear_downsampling_scipy has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (9 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • functional.augment_linear_downsampling_scipy (cognitive 31) contrib/MedicalSeg/nnunet/transforms/functional.py:208 — functional.augment_linear_downsampling_scipy has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (9 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · functional.augment_gamma (cognitive 30) · ×2
  • functional.augment_gamma (cognitive 30) contrib/MedicalSeg/medicalseg/transforms/functional.py:363 — functional.augment_gamma has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • functional.augment_gamma (cognitive 30) contrib/MedicalSeg/nnunet/transforms/functional.py:154 — functional.augment_gamma has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuseLayers.__init__ (cognitive 29) · ×2
  • FuseLayers.__init__ (cognitive 29) Matting/ppmatting/models/backbone/hrnet.py:554 — FuseLayers.__init__ has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 3 (13 pts), if/else 3 (9 pts), loops 3 (7 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FuseLayers.__init__ (cognitive 29) paddleseg/models/backbones/hrnet.py:578 — FuseLayers.__init__ has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 3 (13 pts), if/else 3 (9 pts), loops 3 (7 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.update_config_dict (cognitive 22) · ×2
  • config.update_config_dict (cognitive 22) contrib/CrossPseudoSupervision/cvlibs/config.py:201 — config.update_config_dict has cognitive complexity 22 (threshold 15). Drivers by points: error handling 2 (8 pts), if/else 6 (8 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • config.update_config_dict (cognitive 22) paddleseg/cvlibs/config.py:194 — config.update_config_dict has cognitive complexity 22 (threshold 15). Drivers by points: error handling 2 (8 pts), if/else 6 (8 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · train.main (cognitive 21) · ×2
  • train.main (cognitive 21) contrib/RSSegBenchmark/c2fnet/train.py:161 — train.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, loops 1 (2 pts), ternaries 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.
  • train.main (cognitive 21) contrib/RSSegBenchmark/train.py:154 — train.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, loops 1 (2 pts), ternaries 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 · predict.get_image_list (cognitive 18) · ×2
  • predict.get_image_list (cognitive 18) contrib/AutoNUE/predict.py:99 — predict.get_image_list has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • predict.get_image_list (cognitive 18) contrib/PanopticDeepLab/predict.py:73 — predict.get_image_list has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · functional.augment_gaussian_blur (cognitive 18) · ×2
  • functional.augment_gaussian_blur (cognitive 18) contrib/MedicalSeg/medicalseg/transforms/functional.py:189 — functional.augment_gaussian_blur has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • functional.augment_gaussian_blur (cognitive 18) contrib/MedicalSeg/nnunet/transforms/functional.py:384 — functional.augment_gaussian_blur has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuseLayers.__init__ (cognitive 17) · ×2
  • FuseLayers.__init__ (cognitive 17) contrib/AutoNUE/models/backbones/hrnet_nv.py:550 — FuseLayers.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts), ternaries 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.
  • FuseLayers.__init__ (cognitive 17) contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:537 — FuseLayers.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts), ternaries 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 · functional.augment_mirroring (cognitive 17) · ×2
  • functional.augment_mirroring (cognitive 17) contrib/MedicalSeg/medicalseg/transforms/functional.py:417 — functional.augment_mirroring has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4 (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.
  • functional.augment_mirroring (cognitive 17) contrib/MedicalSeg/nnunet/transforms/functional.py:133 — functional.augment_mirroring has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4 (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 · Predictor.run (cognitive 17) · ×2
  • Predictor.run (cognitive 17) contrib/PanopticSeg/deploy/python/infer.py:295 — Predictor.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 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.
  • Predictor.run (cognitive 17) deploy/python/infer.py:198 — Predictor.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 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.
D3 · God Classes · TooManyMethods · ×2
  • TooManyMethods: APP_EISeg REDACTED:57 — TooManyMethods — 134 methods. The bar is 30 methods; this is 104 over it, 4.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EISegMed3DWidget EISeg/med3d/EISegMed3D/EISegMed3D.py:184 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Near-duplicate member family (3 members, 28 shared lines) · ×2
  • Near-duplicate member family (3 members, 28 shared lines) contrib/AutoNUE/models/mscale_ocrnet.py:82 — contrib/AutoNUE/models/mscale_ocrnet.py:82-125 | contrib/AutoNUE/models/mscale_ocrnet.py:128-168 | contrib/CityscapesSOTA/models/mscale_ocrnet.py:47-89 — These 3 members are variants of one another: a block of 28 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 3 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 3 times.
  • Near-duplicate member family (3 members, 28 shared lines) contrib/LaneSeg/core/predict.py:47 — contrib/LaneSeg/core/predict.py:47-128 | contrib/RSSegBenchmark/c2fnet/core/predict.py:64-156 | paddleseg/core/predict.py:63-155 — These 3 members are variants of one another: a block of 28 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 3 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 3 times.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) contrib/MedicalSeg/nnunet/transforms/functional.py:35 — contrib/MedicalSeg/nnunet/transforms/functional.py:35-60 | contrib/MedicalSeg/tools/preprocess_utils/geometry.py:74-108 — 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) paddleseg/models/pfpnnet.py:178 — paddleseg/models/pfpnnet.py:178-203 | paddleseg/models/upernet_cae.py:317-348 — 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 · Edited copy of a member (64 corresponding lines) · ×2
  • Edited copy of a member (64 corresponding lines) Matting/ppmatting/core/bg_replace_video.py:136 — Matting/ppmatting/core/bg_replace_video.py:136-217 | Matting/ppmatting/core/predict_video.py:105-168 — These two members are one piece of code written twice and then edited apart: 64 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 (64 corresponding lines) contrib/MedicalSeg/nnunet/utils/base_predictor.py:63 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:63-134 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:58-121 — These two members are one piece of code written twice and then edited apart: 64 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) paddleseg/models/dnlnet.py:185 — paddleseg/models/dnlnet.py:185-220 | paddleseg/models/layers/nonlocal2d.py:122-154 — 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) EISeg/eiseg/inference/predictor/base.py:83 — EISeg/eiseg/inference/predictor/base.py:83-126 | EISeg/med3d/EISegMed3D/inference/predictor.py:150-182 — 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 (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:61 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:61-106 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:60-103 — These two members are one piece of code written twice and then edited apart: 44 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 (44 corresponding lines) contrib/DomainAdaptation/val.py:124 — contrib/DomainAdaptation/val.py:124-167 | contrib/LaneSeg/val.py:76-124 — These two members are one piece of code written twice and then edited apart: 44 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) · ×2
  • Edited copy of a member (24 corresponding lines) REDACTED:176 — REDACTED:176-200 | paddleseg/models/backbones/vit_adapter.py:133-156 — 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.
  • Edited copy of a member (24 corresponding lines) EISeg/eiseg/models.py:26 — EISeg/eiseg/models.py:26-55 | EISeg/eiseg/plugin/video/load_model.py:21-44 — 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, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) REDACTED:871 — REDACTED:871-885 | REDACTED:904-921 | REDACTED:924-941 — 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.
  • Edited copies of one member (3 members, 15+ corresponding lines) EISeg/med3d/EISegMed3D/inference/models.py:288 — EISeg/med3d/EISegMed3D/inference/models.py:288-304 | contrib/MedicalSeg/medicalseg/models/vnet.py:90-104 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:94-110 — 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 · Edited copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) contrib/QualityInspector/tools/seg/model/export_onnx.py:44 — contrib/QualityInspector/tools/seg/model/export_onnx.py:44-57 | tools/export.py:28-58 | tools/model/export_onnx.py:44-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 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, 14+ corresponding lines) EISeg/eiseg/plugin/video/load_model.py:69 — EISeg/eiseg/plugin/video/load_model.py:69-82 | EISeg/eiseg/plugin/video/load_model.py:86-99 | EISeg/eiseg/plugin/video/load_model.py:103-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 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 copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) paddleseg/models/backbones/lite_hrnet.py:64 — paddleseg/models/backbones/lite_hrnet.py:64-74 | paddleseg/models/backbones/shufflenetv2.py:32-47 | paddleseg/models/sinet.py:115-130 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 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, 11+ corresponding lines) contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:30 — contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:30-40 | contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:76-86 | contrib/PanopticSeg/paddlepanseg/models/mask2former/transformer_decoder.py:128-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 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 copies of one member (3 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) Matting/ppmatting/transforms/transforms.py:108 — Matting/ppmatting/transforms/transforms.py:108-121 | Matting/ppmatting/transforms/transforms.py:195-203 | Matting/ppmatting/transforms/transforms.py:219-227 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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, 9+ corresponding lines) contrib/MedicalSeg/medicalseg/models/backbones/transformer_utils.py:37 — contrib/MedicalSeg/medicalseg/models/backbones/transformer_utils.py:37-48 | contrib/MedicalSeg/medicalseg/models/nnformer.py:136-144 | paddleseg/models/backbones/transformer_utils.py:30-41 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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 copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) Matting/ppmatting/models/backbone/mobilenetv3.py:288 — Matting/ppmatting/models/backbone/mobilenetv3.py:288-307 | paddleseg/models/backbones/mobilenetv3.py:246-263 | paddleseg/models/backbones/strideformer.py:244-261 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 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, 18+ corresponding lines) paddleseg/models/backbones/hrformer.py:387 — paddleseg/models/backbones/hrformer.py:387-404 | paddleseg/models/backbones/pidnet.py:83-103 | paddleseg/models/ddrnet.py:260-278 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 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 copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) Matting/ppmatting/models/backbone/mobilenetv3.py:392 — Matting/ppmatting/models/backbone/mobilenetv3.py:392-407 | paddleseg/models/backbones/mobilenetv3.py:342-357 | paddleseg/models/backbones/strideformer.py:328-343 — 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) paddleseg/models/backbones/mix_transformer.py:165 — paddleseg/models/backbones/mix_transformer.py:165-183 | paddleseg/models/backbones/seaformer.py:408-427 | REDACTED:104-119 — 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 · Duplicated block (57 lines × 2) · ×2
  • Duplicated block (57 lines × 2) contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:63 — contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:63-119 | tools/data/gray2pseudo_color.py:63-119 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/gray2pseudo_color.py` and `tools/data/gray2pseudo_color.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 103 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 (57 lines × 2) contrib/QualityInspector/tools/seg/model/plot_model_performance.py:281 — contrib/QualityInspector/tools/seg/model/plot_model_performance.py:281-337 | tools/model/plot_model_performance.py:281-337 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/plot_model_performance.py` and `tools/model/plot_model_performance.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 330 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 (50 lines × 2) · ×2
  • Duplicated block (50 lines × 2) contrib/MedicalSeg/medicalseg/core/train.py:182 — contrib/MedicalSeg/medicalseg/core/train.py:182-231 | contrib/MedicalSeg/nnunet/core/train.py:162-211 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/core/train.py` and `contrib/MedicalSeg/nnunet/core/train.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 `contrib/MedicalSeg/medicalseg/core/train.py:182` 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 (50 lines × 2) contrib/MedicalSeg/test.py:29 — contrib/MedicalSeg/test.py:29-78 | contrib/MedicalSeg/val.py:29-78 — before extracting anything, compare `contrib/MedicalSeg/test.py` and `contrib/MedicalSeg/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 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 (45 lines × 2) · ×2
  • Duplicated block (45 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:255 — contrib/MedicalSeg/medicalseg/transforms/functional.py:255-299 | contrib/MedicalSeg/nnunet/transforms/functional.py:283-327 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (45 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:35 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:35-79 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/SettingsActivity.java:35-79 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/SettingsActivity.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 111 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (41–42 lines × 2) · ×2
  • Duplicated block (41–42 lines × 2) contrib/PanopticSeg/deploy/python/infer.py:307 — contrib/PanopticSeg/deploy/python/infer.py:307-348 | deploy/python/infer.py:210-250 — before extracting anything, compare `contrib/PanopticSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (41–42 lines × 2) contrib/PanopticSeg/deploy/python/infer.py:134 — contrib/PanopticSeg/deploy/python/infer.py:134-174 | deploy/python/infer.py:34-75 — before extracting anything, compare `contrib/PanopticSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (40 lines × 2) · ×2
  • Duplicated block (40 lines × 2) paddleseg/datasets/eg1800.py:104 — paddleseg/datasets/eg1800.py:104-143 | paddleseg/datasets/supervisely.py:103-142 — before extracting anything, compare `paddleseg/datasets/eg1800.py` and `paddleseg/datasets/supervisely.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 95 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 (40 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:82 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:82-121 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/SettingsActivity.java:82-121 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/SettingsActivity.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 111 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 (36–39 lines × 2) · ×2
  • Duplicated block (36–39 lines × 2) EISeg/eiseg/inference/predictor/base.py:235 — EISeg/eiseg/inference/predictor/base.py:235-273 | EISeg/med3d/EISegMed3D/inference/models.py:185-220 — 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 (36–39 lines × 2) contrib/MedicalSeg/deploy/python/infer.py:98 — contrib/MedicalSeg/deploy/python/infer.py:98-136 | deploy/python/infer.py:328-363 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 297 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 `contrib/MedicalSeg/deploy/python/infer.py:98` 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 (39 lines × 2) · ×2
  • Duplicated block (39 lines × 2) contrib/QualityInspector/tools/dataset/visualize_annotation.py:94 — contrib/QualityInspector/tools/dataset/visualize_annotation.py:94-132 | tools/data/visualize_annotation.py:84-122 — before extracting anything, compare `contrib/QualityInspector/tools/dataset/visualize_annotation.py` and `tools/data/visualize_annotation.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 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 (39 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java:39 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java:39-77 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/preprocess/Preprocess.java:39-77 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/preprocess/Preprocess.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/preprocess/Preprocess.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (30 lines × 3) · ×2
  • Duplicated block (30 lines × 3) contrib/AutoNUE/core/predict_ensemble.py:122 — contrib/AutoNUE/core/predict_ensemble.py:122-151 | contrib/AutoNUE/core/predict_ensemble_three.py:184-213 | contrib/AutoNUE/core/predict_generate_autolabel.py:116-145 — before extracting anything, compare `contrib/AutoNUE/core/predict_ensemble.py` and `contrib/AutoNUE/core/predict_ensemble_three.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 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 (30 lines × 3) contrib/AutoNUE/core/val.py:39 — contrib/AutoNUE/core/val.py:39-68 | contrib/AutoNUE/core/val_crop.py:39-68 | paddleseg/core/val.py:43-76 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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 `contrib/AutoNUE/core/val.py:39` 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 (25–26 lines × 2) · ×2
  • Duplicated block (25–26 lines × 2) REDACTED:2063 — REDACTED:2063-2088 | REDACTED:3352-3376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note 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 (25–26 lines × 2) contrib/MedicalSeg/nnunet/single_fold_eval.py:280 — contrib/MedicalSeg/nnunet/single_fold_eval.py:280-305 | contrib/PanopticDeepLab/val.py:70-94 — 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 (24 lines × 4) · ×2
  • Duplicated block (24 lines × 4) contrib/AutoNUE/core/infer.py:113 — contrib/AutoNUE/core/infer.py:113-136 | contrib/AutoNUE/core/infer_crop.py:113-136 | contrib/AutoNUE/core/infer_generate_autolabel.py:113-136 | contrib/RSSegBenchmark/c2fnet/core/infer.py:82-105 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 (24 lines × 4) paddleseg/models/backbones/swin_transformer.py:719 — paddleseg/models/backbones/swin_transformer.py:719-742 | paddleseg/models/backbones/swin_transformer.py:778-801 | paddleseg/models/backbones/swin_transformer.py:850-873 | paddleseg/models/backbones/swin_transformer.py:922-945 — 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 (21–23 lines × 2) · ×2
  • Duplicated block (21–23 lines × 2) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:136 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:136-158 | paddleseg/models/backbones/swin_transformer.py:122-142 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py` and `paddleseg/models/backbones/swin_transformer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 180 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 (21–23 lines × 2) deploy/python/infer_onnx_trt.py:209 — deploy/python/infer_onnx_trt.py:209-229 | deploy/python/infer_onnx_trt.py:275-297 — 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 (22 lines × 3) · ×2
  • Duplicated block (22 lines × 3) contrib/AutoNUE/scripts/train.py:111 — contrib/AutoNUE/scripts/train.py:111-132 | contrib/CityscapesSOTA/scripts/train.py:115-136 | contrib/PanopticDeepLab/core/train.py:130-151 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 × 3) contrib/MedicalSeg/nnunet/transforms/functional.py:39 — contrib/MedicalSeg/nnunet/transforms/functional.py:39-60 | contrib/MedicalSeg/tools/preprocess_utils/geometry.py:87-108 | contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:32-53 — 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.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×2
  • Duplicated block (21 lines × 4) contrib/AutoNUE/predict.py:129 — contrib/AutoNUE/predict.py:129-149 | contrib/CityscapesSOTA/predict.py:132-152 | contrib/LaneSeg/predict.py:72-92 | contrib/PanopticDeepLab/predict.py:103-123 — `contrib/AutoNUE/predict.py` and `contrib/CityscapesSOTA/predict.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (21 lines × 4) paddleseg/datasets/chase_db1.py:50 — paddleseg/datasets/chase_db1.py:50-70 | paddleseg/datasets/drive.py:48-68 | paddleseg/datasets/hrf.py:47-67 | paddleseg/datasets/stare.py:47-67 — before extracting anything, compare `paddleseg/datasets/chase_db1.py` and `paddleseg/datasets/drive.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 110 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 `paddleseg/datasets/chase_db1.py:50` 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 (20 lines × 4) · ×2
  • Duplicated block (20 lines × 4) Matting/ppmatting/models/backbone/hrnet.py:436 — Matting/ppmatting/models/backbone/hrnet.py:436-455 | contrib/AutoNUE/models/backbones/hrnet_nv.py:437-456 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:425-444 | paddleseg/models/backbones/hrnet.py:456-475 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 (20 lines × 4) Matting/tools/bg_replace.py:71 — Matting/tools/bg_replace.py:71-90 | Matting/tools/bg_replace_video.py:58-77 | Matting/tools/predict.py:59-78 | Matting/tools/predict_video.py:51-70 — before extracting anything, compare `Matting/tools/bg_replace_video.py` and `Matting/tools/predict.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 (19–20 lines × 4) · ×2
  • Duplicated block (19–20 lines × 4) Matting/ppmatting/utils/utils.py:114 — Matting/ppmatting/utils/utils.py:114-132 | contrib/MedicalSeg/medicalseg/utils/utils.py:94-112 | contrib/RSSegBenchmark/backbones/resnet.py:286-304 | paddleseg/utils/utils.py:169-188 — before extracting anything, compare `Matting/ppmatting/utils/utils.py` and `paddleseg/utils/utils.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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 × 4) contrib/QualityInspector/tools/seg/model/plot_model_performance.py:33 — contrib/QualityInspector/tools/seg/model/plot_model_performance.py:33-52 | contrib/QualityInspector/tools/seg/model/plot_model_performance.py:237-255 | tools/model/plot_model_performance.py:33-52 | tools/model/plot_model_performance.py:237-255 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/plot_model_performance.py` and `tools/model/plot_model_performance.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 330 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, `contrib/QualityInspector/tools/seg/model/plot_model_performance.py:54` calls `Time` and `contrib/QualityInspector/tools/seg/model/plot_model_performance.py:256` 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–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) Matting/deploy/python/infer.py:495 — Matting/deploy/python/infer.py:495-513 | Matting/deploy/python/infer.py:683-700 — 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) contrib/MedicalSeg/medicalseg/transforms/functional.py:342 — contrib/MedicalSeg/medicalseg/transforms/functional.py:342-360 | contrib/MedicalSeg/nnunet/transforms/functional.py:246-263 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (17 lines × 4) · ×2
  • Duplicated block (17 lines × 4) Matting/deploy/python/infer.py:294 — Matting/deploy/python/infer.py:294-310 | contrib/MedicalSeg/deploy/python/infer.py:340-356 | contrib/PanopticSeg/deploy/python/infer.py:259-275 | deploy/python/infer.py:162-178 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 `Matting/deploy/python/infer.py:294` 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 (17 lines × 4) contrib/RSSegBenchmark/c2fnet/predict.py:151 — contrib/RSSegBenchmark/c2fnet/predict.py:151-167 | contrib/RSSegBenchmark/c2fnet/val.py:145-161 | contrib/RSSegBenchmark/predict.py:144-160 | contrib/RSSegBenchmark/val.py:138-154 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/predict.py` and `contrib/RSSegBenchmark/c2fnet/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 91 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, `contrib/RSSegBenchmark/c2fnet/predict.py:170` calls `check_sync_info` and `contrib/RSSegBenchmark/predict.py:164` 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 (15–16 lines × 5) · ×2
  • Duplicated block (15–16 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:482 — Matting/ppmatting/models/backbone/hrnet.py:482-496 | contrib/AutoNUE/models/backbones/hrnet_nv.py:481-496 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:470-484 | paddleseg/models/backbones/hrnet.py:503-517 | paddleseg/models/backbones/uhrnet.py:672-686 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:482` 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 (15–16 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:561 — Matting/ppmatting/models/backbone/hrnet.py:561-575 | contrib/AutoNUE/models/backbones/hrnet_nv.py:556-571 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:543-557 | paddleseg/models/backbones/hrnet.py:585-599 | paddleseg/models/backbones/uhrnet.py:745-759 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:561` 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 (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) contrib/MedicalSeg/nnunet/single_fold_eval.py:205 — contrib/MedicalSeg/nnunet/single_fold_eval.py:205-220 | contrib/MedicalSeg/test.py:26-41 | contrib/MedicalSeg/val.py:26-41 — before extracting anything, compare `contrib/MedicalSeg/test.py` and `contrib/MedicalSeg/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 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 `contrib/MedicalSeg/nnunet/single_fold_eval.py:205` 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 (16 lines × 3) contrib/QualityInspector/qinspector/uad/utils/utils.py:335 — contrib/QualityInspector/qinspector/uad/utils/utils.py:335-350 | contrib/QualityInspector/tools/uad/padim/predict.py:194-209 | contrib/QualityInspector/tools/uad/padim/val.py:292-307 — 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 (14–16 lines × 2) · ×2
  • Duplicated block (14–16 lines × 2) contrib/MedicalSeg/medicalseg/models/nnformer.py:867 — contrib/MedicalSeg/medicalseg/models/nnformer.py:867-882 | contrib/MedicalSeg/medicalseg/models/nnformer.py:949-962 — 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–16 lines × 2) paddleseg/models/backbones/seaformer.py:104 — paddleseg/models/backbones/seaformer.py:104-117 | paddleseg/models/backbones/strideformer.py:131-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×2
  • Duplicated block (13–16 lines × 2) paddleseg/models/backbones/efficientformerv2.py:294 — paddleseg/models/backbones/efficientformerv2.py:294-306 | paddleseg/models/backbones/efficientformerv2.py:463-478 — 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 `paddleseg/models/backbones/efficientformerv2.py:294` 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 (13–16 lines × 2) paddleseg/models/mscale_ocrnet.py:104 — paddleseg/models/mscale_ocrnet.py:104-116 | paddleseg/models/mscale_ocrnet.py:133-148 — 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 (13–14 lines × 6) · ×2
  • Duplicated block (13–14 lines × 6) contrib/LaneSeg/datasets/tusimple.py:104 — contrib/LaneSeg/datasets/tusimple.py:104-117 | paddleseg/datasets/chase_db1.py:85-97 | paddleseg/datasets/drive.py:83-95 | paddleseg/datasets/hrf.py:82-94 | paddleseg/datasets/optic_disc_seg.py:84-96 | paddleseg/datasets/stare.py:82-94 — before extracting anything, compare `paddleseg/datasets/chase_db1.py` and `paddleseg/datasets/drive.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 110 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, `paddleseg/datasets/optic_disc_seg.py:82` calls `join` and `paddleseg/datasets/chase_db1.py:84` 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–14 lines × 6) paddleseg/datasets/chase_db1.py:60 — paddleseg/datasets/chase_db1.py:60-73 | paddleseg/datasets/drive.py:58-71 | paddleseg/datasets/hrf.py:57-70 | paddleseg/datasets/mini_deep_globe_road_extraction.py:58-70 | paddleseg/datasets/optic_disc_seg.py:57-70 | paddleseg/datasets/stare.py:57-70 — before extracting anything, compare `paddleseg/datasets/chase_db1.py` and `paddleseg/datasets/drive.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 110 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 × 3) · ×2
  • Duplicated block (13–14 lines × 3) EISeg/eiseg/inference/predictor/base.py:83 — EISeg/eiseg/inference/predictor/base.py:83-96 | EISeg/med3d/EISegMed3D/inference/predictor.py:126-138 | EISeg/med3d/EISegMed3D/inference/predictor.py:150-162 — 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–14 lines × 3) paddleseg/models/u2net.py:330 — paddleseg/models/u2net.py:330-342 | paddleseg/models/u2net.py:404-417 | paddleseg/models/u2net.py:469-482 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×2
  • Duplicated block (12–14 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:288 — EISeg/med3d/EISegMed3D/inference/models.py:288-301 | contrib/MedicalSeg/medicalseg/models/vnet.py:90-101 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:94-107 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 (12–14 lines × 3) paddleseg/models/pointrend.py:330 — paddleseg/models/pointrend.py:330-341 | paddleseg/models/pointrend.py:627-638 | paddleseg/models/seaformer_seg.py:95-108 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×2
  • Duplicated block (13 lines × 4) contrib/CrossPseudoSupervision/predict.py:103 — contrib/CrossPseudoSupervision/predict.py:103-115 | contrib/QualityInspector/tools/seg/predict.py:101-113 | tools/analyse.py:114-126 | tools/predict.py:115-127 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 (13 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:238 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:238-250 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:531-543 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:224-236 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:505-517 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 `contrib/MedicalSeg/nnunet/utils/base_predictor.py:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) contrib/MedicalSeg/tools/prepare.py:216 — contrib/MedicalSeg/tools/prepare.py:216-228 | contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:124-134 — before extracting anything, compare `contrib/MedicalSeg/tools/prepare.py` and `contrib/MedicalSeg/tools/prepare_msd_brain_seg.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 (11–13 lines × 2) deploy/python/infer_onnx_trt.py:188 — deploy/python/infer_onnx_trt.py:188-200 | deploy/python/infer_onnx_trt.py:263-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.
D4 · Code Duplication · Duplicated block (11–12 lines × 7) · ×2
  • Duplicated block (11–12 lines × 7) contrib/AutoNUE/scripts/train.py:180 — contrib/AutoNUE/scripts/train.py:180-190 | contrib/CityscapesSOTA/scripts/train.py:183-193 | contrib/LaneSeg/core/train.py:223-233 | contrib/PanopticDeepLab/core/train.py:202-212 | contrib/PanopticSeg/paddlepanseg/core/train.py:193-203 | contrib/RSSegBenchmark/c2fnet/core/train.py:262-272 | deploy/slim/distill/distill_utils.py:263-274 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:180` 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, `contrib/PanopticSeg/paddlepanseg/core/train.py:192` calls `get_lr` and `contrib/AutoNUE/scripts/train.py:179` 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.
  • Duplicated block (11–12 lines × 7) contrib/AutoNUE/scripts/train.py:236 — contrib/AutoNUE/scripts/train.py:236-246 | contrib/CityscapesSOTA/scripts/train.py:240-250 | contrib/CrossPseudoSupervision/core/train.py:359-369 | contrib/DomainAdaptation/script/train.py:499-510 | contrib/LaneSeg/core/train.py:279-289 | contrib/RSSegBenchmark/c2fnet/core/train.py:320-330 | deploy/slim/distill/distill_utils.py:324-334 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 × 3) · ×2
  • Duplicated block (11–12 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:110 — contrib/DomainAdaptation/cvlibs/config.py:110-120 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:115-126 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:125-135 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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–12 lines × 3) contrib/MedicalSeg/medicalseg/core/val.py:84 — contrib/MedicalSeg/medicalseg/core/val.py:84-94 | contrib/RSSegBenchmark/c2fnet/core/val.py:95-106 | paddleseg/core/val.py:89-100 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/core/val.py` and `contrib/RSSegBenchmark/c2fnet/core/val.py` as WHOLE FILES: this scan already matched 5 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. 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 × 6) · ×2
  • Duplicated block (11 lines × 6) contrib/AutoNUE/core/val.py:150 — contrib/AutoNUE/core/val.py:150-160 | contrib/AutoNUE/core/val_crop.py:166-176 | contrib/LaneSeg/core/val.py:96-106 | contrib/MedicalSeg/medicalseg/core/val.py:178-188 | contrib/RSSegBenchmark/c2fnet/core/val.py:214-224 | paddleseg/core/val.py:211-221 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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 (11 lines × 6) paddleseg/models/backbones/mix_transformer.py:491 — paddleseg/models/backbones/mix_transformer.py:491-501 | paddleseg/models/backbones/mix_transformer.py:506-516 | paddleseg/models/backbones/mix_transformer.py:521-531 | paddleseg/models/backbones/mix_transformer.py:536-546 | paddleseg/models/backbones/mix_transformer.py:551-561 | paddleseg/models/backbones/mix_transformer.py:566-576 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×2
  • Duplicated block (11 lines × 5) paddleseg/datasets/chase_db1.py:75 — paddleseg/datasets/chase_db1.py:75-85 | paddleseg/datasets/drive.py:73-83 | paddleseg/datasets/hrf.py:72-82 | paddleseg/datasets/optic_disc_seg.py:72-82 | paddleseg/datasets/stare.py:72-82 — before extracting anything, compare `paddleseg/datasets/chase_db1.py` and `paddleseg/datasets/drive.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 110 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 `paddleseg/datasets/chase_db1.py:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `paddleseg/datasets/optic_disc_seg.py:84` calls `join` and `paddleseg/datasets/chase_db1.py:87` 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 × 5) Matting/deploy/python/infer.py:281 — Matting/deploy/python/infer.py:281-291 | contrib/LaneSeg/deploy/python/infer.py:92-102 | contrib/MedicalSeg/deploy/python/infer.py:327-337 | contrib/PanopticSeg/deploy/python/infer.py:246-256 | deploy/python/infer.py:149-159 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 × 4) · ×2
  • Duplicated block (10–11 lines × 4) contrib/DomainAdaptation/models/deeplabv2.py:106 — contrib/DomainAdaptation/models/deeplabv2.py:106-115 | contrib/MedicalSeg/medicalseg/utils/utils.py:91-100 | contrib/RSSegBenchmark/backbones/resnet.py:282-292 | paddleseg/utils/utils.py:166-175 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/utils.py` and `paddleseg/utils/utils.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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–11 lines × 4) contrib/LaneSeg/core/train.py:267 — contrib/LaneSeg/core/train.py:267-276 | contrib/RSSegBenchmark/c2fnet/core/train.py:308-317 | deploy/slim/distill/distill_utils.py:311-321 | paddleseg/core/train.py:355-364 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 284 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 `contrib/LaneSeg/core/train.py:267` 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 (10–11 lines × 3) · ×2
  • Duplicated block (10–11 lines × 3) contrib/AutoNUE/models/ocrnet_nv.py:247 — contrib/AutoNUE/models/ocrnet_nv.py:247-256 | contrib/CityscapesSOTA/models/ocrnet_nv.py:256-265 | paddleseg/models/ocrnet.py:233-243 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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 `paddleseg/models/ocrnet.py:233` 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 (10–11 lines × 3) contrib/DomainAdaptation/script/val.py:62 — contrib/DomainAdaptation/script/val.py:62-72 | contrib/DomainAdaptation/script/val.py:78-88 | contrib/DomainAdaptation/script/val.py:120-129 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) EISeg/eiseg/inference/predictor/base.py:148 — EISeg/eiseg/inference/predictor/base.py:148-156 | EISeg/med3d/EISegMed3D/inference/predictor.py:205-215 — 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 (9–11 lines × 2) tools/data/convert_multilabel.py:83 — tools/data/convert_multilabel.py:83-93 | tools/data/convert_multilabel.py:138-146 — 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 lines × 7) · ×2
  • Duplicated block (10 lines × 7) contrib/DomainAdaptation/train.py:184 — contrib/DomainAdaptation/train.py:184-193 | contrib/LaneSeg/train.py:177-187 | contrib/MedicalSeg/train.py:191-201 | contrib/MedicalSeg/train.py:210-220 | contrib/PanopticDeepLab/train.py:155-165 | contrib/RSSegBenchmark/c2fnet/train.py:247-257 | contrib/RSSegBenchmark/train.py:237-247 — `contrib/DomainAdaptation/train.py` and `contrib/LaneSeg/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 159 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 7) paddleseg/datasets/chase_db1.py:90 — paddleseg/datasets/chase_db1.py:90-99 | paddleseg/datasets/drive.py:88-97 | paddleseg/datasets/hrf.py:87-96 | paddleseg/datasets/mini_deep_globe_road_extraction.py:87-96 | paddleseg/datasets/optic_disc_seg.py:89-98 | paddleseg/datasets/pp_humanseg14k.py:74-83 | paddleseg/datasets/stare.py:87-96 — before extracting anything, compare `paddleseg/datasets/chase_db1.py` and `paddleseg/datasets/drive.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 110 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 × 6) · ×2
  • Duplicated block (10 lines × 6) contrib/QualityInspector/tools/uad/padim/train.py:49 — contrib/QualityInspector/tools/uad/padim/train.py:49-58 | contrib/QualityInspector/tools/uad/padim/val.py:57-66 | contrib/QualityInspector/tools/uad/patchcore/train.py:47-56 | contrib/QualityInspector/tools/uad/patchcore/val.py:47-56 | contrib/QualityInspector/tools/uad/stfpm/train.py:42-51 | contrib/QualityInspector/tools/uad/stfpm/val.py:40-49 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/train.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 4 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. 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, `contrib/QualityInspector/tools/uad/patchcore/val.py:59` calls `add_argument` and `contrib/QualityInspector/tools/uad/patchcore/train.py:59` 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 (10 lines × 6) contrib/AutoNUE/core/infer.py:66 — contrib/AutoNUE/core/infer.py:66-75 | contrib/AutoNUE/core/infer_crop.py:66-75 | contrib/AutoNUE/core/infer_ensemble.py:66-75 | contrib/AutoNUE/core/infer_ensemble_three.py:66-75 | contrib/AutoNUE/core/infer_generate_autolabel.py:66-75 | contrib/PanopticDeepLab/core/infer.py:79-88 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 (7–10 lines × 2) · ×2
  • Duplicated block (7–10 lines × 2) contrib/AutoNUE/models/mscale_ocrnet.py:257 — contrib/AutoNUE/models/mscale_ocrnet.py:257-266 | contrib/CityscapesSOTA/models/mscale_ocrnet.py:175-181 — before extracting anything, compare `contrib/AutoNUE/models/mscale_ocrnet.py` and `contrib/CityscapesSOTA/models/mscale_ocrnet.py` as WHOLE FILES: this scan already matched 5 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 `contrib/AutoNUE/models/mscale_ocrnet.py:257` 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 (7–10 lines × 2) paddleseg/models/pfpnnet.py:116 — paddleseg/models/pfpnnet.py:116-122 | paddleseg/models/pointrend.py:674-683 — 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. 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 (8–9 lines × 7) · ×2
  • Duplicated block (8–9 lines × 7) contrib/AutoNUE/datasets/auto_nue.py:83 — contrib/AutoNUE/datasets/auto_nue.py:83-91 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:83-91 | contrib/AutoNUE/datasets/auto_nue_crop.py:83-91 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:102-110 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:145-152 | paddleseg/datasets/cityscapes.py:73-81 | paddleseg/datasets/cocostuff.py:69-76 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/AutoNUE/datasets/auto_nue_autolabel.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 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 `contrib/AutoNUE/datasets/auto_nue.py:83` 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 (8–9 lines × 7) contrib/AutoNUE/scripts/train.py:170 — contrib/AutoNUE/scripts/train.py:170-177 | contrib/CityscapesSOTA/scripts/train.py:173-180 | contrib/CrossPseudoSupervision/core/train.py:288-295 | contrib/LaneSeg/core/train.py:213-220 | contrib/PanopticDeepLab/core/train.py:192-199 | contrib/PanopticSeg/paddlepanseg/core/train.py:181-189 | deploy/slim/distill/distill_utils.py:250-257 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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, `contrib/PanopticSeg/paddlepanseg/core/train.py:192` calls `get_lr` and `contrib/AutoNUE/scripts/train.py:180` 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 lines × 5) · ×2
  • Duplicated block (8 lines × 5) contrib/AutoNUE/core/val.py:82 — contrib/AutoNUE/core/val.py:82-89 | contrib/AutoNUE/core/val_crop.py:82-89 | contrib/LaneSeg/core/val.py:68-75 | contrib/PanopticDeepLab/core/val.py:83-90 | contrib/PanopticSeg/paddlepanseg/core/val.py:109-116 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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 (8 lines × 5) paddleseg/models/rtformer.py:141 — paddleseg/models/rtformer.py:141-148 | paddleseg/models/rtformer.py:304-311 | paddleseg/models/rtformer.py:367-374 | paddleseg/models/rtformer.py:519-526 | paddleseg/models/rtformer.py:532-539 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:263 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:263-270 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:552-559 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:249-256 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:526-533 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 `contrib/MedicalSeg/nnunet/utils/base_predictor.py:263` 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 × 4) paddleseg/datasets/optic_disc_seg.py:47 — paddleseg/datasets/optic_disc_seg.py:47-54 | paddleseg/datasets/pascal_context.py:45-52 | paddleseg/datasets/pp_humanseg14k.py:47-54 | paddleseg/datasets/voc.py:44-51 — before extracting anything, compare `paddleseg/datasets/optic_disc_seg.py` and `paddleseg/datasets/pp_humanseg14k.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) contrib/MedicalSeg/nnunet/utils/postprocessing.py:208 — contrib/MedicalSeg/nnunet/utils/postprocessing.py:208-215 | contrib/MedicalSeg/nnunet/utils/postprocessing.py:314-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.
  • Duplicated block (7–8 lines × 2) contrib/QualityInspector/tools/uad/padim/predict.py:99 — contrib/QualityInspector/tools/uad/padim/predict.py:99-106 | contrib/QualityInspector/tools/uad/padim/val.py:148-154 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/predict.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 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, `contrib/QualityInspector/tools/uad/padim/val.py:155` calls `now`, `strftime` and `contrib/QualityInspector/tools/uad/padim/predict.py:107` 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 × 8) · ×2
  • Duplicated block (7 lines × 8) contrib/AutoNUE/datasets/auto_nue.py:82 — contrib/AutoNUE/datasets/auto_nue.py:82-88 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:82-88 | contrib/AutoNUE/datasets/auto_nue_crop.py:82-88 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:101-107 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:143-150 | contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py:93-99 | paddleseg/datasets/cityscapes.py:72-78 | paddleseg/datasets/cocostuff.py:68-74 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/AutoNUE/datasets/auto_nue_autolabel.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 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 (7 lines × 8) contrib/AutoNUE/scripts/train.py:173 — contrib/AutoNUE/scripts/train.py:173-179 | contrib/CityscapesSOTA/scripts/train.py:176-182 | contrib/LaneSeg/core/train.py:216-222 | contrib/MedicalSeg/medicalseg/core/train.py:174-181 | contrib/PanopticDeepLab/core/train.py:195-201 | contrib/PanopticSeg/paddlepanseg/core/train.py:184-191 | contrib/RSSegBenchmark/c2fnet/core/train.py:255-261 | deploy/slim/distill/distill_utils.py:253-259 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/PanopticSeg/paddlepanseg/core/train.py:192` calls `get_lr` and `contrib/AutoNUE/scripts/train.py:180` 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 (7 lines × 6) · ×2
  • Duplicated block (7 lines × 6) Matting/ppmatting/utils/utils.py:52 — Matting/ppmatting/utils/utils.py:52-58 | contrib/AutoNUE/predict.py:109-115 | contrib/AutoNUE/predict_ensemble.py:121-127 | contrib/AutoNUE/predict_ensemble_three.py:133-139 | contrib/AutoNUE/tools/IDD_labeling.py:25-31 | contrib/PanopticDeepLab/predict.py:83-89 — before extracting anything, compare `contrib/AutoNUE/predict.py` and `contrib/AutoNUE/predict_ensemble.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 188 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 `Matting/ppmatting/utils/utils.py:52` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Matting/ppmatting/utils/utils.py:60` calls `sort` and `contrib/AutoNUE/predict.py:117` 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 (7 lines × 6) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:51 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:51-57 | contrib/MedicalSeg/medicalseg/models/nnformer.py:112-118 | REDACTED:38-44 | paddleseg/models/backbones/swin_transformer.py:34-40 | REDACTED:36-42 | paddleseg/models/backbones/vit_adapter.py:67-73 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:300 — Matting/ppmatting/models/backbone/hrnet.py:300-306 | contrib/AutoNUE/models/backbones/hrnet_nv.py:302-308 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:296-302 | paddleseg/models/backbones/hrnet.py:316-322 | paddleseg/models/backbones/uhrnet.py:497-503 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 (7 lines × 5) Matting/ppmatting/models/ppmattingv2.py:434 — Matting/ppmatting/models/ppmattingv2.py:434-440 | paddleseg/models/backbones/mscan.py:59-65 | paddleseg/models/backbones/seaformer.py:181-187 | paddleseg/models/backbones/strideformer.py:554-560 | paddleseg/models/backbones/top_transformer.py:154-160 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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. 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.
D1 · Cyclomatic Complexity · train.train (cyclomatic 79) · ×1
  • train.train (cyclomatic 79) paddleseg/core/train.py:66 — train.train has cyclomatic complexity 79 (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 (cyclomatic 52) · ×1
  • train.train (cyclomatic 52) REDACTED:85 — train.train has cyclomatic complexity 52 (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 (cyclomatic 48) · ×1
  • train.train (cyclomatic 48) contrib/RSSegBenchmark/c2fnet/core/train.py:69 — train.train has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Trainer.train (cyclomatic 46) · ×1
  • Trainer.train (cyclomatic 46) contrib/DomainAdaptation/script/train.py:60 — Trainer.train has cyclomatic complexity 46 (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 · APP_EISeg.exportLabel (cyclomatic 43) · ×1
  • APP_EISeg.exportLabel (cyclomatic 43) REDACTED:1877 — APP_EISeg.exportLabel has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · distill_utils.distill_train (cyclomatic 43) · ×1
  • distill_utils.distill_train (cyclomatic 43) deploy/slim/distill/distill_utils.py:73 — distill_utils.distill_train has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · postprocessing.determine_postprocessing (cyclomatic 40) · ×1
  • postprocessing.determine_postprocessing (cyclomatic 40) contrib/MedicalSeg/nnunet/utils/postprocessing.py:101 — postprocessing.determine_postprocessing 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 · APP_EISeg.loadImage (cyclomatic 37) · ×1
  • APP_EISeg.loadImage (cyclomatic 37) REDACTED:1468 — APP_EISeg.loadImage has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · train.train (cyclomatic 37) · ×1
  • train.train (cyclomatic 37) contrib/MedicalSeg/medicalseg/core/train.py:30 — train.train has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · transforms.to_pil_image (cyclomatic 37) · ×1
  • transforms.to_pil_image (cyclomatic 37) contrib/SegmentAnything/segment_anything/utils/transforms.py:28 — transforms.to_pil_image has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · functional.augment_spatial (cyclomatic 32) · ×1
  • functional.augment_spatial (cyclomatic 32) contrib/MedicalSeg/nnunet/transforms/functional.py:667 — functional.augment_spatial has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · train.train (cyclomatic 31) · ×1
  • train.train (cyclomatic 31) contrib/MedicalSeg/nnunet/core/train.py:30 — train.train has cyclomatic complexity 31 (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 · ResNet_vd.__init__ (cyclomatic 31) · ×1
  • ResNet_vd.__init__ (cyclomatic 31) paddleseg/models/backbones/resnet_vd.py:214 — ResNet_vd.__init__ has cyclomatic complexity 31 (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 · augmentation.get_moreDA_augmentation (cyclomatic 29) · ×1
  • augmentation.get_moreDA_augmentation (cyclomatic 29) contrib/MedicalSeg/nnunet/transforms/augmentation.py:25 — augmentation.get_moreDA_augmentation has cyclomatic complexity 29 (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 · ResNet_vd.__init__ (cyclomatic 28) · ×1
  • ResNet_vd.__init__ (cyclomatic 28) Matting/ppmatting/models/backbone/resnet_vd.py:194 — ResNet_vd.__init__ 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 · Generic_UNet.__init__ (cyclomatic 27) · ×1
  • Generic_UNet.__init__ (cyclomatic 27) contrib/MedicalSeg/medicalseg/models/nnunet.py:265 — Generic_UNet.__init__ 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 · Predictor.run (cyclomatic 26) · ×1
  • Predictor.run (cyclomatic 26) Matting/deploy/python/infer.py:330 — Predictor.run 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 · Attention.forward (cyclomatic 26) · ×1
  • Attention.forward (cyclomatic 26) paddleseg/models/backbones/hrformer.py:126 — Attention.forward 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 · utils.save_segmentation_nifti_from_softmax (cyclomatic 23) · ×1
  • utils.save_segmentation_nifti_from_softmax (cyclomatic 23) contrib/MedicalSeg/nnunet/utils/utils.py:56 — utils.save_segmentation_nifti_from_softmax has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · COCOeval.accumulate (cyclomatic 22) · ×1
  • COCOeval.accumulate (cyclomatic 22) EISeg/eiseg/util/coco/cocoeval.py:333 — COCOeval.accumulate 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 · rs_regularization._fine (cyclomatic 22) · ×1
  • rs_regularization._fine (cyclomatic 22) EISeg/eiseg/util/regularization/rs_regularization.py:90 — rs_regularization._fine 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 · val.evaluate (cyclomatic 22) · ×1
  • val.evaluate (cyclomatic 22) contrib/MedicalSeg/medicalseg/core/val.py:29 — val.evaluate 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 · PanopticEvaluator.update (cyclomatic 22) · ×1
  • PanopticEvaluator.update (cyclomatic 22) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:125 — PanopticEvaluator.update 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 · APP_EISeg.toggleWidget (cyclomatic 21) · ×1
  • APP_EISeg.toggleWidget (cyclomatic 21) REDACTED:2395 — APP_EISeg.toggleWidget 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 · polygon.get_polygon (cyclomatic 21) · ×1
  • polygon.get_polygon (cyclomatic 21) EISeg/eiseg/util/polygon.py:28 — polygon.get_polygon 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 · single_fold_eval.evaluate (cyclomatic 21) · ×1
  • single_fold_eval.evaluate (cyclomatic 21) contrib/MedicalSeg/nnunet/single_fold_eval.py:45 — single_fold_eval.evaluate 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 · predict_utils.predict_cases (cyclomatic 21) · ×1
  • predict_utils.predict_cases (cyclomatic 21) contrib/MedicalSeg/nnunet/utils/predict_utils.py:158 — predict_utils.predict_cases 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 · COCOeval.evaluateImg (cyclomatic 20) · ×1
  • COCOeval.evaluateImg (cyclomatic 20) EISeg/eiseg/util/coco/cocoeval.py:250 — COCOeval.evaluateImg 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 · BasePredictor._internal_maybe_mirror_and_pred_3D (cyclomatic 20) · ×1
  • BasePredictor._internal_maybe_mirror_and_pred_3D (cyclomatic 20) contrib/MedicalSeg/nnunet/utils/base_predictor.py:371 — BasePredictor._internal_maybe_mirror_and_pred_3D 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 · val.evaluate (cyclomatic 20) · ×1
  • val.evaluate (cyclomatic 20) contrib/PanopticSeg/paddlepanseg/core/val.py:31 — val.evaluate 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 · PanSegEvaluator.update (cyclomatic 20) · ×1
  • PanSegEvaluator.update (cyclomatic 20) contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:122 — PanSegEvaluator.update 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 · MattingDataset.__getitem__ (cyclomatic 19) · ×1
  • MattingDataset.__getitem__ (cyclomatic 19) Matting/ppmatting/datasets/matting_dataset.py:116 — MattingDataset.__getitem__ 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 · ensemble.ensemble_val (cyclomatic 19) · ×1
  • ensemble.ensemble_val (cyclomatic 19) contrib/MedicalSeg/nnunet/ensemble.py:213 — ensemble.ensemble_val 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 · StaticBasePredictor._internal_maybe_mirror_and_pred_3D (cyclomatic 19) · ×1
  • StaticBasePredictor._internal_maybe_mirror_and_pred_3D (cyclomatic 19) contrib/MedicalSeg/nnunet/utils/static_predictor.py:357 — StaticBasePredictor._internal_maybe_mirror_and_pred_3D 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 · Compose.__call__ (cyclomatic 19) · ×1
  • Compose.__call__ (cyclomatic 19) paddleseg/transforms/transforms.py:51 — Compose.__call__ has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PredictorRVM.run (cyclomatic 18) · ×1
  • PredictorRVM.run (cyclomatic 18) Matting/deploy/python/infer.py:555 — PredictorRVM.run has cyclomatic complexity 18 (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 · CityDataset._train_sync_transform (cyclomatic 18) · ×1
  • CityDataset._train_sync_transform (cyclomatic 18) contrib/DomainAdaptation/datasets/cityscapes_noconfig.py:204 — CityDataset._train_sync_transform has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · infer.get_reverse_list (cyclomatic 18) · ×1
  • infer.get_reverse_list (cyclomatic 18) contrib/LaneSeg/core/infer.py:24 — infer.get_reverse_list has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Predictor.run (cyclomatic 18) · ×1
  • Predictor.run (cyclomatic 18) contrib/MedicalSeg/deploy/python/infer.py:376 — Predictor.run has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Evaluator.evaluate (cyclomatic 18) · ×1
  • Evaluator.evaluate (cyclomatic 18) contrib/MedicalSeg/nnunet/utils/evaluator.py:123 — Evaluator.evaluate has cyclomatic complexity 18 (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 · export.export (cyclomatic 18) · ×1
  • export.export (cyclomatic 18) paddleseg/core/export.py:27 — export.export has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Dataset.__init__ (cyclomatic 18) · ×1
  • Dataset.__init__ (cyclomatic 18) paddleseg/datasets/dataset.py:64 — Dataset.__init__ has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · download.download_file_and_uncompress (cyclomatic 18) · ×1
  • download.download_file_and_uncompress (cyclomatic 18) paddleseg/utils/download.py:116 — download.download_file_and_uncompress has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DataLoader3D.generate_train_batch (cyclomatic 17) · ×1
  • DataLoader3D.generate_train_batch (cyclomatic 17) contrib/MedicalSeg/nnunet/datasets/dataloader.py:105 — DataLoader3D.generate_train_batch 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 · DataLoader2D.generate_train_batch (cyclomatic 17) · ×1
  • DataLoader2D.generate_train_batch (cyclomatic 17) contrib/MedicalSeg/nnunet/datasets/dataloader.py:308 — DataLoader2D.generate_train_batch 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 · visualizer.show_result (cyclomatic 17) · ×1
  • visualizer.show_result (cyclomatic 17) contrib/QualityInspector/qinspector/utils/visualizer.py:57 — visualizer.show_result 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 · labelme-json2labelme-coco.main (cyclomatic 16) · ×1
  • labelme-json2labelme-coco.main (cyclomatic 16) REDACTED:309 — labelme-json2labelme-coco.main 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 · SubImgCrop.__call__ (cyclomatic 16) · ×1
  • SubImgCrop.__call__ (cyclomatic 16) contrib/LaneSeg/transforms/lane_transforms.py:116 — SubImgCrop.__call__ has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils.get_image_list (cyclomatic 16) · ×1
  • utils.get_image_list (cyclomatic 16) contrib/MedicalSeg/medicalseg/utils/utils.py:142 — utils.get_image_list 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 · BasePredictor._internal_predict_3D_3Dconv_tiled (cyclomatic 16) · ×1
  • BasePredictor._internal_predict_3D_3Dconv_tiled (cyclomatic 16) contrib/MedicalSeg/nnunet/utils/base_predictor.py:183 — BasePredictor._internal_predict_3D_3Dconv_tiled 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 · StaticBasePredictor._internal_predict_3D_3Dconv_tiled (cyclomatic 16) · ×1
  • StaticBasePredictor._internal_predict_3D_3Dconv_tiled (cyclomatic 16) contrib/MedicalSeg/nnunet/utils/static_predictor.py:170 — StaticBasePredictor._internal_predict_3D_3Dconv_tiled 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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment paddleseg/utils/utils.py:281 — # Hack __dict__ of obj to inject the value — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · train.train (cognitive 230) · ×1
  • train.train (cognitive 230) paddleseg/core/train.py:66 — train.train has cognitive complexity 230 (threshold 15). Drivers by points: if/else 59 (181 pts), loops 6 (21 pts), boolean chains 16, ternaries 3 (12 pts) (nesting depth added 146). 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 · train.train (cognitive 152) · ×1
  • train.train (cognitive 152) REDACTED:85 — train.train has cognitive complexity 152 (threshold 15). Drivers by points: if/else 29 (80 pts), loops 12 (52 pts), ternaries 3 (12 pts), boolean chains 8 (nesting depth added 100). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Trainer.train (cognitive 134) · ×1
  • Trainer.train (cognitive 134) contrib/DomainAdaptation/script/train.py:60 — Trainer.train has cognitive complexity 134 (threshold 15). Drivers by points: if/else 38 (110 pts), loops 4 (13 pts), boolean chains 7, ternaries 1 (4 pts) (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch 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 (cognitive 134) · ×1
  • train.train (cognitive 134) contrib/RSSegBenchmark/c2fnet/core/train.py:69 — train.train has cognitive complexity 134 (threshold 15). Drivers by points: if/else 37 (95 pts), loops 5 (19 pts), ternaries 3 (12 pts), boolean chains 8 (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch 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 (cognitive 126) · ×1
  • train.train (cognitive 126) contrib/LaneSeg/core/train.py:55 — train.train has cognitive complexity 126 (threshold 15). Drivers by points: if/else 37 (97 pts), loops 5 (19 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · distill_utils.distill_train (cognitive 122) · ×1
  • distill_utils.distill_train (cognitive 122) deploy/slim/distill/distill_utils.py:73 — distill_utils.distill_train has cognitive complexity 122 (threshold 15). Drivers by points: if/else 36 (93 pts), loops 5 (19 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch 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 (cognitive 115) · ×1
  • train.train (cognitive 115) contrib/PanopticSeg/paddlepanseg/core/train.py:49 — train.train has cognitive complexity 115 (threshold 15). Drivers by points: if/else 29 (83 pts), loops 5 (19 pts), boolean chains 8, ternaries 2 (5 pts) (nesting depth added 71). 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 · APP_EISeg.exportLabel (cognitive 111) · ×1
  • APP_EISeg.exportLabel (cognitive 111) REDACTED:1877 — APP_EISeg.exportLabel has cognitive complexity 111 (threshold 15). Drivers by points: if/else 36 (72 pts), loops 9 (32 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 61). 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 · postprocessing.determine_postprocessing (cognitive 111) · ×1
  • postprocessing.determine_postprocessing (cognitive 111) contrib/MedicalSeg/nnunet/utils/postprocessing.py:101 — postprocessing.determine_postprocessing has cognitive complexity 111 (threshold 15). Drivers by points: if/else 34 (78 pts), loops 14 (32 pts), boolean chains 1 (nesting depth added 62). 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 · train.train (cognitive 102) · ×1
  • train.train (cognitive 102) contrib/CrossPseudoSupervision/core/train.py:100 — train.train has cognitive complexity 102 (threshold 15). Drivers by points: if/else 30 (74 pts), loops 5 (19 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch 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 (cognitive 101) · ×1
  • train.train (cognitive 101) contrib/MedicalSeg/medicalseg/core/train.py:30 — train.train has cognitive complexity 101 (threshold 15). Drivers by points: if/else 30 (78 pts), loops 4 (13 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 60). 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 · train.train (cognitive 99) · ×1
  • train.train (cognitive 99) contrib/PanopticDeepLab/core/train.py:68 — train.train has cognitive complexity 99 (threshold 15). Drivers by points: if/else 26 (68 pts), loops 5 (19 pts), boolean chains 8, ternaries 1 (4 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch 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 (cognitive 88) · ×1
  • train.train (cognitive 88) contrib/MedicalSeg/nnunet/core/train.py:30 — train.train has cognitive complexity 88 (threshold 15). Drivers by points: if/else 25 (68 pts), loops 4 (13 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 55). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · functional.augment_spatial (cognitive 84) · ×1
  • functional.augment_spatial (cognitive 84) contrib/MedicalSeg/nnunet/transforms/functional.py:667 — functional.augment_spatial has cognitive complexity 84 (threshold 15). Drivers by points: if/else 31 (63 pts), loops 5 (15 pts), boolean chains 6 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APP_EISeg.loadImage (cognitive 74) · ×1
  • APP_EISeg.loadImage (cognitive 74) REDACTED:1468 — APP_EISeg.loadImage has cognitive complexity 74 (threshold 15). Drivers by points: if/else 36 (71 pts), boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Predictor.run (cognitive 70) · ×1
  • Predictor.run (cognitive 70) Matting/deploy/python/infer.py:330 — Predictor.run has cognitive complexity 70 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 7 (17 pts), ternaries 4 (16 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResNet_vd.__init__ (cognitive 65) · ×1
  • ResNet_vd.__init__ (cognitive 65) paddleseg/models/backbones/resnet_vd.py:214 — ResNet_vd.__init__ has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 8 (26 pts), if/else 10 (23 pts), loops 4 (10 pts), boolean chains 6 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · COCOeval.accumulate (cognitive 58) · ×1
  • COCOeval.accumulate (cognitive 58) EISeg/eiseg/util/coco/cocoeval.py:333 — COCOeval.accumulate has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 6 (20 pts), error handling 1 (5 pts), ternaries 3 (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 · ResNet_vd.__init__ (cognitive 56) · ×1
  • ResNet_vd.__init__ (cognitive 56) Matting/ppmatting/models/backbone/resnet_vd.py:194 — ResNet_vd.__init__ has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 7 (22 pts), if/else 9 (19 pts), loops 4 (10 pts), boolean chains 5 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveRandomConnectedComponentFromOneHotEncodingTransform.__call__ (cognitive 56) · ×1
  • RemoveRandomConnectedComponentFromOneHotEncodingTransform.__call__ (cognitive 56) contrib/MedicalSeg/nnunet/transforms/transform.py:583 — RemoveRandomConnectedComponentFromOneHotEncodingTransform.__call__ has cognitive complexity 56 (threshold 15). Drivers by points: if/else 8 (46 pts), loops 3 (10 pts) (nesting depth added 45). 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 · InstanceEvaluator.update (cognitive 54) · ×1
  • InstanceEvaluator.update (cognitive 54) contrib/PanopticDeepLab/utils/evaluation/instance.py:68 — InstanceEvaluator.update has cognitive complexity 54 (threshold 15). Drivers by points: if/else 9 (37 pts), loops 6 (17 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InsSegEvaluator.update (cognitive 54) · ×1
  • InsSegEvaluator.update (cognitive 54) contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:50 — InsSegEvaluator.update has cognitive complexity 54 (threshold 15). Drivers by points: if/else 9 (37 pts), loops 6 (17 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · polygon.get_polygon (cognitive 53) · ×1
  • polygon.get_polygon (cognitive 53) EISeg/eiseg/util/polygon.py:28 — polygon.get_polygon has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 4 (11 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · utils.get_image_list (cognitive 52) · ×1
  • utils.get_image_list (cognitive 52) contrib/MedicalSeg/medicalseg/utils/utils.py:142 — utils.get_image_list has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 4 (15 pts) (nesting depth added 34). 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 · visualizer.show_result (cognitive 50) · ×1
  • visualizer.show_result (cognitive 50) contrib/QualityInspector/qinspector/utils/visualizer.py:57 — visualizer.show_result has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (31 pts), ternaries 2 (10 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataLoader3D.generate_train_batch (cognitive 46) · ×1
  • DataLoader3D.generate_train_batch (cognitive 46) contrib/MedicalSeg/nnunet/datasets/dataloader.py:105 — DataLoader3D.generate_train_batch has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (43 pts), loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preprocessing.resample_data_or_seg (cognitive 45) · ×1
  • preprocessing.resample_data_or_seg (cognitive 45) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:140 — preprocessing.resample_data_or_seg has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (16 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 · COCOeval.evaluateImg (cognitive 43) · ×1
  • COCOeval.evaluateImg (cognitive 43) EISeg/eiseg/util/coco/cocoeval.py:250 — COCOeval.evaluateImg has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 4 (10 pts), boolean chains 6, ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rs_regularization._fine (cognitive 43) · ×1
  • rs_regularization._fine (cognitive 43) EISeg/eiseg/util/regularization/rs_regularization.py:90 — rs_regularization._fine has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 6 (9 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Predictor.run (cognitive 43) · ×1
  • Predictor.run (cognitive 43) contrib/MedicalSeg/deploy/python/infer.py:376 — Predictor.run has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (37 pts), loops 2 (5 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 · DataLoader2D.generate_train_batch (cognitive 43) · ×1
  • DataLoader2D.generate_train_batch (cognitive 43) contrib/MedicalSeg/nnunet/datasets/dataloader.py:308 — DataLoader2D.generate_train_batch has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 2 (3 pts), boolean chains 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 · val.evaluate (cognitive 42) · ×1
  • val.evaluate (cognitive 42) contrib/MedicalSeg/medicalseg/core/val.py:29 — val.evaluate has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (37 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Generic_UNet.__init__ (cognitive 42) · ×1
  • Generic_UNet.__init__ (cognitive 42) contrib/MedicalSeg/medicalseg/models/nnunet.py:265 — Generic_UNet.__init__ has cognitive complexity 42 (threshold 15). Drivers by points: if/else 24 (33 pts), loops 5, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transforms.to_pil_image (cognitive 41) · ×1
  • transforms.to_pil_image (cognitive 41) contrib/SegmentAnything/segment_anything/utils/transforms.py:28 — transforms.to_pil_image has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 9 (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 · PredictorRVM.run (cognitive 40) · ×1
  • PredictorRVM.run (cognitive 40) Matting/deploy/python/infer.py:555 — PredictorRVM.run has cognitive complexity 40 (threshold 15). Drivers by points: loops 9 (23 pts), if/else 7 (16 pts), boolean chains 1 (nesting depth added 23). 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 · augmentation.get_moreDA_augmentation (cognitive 40) · ×1
  • augmentation.get_moreDA_augmentation (cognitive 40) contrib/MedicalSeg/nnunet/transforms/augmentation.py:25 — augmentation.get_moreDA_augmentation has cognitive complexity 40 (threshold 15). Drivers by points: if/else 28 (35 pts), boolean chains 5 (nesting depth added 7). 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 · utils.save_segmentation_nifti_from_softmax (cognitive 39) · ×1
  • utils.save_segmentation_nifti_from_softmax (cognitive 39) contrib/MedicalSeg/nnunet/utils/utils.py:56 — utils.save_segmentation_nifti_from_softmax has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (33 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eval.eval_ng (cognitive 38) · ×1
  • eval.eval_ng (cognitive 38) contrib/QualityInspector/tools/end2end/eval.py:91 — eval.eval_ng has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (13 pts), ternaries 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · predict_utils.predict_cases (cognitive 37) · ×1
  • predict_utils.predict_cases (cognitive 37) contrib/MedicalSeg/nnunet/utils/predict_utils.py:158 — predict_utils.predict_cases has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 2, loops 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 · download.download_file_and_uncompress (cognitive 37) · ×1
  • download.download_file_and_uncompress (cognitive 37) paddleseg/utils/download.py:116 — download.download_file_and_uncompress has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 1 (3 pts), ternaries 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · labelme-json2labelme-coco.main (cognitive 36) · ×1
  • labelme-json2labelme-coco.main (cognitive 36) REDACTED:309 — labelme-json2labelme-coco.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 4 (6 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 · MattingDataset.__getitem__ (cognitive 36) · ×1
  • MattingDataset.__getitem__ (cognitive 36) Matting/ppmatting/datasets/matting_dataset.py:116 — MattingDataset.__getitem__ has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer.get_reverse_list (cognitive 36) · ×1
  • infer.get_reverse_list (cognitive 36) contrib/LaneSeg/core/infer.py:24 — infer.get_reverse_list has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · postprocessing.remove_all_but_the_largest_connected_component (cognitive 36) · ×1
  • postprocessing.remove_all_but_the_largest_connected_component (cognitive 36) contrib/MedicalSeg/nnunet/utils/postprocessing.py:38 — postprocessing.remove_all_but_the_largest_connected_component has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 4 (9 pts) (nesting depth added 23). 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 · Attention.forward (cognitive 36) · ×1
  • Attention.forward (cognitive 36) paddleseg/models/backbones/hrformer.py:126 — Attention.forward has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 3, ternaries 3 (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 · estimate_foreground_ml._estimate_fb_ml (cognitive 35) · ×1
  • estimate_foreground_ml._estimate_fb_ml (cognitive 35) Matting/ppmatting/utils/estimate_foreground_ml.py:68 — estimate_foreground_ml._estimate_fb_ml has cognitive complexity 35 (threshold 15). Drivers by points: loops 8 (31 pts), if/else 2 (3 pts), boolean chains 1 (nesting depth added 24). 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 · PanopticEvaluator.update (cognitive 35) · ×1
  • PanopticEvaluator.update (cognitive 35) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:125 — PanopticEvaluator.update has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 6, ternaries 3 (6 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 · polygon.approx_poly_DIY (cognitive 33) · ×1
  • polygon.approx_poly_DIY (cognitive 33) EISeg/eiseg/util/polygon.py:134 — polygon.approx_poly_DIY has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (12 pts), error handling 2 (4 pts), loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CityDataset._train_sync_transform (cognitive 33) · ×1
  • CityDataset._train_sync_transform (cognitive 33) contrib/DomainAdaptation/datasets/cityscapes_noconfig.py:204 — CityDataset._train_sync_transform has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · single_fold_eval.evaluate (cognitive 33) · ×1
  • single_fold_eval.evaluate (cognitive 33) contrib/MedicalSeg/nnunet/single_fold_eval.py:45 — single_fold_eval.evaluate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 4 (5 pts), boolean chains 3, error handling 1 (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 · Evaluator.evaluate (cognitive 33) · ×1
  • Evaluator.evaluate (cognitive 33) contrib/MedicalSeg/nnunet/utils/evaluator.py:123 — Evaluator.evaluate has cognitive complexity 33 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 11 (15 pts), boolean chains 1 (nesting depth added 14). 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 · JudgeByArea.__call__ (cognitive 33) · ×1
  • JudgeByArea.__call__ (cognitive 33) contrib/QualityInspector/qinspector/ops/postprocess.py:112 — JudgeByArea.__call__ has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 2 (3 pts) (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 · APP_EISeg.toggleWidget (cognitive 32) · ×1
  • APP_EISeg.toggleWidget (cognitive 32) REDACTED:2395 — APP_EISeg.toggleWidget has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 4 (9 pts), boolean chains 4 (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 · Prep.load_save (cognitive 32) · ×1
  • Prep.load_save (cognitive 32) contrib/MedicalSeg/tools/prepare.py:197 — Prep.load_save has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (11 pts), loops 4 (10 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PanSegEvaluator.update (cognitive 32) · ×1
  • PanSegEvaluator.update (cognitive 32) contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:122 — PanSegEvaluator.update has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 6 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ensemble.ensemble_val (cognitive 31) · ×1
  • ensemble.ensemble_val (cognitive 31) contrib/MedicalSeg/nnunet/ensemble.py:213 — ensemble.ensemble_val has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PanopticTargetGenerator.__call__ (cognitive 31) · ×1
  • PanopticTargetGenerator.__call__ (cognitive 31) contrib/PanopticDeepLab/transforms/target_transforms.py:60 — PanopticTargetGenerator.__call__ has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasePixelDecoder.__init__ (cognitive 31) · ×1
  • BasePixelDecoder.__init__ (cognitive 31) paddleseg/models/maskformer.py:146 — BasePixelDecoder.__init__ has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (8 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 · utils.get_image_list (cognitive 30) · ×1
  • utils.get_image_list (cognitive 30) paddleseg/utils/utils.py:218 — utils.get_image_list has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (8 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 · APP_EISeg.loadLabel (cognitive 29) · ×1
  • APP_EISeg.loadLabel (cognitive 29) REDACTED:1636 — APP_EISeg.loadLabel has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 7 (13 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 · val.evaluate (cognitive 29) · ×1
  • val.evaluate (cognitive 29) Matting/ppmatting/core/val.py:55 — val.evaluate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 5 (6 pts), boolean chains 1, ternaries 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 · utils.save_array (cognitive 28) · ×1
  • utils.save_array (cognitive 28) contrib/MedicalSeg/medicalseg/utils/utils.py:205 — utils.save_array has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (11 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasePredictor._internal_predict_3D_3Dconv_tiled (cognitive 28) · ×1
  • BasePredictor._internal_predict_3D_3Dconv_tiled (cognitive 28) contrib/MedicalSeg/nnunet/utils/base_predictor.py:183 — BasePredictor._internal_predict_3D_3Dconv_tiled has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (8 pts), boolean chains 3 (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 · BasePredictor._internal_maybe_mirror_and_pred_3D (cognitive 28) · ×1
  • BasePredictor._internal_maybe_mirror_and_pred_3D (cognitive 28) contrib/MedicalSeg/nnunet/utils/base_predictor.py:371 — BasePredictor._internal_maybe_mirror_and_pred_3D has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 7, 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 · StaticBasePredictor._internal_predict_3D_3Dconv_tiled (cognitive 28) · ×1
  • StaticBasePredictor._internal_predict_3D_3Dconv_tiled (cognitive 28) contrib/MedicalSeg/nnunet/utils/static_predictor.py:170 — StaticBasePredictor._internal_predict_3D_3Dconv_tiled has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (8 pts), boolean chains 3 (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 · APP_EISeg.save_coco_format (cognitive 27) · ×1
  • APP_EISeg.save_coco_format (cognitive 27) REDACTED:3348 — APP_EISeg.save_coco_format has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (11 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticBasePredictor._internal_maybe_mirror_and_pred_3D (cognitive 27) · ×1
  • StaticBasePredictor._internal_maybe_mirror_and_pred_3D (cognitive 27) contrib/MedicalSeg/nnunet/utils/static_predictor.py:357 — StaticBasePredictor._internal_maybe_mirror_and_pred_3D has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 7, 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 · val.evaluate (cognitive 27) · ×1
  • val.evaluate (cognitive 27) contrib/PanopticSeg/paddlepanseg/core/val.py:31 — val.evaluate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PixelContrastCrossEntropyLoss._hard_anchor_sampling (cognitive 27) · ×1
  • PixelContrastCrossEntropyLoss._hard_anchor_sampling (cognitive 27) paddleseg/models/losses/pixel_contrast_cross_entropy_loss.py:53 — PixelContrastCrossEntropyLoss._hard_anchor_sampling has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.get_image_list (cognitive 26) · ×1
  • utils.get_image_list (cognitive 26) Matting/ppmatting/utils/utils.py:31 — utils.get_image_list has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (8 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 · functional.crop (cognitive 26) · ×1
  • functional.crop (cognitive 26) contrib/MedicalSeg/nnunet/transforms/functional.py:568 — functional.crop has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApplyRandomBinaryOperatorTransform.__call__ (cognitive 26) · ×1
  • ApplyRandomBinaryOperatorTransform.__call__ (cognitive 26) contrib/MedicalSeg/nnunet/transforms/transform.py:542 — ApplyRandomBinaryOperatorTransform.__call__ has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 3 (10 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 · evaluator.aggregate_scores (cognitive 26) · ×1
  • evaluator.aggregate_scores (cognitive 26) contrib/MedicalSeg/nnunet/utils/evaluator.py:275 — evaluator.aggregate_scores has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · experiment_utils.get_pool_and_conv_props (cognitive 26) · ×1
  • experiment_utils.get_pool_and_conv_props (cognitive 26) contrib/MedicalSeg/tools/preprocess_utils/experiment_utils.py:86 — experiment_utils.get_pool_and_conv_props has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (7 pts), ternaries 1 (2 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 · infer.reverse_transform_for_single_map (cognitive 26) · ×1
  • infer.reverse_transform_for_single_map (cognitive 26) contrib/PanopticSeg/paddlepanseg/core/infer.py:19 — infer.reverse_transform_for_single_map has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (9 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 · Config.update (cognitive 26) · ×1
  • Config.update (cognitive 26) contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:137 — Config.update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (8 pts), loops 2 (5 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 · save_info.update_train_results (cognitive 26) · ×1
  • save_info.update_train_results (cognitive 26) paddleseg/utils/save_info.py:32 — save_info.update_train_results has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 6 (8 pts), ternaries 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APP_EISeg.labelListClicked (cognitive 25) · ×1
  • APP_EISeg.labelListClicked (cognitive 25) REDACTED:1227 — APP_EISeg.labelListClicked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · EISegMed3DWidget.getTurnToTaskId (cognitive 25) · ×1
  • EISegMed3DWidget.getTurnToTaskId (cognitive 25) EISeg/med3d/EISegMed3D/EISegMed3D.py:476 — EISegMed3DWidget.getTurnToTaskId has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · download.download_file_and_uncompress (cognitive 25) · ×1
  • download.download_file_and_uncompress (cognitive 25) contrib/MedicalSeg/medicalseg/utils/download.py:116 — download.download_file_and_uncompress has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasePredictor._internal_predict_2D_2Dconv_tiled (cognitive 25) · ×1
  • BasePredictor._internal_predict_2D_2Dconv_tiled (cognitive 25) contrib/MedicalSeg/nnunet/utils/base_predictor.py:476 — BasePredictor._internal_predict_2D_2Dconv_tiled has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 3 (5 pts), boolean chains 3 (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 · StaticBasePredictor._internal_predict_2D_2Dconv_tiled (cognitive 25) · ×1
  • StaticBasePredictor._internal_predict_2D_2Dconv_tiled (cognitive 25) contrib/MedicalSeg/nnunet/utils/static_predictor.py:451 — StaticBasePredictor._internal_predict_2D_2Dconv_tiled has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 3 (5 pts), boolean chains 3 (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 · export.export (cognitive 25) · ×1
  • export.export (cognitive 25) paddleseg/core/export.py:27 — export.export has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · APP_EISeg.createRects (cognitive 24) · ×1
  • APP_EISeg.createRects (cognitive 24) REDACTED:1714 — APP_EISeg.createRects has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 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 · APP_EISeg.saveGridLabel (cognitive 24) · ×1
  • APP_EISeg.saveGridLabel (cognitive 24) REDACTED:2712 — APP_EISeg.saveGridLabel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4 (8 pts), error handling 2 (4 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 · Detector.save_coco_results (cognitive 24) · ×1
  • Detector.save_coco_results (cognitive 24) REDACTED:1206 — Detector.save_coco_results has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (7 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceCore.do_pass (cognitive 24) · ×1
  • InferenceCore.do_pass (cognitive 24) EISeg/eiseg/plugin/video/inference_core.py:185 — InferenceCore.do_pass has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · predict.predict (cognitive 24) · ×1
  • predict.predict (cognitive 24) Matting/ppmatting/core/predict.py:110 — predict.predict has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 3 (6 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 · val_crop.evaluate (cognitive 24) · ×1
  • val_crop.evaluate (cognitive 24) contrib/AutoNUE/core/val_crop.py:28 — val_crop.evaluate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (6 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 · PrepMSDBrain.load_save (cognitive 24) · ×1
  • PrepMSDBrain.load_save (cognitive 24) contrib/MedicalSeg/tools/prepare_msd_brain_seg.py:116 — PrepMSDBrain.load_save has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (10 pts), ternaries 2 (8 pts), if/else 2 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gray2pseudo_color.gray2pseudo_color (cognitive 24) · ×1
  • gray2pseudo_color.gray2pseudo_color (cognitive 24) contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:62 — gray2pseudo_color.gray2pseudo_color has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), error handling 1 (4 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 · APP_EISeg.changeParam (cognitive 23) · ×1
  • APP_EISeg.changeParam (cognitive 23) REDACTED:955 — APP_EISeg.changeParam has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APP_EISeg.saveImage (cognitive 23) · ×1
  • APP_EISeg.saveImage (cognitive 23) REDACTED:1835 — APP_EISeg.saveImage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 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 · COCO.getAnnIds (cognitive 23) · ×1
  • COCO.getAnnIds (cognitive 23) EISeg/eiseg/util/coco/coco.py:271 — COCO.getAnnIds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 4 (6 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 · JudgeByLengthWidth.__call__ (cognitive 23) · ×1
  • JudgeByLengthWidth.__call__ (cognitive 23) contrib/QualityInspector/qinspector/ops/postprocess.py:84 — JudgeByLengthWidth.__call__ has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (3 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 · convert_mask_to_RoI.convert_mask_to_roi (cognitive 23) · ×1
  • convert_mask_to_RoI.convert_mask_to_roi (cognitive 23) contrib/QualityInspector/tools/convert_tools/convert_mask_to_RoI.py:75 — convert_mask_to_RoI.convert_mask_to_roi has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · masktococo.saveMaskToCOCO (cognitive 22) · ×1
  • masktococo.saveMaskToCOCO (cognitive 22) EISeg/eiseg/util/masktococo.py:27 — masktococo.saveMaskToCOCO has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (11 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 · utils.load_pretrained_model (cognitive 22) · ×1
  • utils.load_pretrained_model (cognitive 22) Matting/ppmatting/utils/utils.py:78 — utils.load_pretrained_model has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Prep_abdomen.load_save (cognitive 22) · ×1
  • Prep_abdomen.load_save (cognitive 22) contrib/MedicalSeg/tools/prepare_abdomen.py:115 — Prep_abdomen.load_save has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (16 pts), if/else 4 (6 pts) (nesting depth added 13). 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 · infer.get_reverse_list (cognitive 22) · ×1
  • infer.get_reverse_list (cognitive 22) contrib/PanopticDeepLab/core/infer.py:24 — infer.get_reverse_list has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JudgeDetByScores.__call__ (cognitive 22) · ×1
  • JudgeDetByScores.__call__ (cognitive 22) contrib/QualityInspector/qinspector/ops/postprocess.py:56 — JudgeDetByScores.__call__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · convert_mask_to_coco.convert_mask_to_coco (cognitive 22) · ×1
  • convert_mask_to_coco.convert_mask_to_coco (cognitive 22) contrib/QualityInspector/tools/convert_tools/convert_mask_to_coco.py:62 — convert_mask_to_coco.convert_mask_to_coco has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (8 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 · LiteHRNetModule.forward (cognitive 22) · ×1
  • LiteHRNetModule.forward (cognitive 22) paddleseg/models/backbones/lite_hrnet.py:679 — LiteHRNetModule.forward has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), ternaries 1 (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 · EISegMed3DWidget.getScan (cognitive 21) · ×1
  • EISegMed3DWidget.getScan (cognitive 21) EISeg/med3d/EISegMed3D/EISegMed3D.py:500 — EISegMed3DWidget.getScan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (4 pts), error handling 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 · val.evaluate (cognitive 21) · ×1
  • val.evaluate (cognitive 21) contrib/AutoNUE/core/val.py:28 — val.evaluate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (4 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 · MSDDataset.process_plans (cognitive 21) · ×1
  • MSDDataset.process_plans (cognitive 21) contrib/MedicalSeg/nnunet/datasets/dataset.py:369 — MSDDataset.process_plans has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 6). 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 · Dataset.__init__ (cognitive 21) · ×1
  • Dataset.__init__ (cognitive 21) paddleseg/datasets/dataset.py:64 — Dataset.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APP_EISeg.openFolder (cognitive 20) · ×1
  • APP_EISeg.openFolder (cognitive 20) REDACTED:1406 — APP_EISeg.openFolder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2, boolean chains 1 (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 · APP_EISeg.initGrid (cognitive 20) · ×1
  • APP_EISeg.initGrid (cognitive 20) REDACTED:2545 — APP_EISeg.initGrid has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (9 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 · TableWidget.dropEvent (cognitive 20) · ×1
  • TableWidget.dropEvent (cognitive 20) EISeg/eiseg/widget/table.py:31 — TableWidget.dropEvent has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 5 (9 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 · SubImgCrop.__call__ (cognitive 20) · ×1
  • SubImgCrop.__call__ (cognitive 20) contrib/LaneSeg/transforms/lane_transforms.py:116 — SubImgCrop.__call__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EfficientFormerFPNNeck.forward (cognitive 20) · ×1
  • EfficientFormerFPNNeck.forward (cognitive 20) paddleseg/models/efficientformerv2_seg.py:158 — EfficientFormerFPNNeck.forward has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (7 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 · RandomBlur.__call__ (cognitive 20) · ×1
  • RandomBlur.__call__ (cognitive 20) paddleseg/transforms/transforms.py:851 — RandomBlur.__call__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (20 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 · RandomScaleAspect.__call__ (cognitive 20) · ×1
  • RandomScaleAspect.__call__ (cognitive 20) paddleseg/transforms/transforms.py:962 — RandomScaleAspect.__call__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (6 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 · Predictor._preprocess (cognitive 19) · ×1
  • Predictor._preprocess (cognitive 19) contrib/MedicalSeg/deploy/python/infer.py:466 — Predictor._preprocess has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 3 (9 pts) (nesting depth added 13). 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 · analyse.analyse (cognitive 19) · ×1
  • analyse.analyse (cognitive 19) paddleseg/core/analyse.py:51 — analyse.analyse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HighResolutionTransformerModule._make_fuse_layers (cognitive 19) · ×1
  • HighResolutionTransformerModule._make_fuse_layers (cognitive 19) paddleseg/models/backbones/hrformer.py:592 — HighResolutionTransformerModule._make_fuse_layers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), ternaries 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 · LiteHRNetModule._make_fuse_layers (cognitive 19) · ×1
  • LiteHRNetModule._make_fuse_layers (cognitive 19) paddleseg/models/backbones/lite_hrnet.py:606 — LiteHRNetModule._make_fuse_layers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), ternaries 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 · LiteHRNet._make_transition_layer (cognitive 19) · ×1
  • LiteHRNet._make_transition_layer (cognitive 19) paddleseg/models/backbones/lite_hrnet.py:820 — LiteHRNet._make_transition_layer has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 4 (7 pts), loops 2 (4 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 · APP_EISeg.openImage (cognitive 18) · ×1
  • APP_EISeg.openImage (cognitive 18) REDACTED:1364 — APP_EISeg.openImage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 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 · APP_EISeg.turnImg (cognitive 18) · ×1
  • APP_EISeg.turnImg (cognitive 18) REDACTED:1689 — APP_EISeg.turnImg has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4 (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 · RandomBlur.__call__ (cognitive 18) · ×1
  • RandomBlur.__call__ (cognitive 18) Matting/ppmatting/transforms/transforms.py:533 — RandomBlur.__call__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · predict_ensemble.get_image_list (cognitive 18) · ×1
  • predict_ensemble.get_image_list (cognitive 18) contrib/AutoNUE/predict_ensemble.py:111 — predict_ensemble.get_image_list has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · predict_ensemble_three.get_image_list (cognitive 18) · ×1
  • predict_ensemble_three.get_image_list (cognitive 18) contrib/AutoNUE/predict_ensemble_three.py:123 — predict_ensemble_three.get_image_list has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IDD_labeling.get_image_list (cognitive 18) · ×1
  • IDD_labeling.get_image_list (cognitive 18) contrib/AutoNUE/tools/IDD_labeling.py:15 — IDD_labeling.get_image_list has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer.dense_patch_slices (cognitive 18) · ×1
  • infer.dense_patch_slices (cognitive 18) contrib/MedicalSeg/medicalseg/core/infer.py:112 — infer.dense_patch_slices has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 3, ternaries 1 (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 · sys_env._find_cuda_home (cognitive 18) · ×1
  • sys_env._find_cuda_home (cognitive 18) contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py:26 — sys_env._find_cuda_home has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preprocessing.resample_patient (cognitive 18) · ×1
  • preprocessing.resample_patient (cognitive 18) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:66 — preprocessing.resample_patient has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 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 · GeneratePanopticDeepLabTrainTargets.__call__ (cognitive 18) · ×1
  • GeneratePanopticDeepLabTrainTargets.__call__ (cognitive 18) contrib/PanopticSeg/paddlepanseg/transforms/generate_targets/panoptic_deeplab.py:45 — GeneratePanopticDeepLabTrainTargets.__call__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleTokenizer.bpe (cognitive 18) · ×1
  • SimpleTokenizer.bpe (cognitive 18) contrib/SegmentAnything/segment_anything/utils/sample_tokenizer.py:105 — SimpleTokenizer.bpe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 1 (3 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 · LiteHRNet.forward (cognitive 18) · ×1
  • LiteHRNet.forward (cognitive 18) paddleseg/models/backbones/lite_hrnet.py:915 — LiteHRNet.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuseLayers.__init__ (cognitive 18) · ×1
  • FuseLayers.__init__ (cognitive 18) paddleseg/models/backbones/uhrnet.py:739 — FuseLayers.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 pts), ternaries 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 · MaskFormerLoss.forward (cognitive 18) · ×1
  • MaskFormerLoss.forward (cognitive 18) paddleseg/models/losses/maskformer_loss.py:389 — MaskFormerLoss.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 6 (9 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SemanticConnectivityLoss.forward (cognitive 18) · ×1
  • SemanticConnectivityLoss.forward (cognitive 18) paddleseg/models/losses/semantic_connectivity_loss.py:59 — SemanticConnectivityLoss.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Compose.__call__ (cognitive 18) · ×1
  • Compose.__call__ (cognitive 18) paddleseg/transforms/transforms.py:51 — Compose.__call__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · APP_EISeg.finishObject (cognitive 17) · ×1
  • APP_EISeg.finishObject (cognitive 17) REDACTED:1789 — APP_EISeg.finishObject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APP_EISeg.save_yolo_format (cognitive 17) · ×1
  • APP_EISeg.save_yolo_format (cognitive 17) REDACTED:3253 — APP_EISeg.save_yolo_format has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · detection_model.load_predictor (cognitive 17) · ×1
  • detection_model.load_predictor (cognitive 17) REDACTED:854 — detection_model.load_predictor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · COCO.getCatIds (cognitive 17) · ×1
  • COCO.getCatIds (cognitive 17) EISeg/eiseg/util/coco/coco.py:306 — COCO.getCatIds has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5 (8 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 · eiseg2paddlex.Eiseg2paddlex (cognitive 17) · ×1
  • eiseg2paddlex.Eiseg2paddlex (cognitive 17) EISeg/tool/eiseg2paddlex.py:41 — eiseg2paddlex.Eiseg2paddlex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MattingDataset.__init__ (cognitive 17) · ×1
  • MattingDataset.__init__ (cognitive 17) Matting/ppmatting/datasets/matting_dataset.py:63 — MattingDataset.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · predict_ensemble_three.predictEnsembleThree (cognitive 17) · ×1
  • predict_ensemble_three.predictEnsembleThree (cognitive 17) contrib/AutoNUE/core/predict_ensemble_three.py:41 — predict_ensemble_three.predictEnsembleThree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer.sliding_window_inference (cognitive 17) · ×1
  • infer.sliding_window_inference (cognitive 17) contrib/MedicalSeg/medicalseg/core/infer.py:161 — infer.sliding_window_inference has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (7 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 · RandomPaddingCrop.__call__ (cognitive 17) · ×1
  • RandomPaddingCrop.__call__ (cognitive 17) contrib/MedicalSeg/medicalseg/transforms/transform.py:934 — RandomPaddingCrop.__call__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3 (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 · MSDDataset.preprocess_and_generate_plans (cognitive 17) · ×1
  • MSDDataset.preprocess_and_generate_plans (cognitive 17) contrib/MedicalSeg/nnunet/datasets/dataset.py:104 — MSDDataset.preprocess_and_generate_plans has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 1 (2 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 · utils.pad_nd_image (cognitive 17) · ×1
  • utils.pad_nd_image (cognitive 17) contrib/MedicalSeg/nnunet/utils/utils.py:194 — utils.pad_nd_image has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 1 (2 pts), boolean chains 1 (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 · visualize.visualize_panoptic (cognitive 17) · ×1
  • visualize.visualize_panoptic (cognitive 17) contrib/PanopticSeg/paddlepanseg/utils/visualize.py:182 — visualize.visualize_panoptic has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · labelme2seg.main (cognitive 17) · ×1
  • labelme2seg.main (cognitive 17) contrib/QualityInspector/tools/dataset/labelme2seg.py:39 — labelme2seg.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · train.train (cognitive 17) · ×1
  • train.train (cognitive 17) contrib/QualityInspector/tools/uad/stfpm/train.py:144 — train.train has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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 · DefaultSyncIgnoreIndexRule.check_and_correct (cognitive 17) · ×1
  • DefaultSyncIgnoreIndexRule.check_and_correct (cognitive 17) paddleseg/cvlibs/config_checker.py:185 — DefaultSyncIgnoreIndexRule.check_and_correct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2 (6 pts) (nesting depth added 6). 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 · APP_EISeg.changePropgationParam (cognitive 16) · ×1
  • APP_EISeg.changePropgationParam (cognitive 16) REDACTED:1009 — APP_EISeg.changePropgationParam has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APP_EISeg.saveGrid (cognitive 16) · ×1
  • APP_EISeg.saveGrid (cognitive 16) REDACTED:2640 — APP_EISeg.saveGrid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · COCO.createIndex (cognitive 16) · ×1
  • COCO.createIndex (cognitive 16) EISeg/eiseg/util/coco/coco.py:66 — COCO.createIndex has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 4, error handling 1 (3 pts), boolean chains 1 (nesting depth added 6). 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 · infer.get_reverse_list (cognitive 16) · ×1
  • infer.get_reverse_list (cognitive 16) contrib/AutoNUE/core/infer.py:23 — infer.get_reverse_list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer_crop.get_reverse_list (cognitive 16) · ×1
  • infer_crop.get_reverse_list (cognitive 16) contrib/AutoNUE/core/infer_crop.py:23 — infer_crop.get_reverse_list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer_ensemble.get_reverse_list (cognitive 16) · ×1
  • infer_ensemble.get_reverse_list (cognitive 16) contrib/AutoNUE/core/infer_ensemble.py:23 — infer_ensemble.get_reverse_list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer_ensemble_three.get_reverse_list (cognitive 16) · ×1
  • infer_ensemble_three.get_reverse_list (cognitive 16) contrib/AutoNUE/core/infer_ensemble_three.py:23 — infer_ensemble_three.get_reverse_list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer_generate_autolabel.get_reverse_list (cognitive 16) · ×1
  • infer_generate_autolabel.get_reverse_list (cognitive 16) contrib/AutoNUE/core/infer_generate_autolabel.py:23 — infer_generate_autolabel.get_reverse_list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BoxMaskGenerator.generate_params (cognitive 16) · ×1
  • BoxMaskGenerator.generate_params (cognitive 16) contrib/CrossPseudoSupervision/batch_transforms/mask_gen.py:56 — BoxMaskGenerator.generate_params has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (3 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 · ensemble.merge (cognitive 16) · ×1
  • ensemble.merge (cognitive 16) contrib/MedicalSeg/nnunet/ensemble.py:134 — ensemble.merge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasePredictor._internal_maybe_mirror_and_pred_2D (cognitive 16) · ×1
  • BasePredictor._internal_maybe_mirror_and_pred_2D (cognitive 16) contrib/MedicalSeg/nnunet/utils/base_predictor.py:434 — BasePredictor._internal_maybe_mirror_and_pred_2D has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · seg_demo.seg_camera (cognitive 16) · ×1
  • seg_demo.seg_camera (cognitive 16) contrib/PP-HumanSeg/src/seg_demo.py:164 — seg_demo.seg_camera has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgsParser._parse_opt (cognitive 16) · ×1
  • ArgsParser._parse_opt (cognitive 16) contrib/QualityInspector/qinspector/cvlib/configs.py:40 — ArgsParser._parse_opt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · val.val (cognitive 16) · ×1
  • val.val (cognitive 16) contrib/QualityInspector/tools/uad/padim/val.py:131 — val.val has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 4). 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 · EfficientFormerFPNNeck.__init__ (cognitive 16) · ×1
  • EfficientFormerFPNNeck.__init__ (cognitive 16) paddleseg/models/efficientformerv2_seg.py:98 — EfficientFormerFPNNeck.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lovasz_loss.lovasz_softmax_flat (cognitive 16) · ×1
  • lovasz_loss.lovasz_softmax_flat (cognitive 16) paddleseg/models/losses/lovasz_loss.py:160 — lovasz_loss.lovasz_softmax_flat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OhemCrossEntropyLoss.forward (cognitive 16) · ×1
  • OhemCrossEntropyLoss.forward (cognitive 16) paddleseg/models/losses/ohem_cross_entropy_loss.py:55 — OhemCrossEntropyLoss.forward has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (11 members, 59 shared lines) · ×1
  • Near-duplicate member family (11 members, 59 shared lines) contrib/AutoNUE/predict.py:27 — contrib/AutoNUE/predict.py:27-96 | contrib/AutoNUE/predict_ensemble.py:27-108 | contrib/AutoNUE/predict_ensemble_three.py:27-120 | contrib/AutoNUE/val.py:27-90 | contrib/CityscapesSOTA/predict.py:27-104 | contrib/CityscapesSOTA/val.py:27-90 | contrib/DomainAdaptation/val.py:51-120 | contrib/RSSegBenchmark/c2fnet/predict.py:29-121 | contrib/RSSegBenchmark/c2fnet/val.py:45-141 | contrib/RSSegBenchmark/predict.py:28-114 | deploy/slim/quant/qat_val.py:48-126 — These 11 members are variants of one another: a block of 59 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 11 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 11 times.
D4 · Code Duplication · Near-duplicate member family (10 members, 7 shared lines) · ×1
  • Near-duplicate member family (10 members, 7 shared lines) REDACTED:105 — REDACTED:105-353 | contrib/AutoNUE/scripts/train.py:68-277 | contrib/CityscapesSOTA/scripts/train.py:76-281 | contrib/LaneSeg/core/train.py:72-314 | contrib/MedicalSeg/medicalseg/core/train.py:49-283 | contrib/MedicalSeg/nnunet/core/train.py:47-257 | contrib/PanopticDeepLab/core/train.py:85-314 | contrib/PanopticSeg/paddlepanseg/core/train.py:71-297 | contrib/RSSegBenchmark/c2fnet/core/train.py:90-354 | deploy/slim/distill/distill_utils.py:90-364 — These 10 members are variants of one another: a block of 7 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 10 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 10 times.
D4 · Code Duplication · Near-duplicate member family (7 members, 77 shared lines) · ×1
  • Near-duplicate member family (7 members, 77 shared lines) contrib/AutoNUE/scripts/train.py:68 — contrib/AutoNUE/scripts/train.py:68-277 | contrib/CityscapesSOTA/scripts/train.py:76-281 | contrib/LaneSeg/core/train.py:72-314 | contrib/PanopticDeepLab/core/train.py:85-314 | contrib/PanopticSeg/paddlepanseg/core/train.py:71-297 | contrib/RSSegBenchmark/c2fnet/core/train.py:90-354 | deploy/slim/distill/distill_utils.py:90-364 — These 7 members are variants of one another: a block of 77 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 7 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 7 times.
D4 · Code Duplication · Near-duplicate member family (7 members, 56 shared lines) · ×1
  • Near-duplicate member family (7 members, 56 shared lines) contrib/AutoNUE/train.py:26 — contrib/AutoNUE/train.py:26-95 | contrib/CityscapesSOTA/train.py:26-95 | contrib/DomainAdaptation/train.py:29-113 | contrib/LaneSeg/train.py:29-119 | contrib/MedicalSeg/train.py:28-132 | contrib/PanopticDeepLab/train.py:27-114 | deploy/slim/quant/qat_train.py:33-122 — These 7 members are variants of one another: a block of 56 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 7 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 7 times.
D4 · Code Duplication · Near-duplicate member family (6 members, 33 shared lines) · ×1
  • Near-duplicate member family (6 members, 33 shared lines) paddleseg/datasets/chase_db1.py:50 — paddleseg/datasets/chase_db1.py:50-100 | paddleseg/datasets/drive.py:48-98 | paddleseg/datasets/hrf.py:47-97 | paddleseg/datasets/mini_deep_globe_road_extraction.py:48-97 | paddleseg/datasets/optic_disc_seg.py:47-99 | paddleseg/datasets/stare.py:47-97 — These 6 members are variants of one another: a block of 33 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 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 · Near-duplicate member family (5 members, 38 shared lines) · ×1
  • Near-duplicate member family (5 members, 38 shared lines) Matting/ppmatting/models/backbone/hrnet.py:561 — Matting/ppmatting/models/backbone/hrnet.py:561-605 | contrib/AutoNUE/models/backbones/hrnet_nv.py:556-602 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:543-586 | paddleseg/models/backbones/hrnet.py:585-629 | paddleseg/models/backbones/uhrnet.py:745-792 — These 5 members are variants of one another: a block of 38 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 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 · Near-duplicate member family (5 members, 28 shared lines) · ×1
  • Near-duplicate member family (5 members, 28 shared lines) contrib/AutoNUE/train.py:99 — contrib/AutoNUE/train.py:99-146 | contrib/CityscapesSOTA/train.py:99-146 | contrib/LaneSeg/train.py:124-192 | contrib/MedicalSeg/train.py:137-227 | contrib/PanopticDeepLab/train.py:118-170 — These 5 members are variants of one another: a block of 28 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 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 · Near-duplicate member family (5 members, 15 shared lines) · ×1
  • Near-duplicate member family (5 members, 15 shared lines) Matting/ppmatting/models/backbone/hrnet.py:482 — Matting/ppmatting/models/backbone/hrnet.py:482-510 | contrib/AutoNUE/models/backbones/hrnet_nv.py:481-509 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:470-496 | paddleseg/models/backbones/hrnet.py:503-532 | paddleseg/models/backbones/uhrnet.py:672-698 — These 5 members are variants of one another: a block of 15 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 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 · Near-duplicate member family (4 members, 55 shared lines) · ×1
  • Near-duplicate member family (4 members, 55 shared lines) contrib/LaneSeg/core/train.py:72 — contrib/LaneSeg/core/train.py:72-314 | contrib/MedicalSeg/medicalseg/core/train.py:49-283 | contrib/PanopticDeepLab/core/train.py:85-314 | contrib/PanopticSeg/paddlepanseg/core/train.py:71-297 — These 4 members are variants of one another: a block of 55 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 family (4 members, 50 shared lines) · ×1
  • Near-duplicate member family (4 members, 50 shared lines) contrib/MedicalSeg/nnunet/utils/base_predictor.py:195 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:195-285 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:488-574 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:182-271 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:463-548 — These 4 members are variants of one another: a block of 50 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 family (4 members, 41 shared lines) · ×1
  • Near-duplicate member family (4 members, 41 shared lines) contrib/LaneSeg/train.py:124 — contrib/LaneSeg/train.py:124-192 | contrib/MedicalSeg/train.py:137-227 | contrib/RSSegBenchmark/c2fnet/train.py:162-264 | contrib/RSSegBenchmark/train.py:155-254 — These 4 members are variants of one another: a block of 41 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 family (4 members, 29 shared lines) · ×1
  • Near-duplicate member family (4 members, 29 shared lines) contrib/DomainAdaptation/train.py:117 — contrib/DomainAdaptation/train.py:117-195 | contrib/LaneSeg/train.py:124-192 | contrib/MedicalSeg/train.py:137-227 | contrib/PanopticDeepLab/train.py:118-170 — These 4 members are variants of one another: a block of 29 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 family (4 members, 28 shared lines) · ×1
  • Near-duplicate member family (4 members, 28 shared lines) Matting/deploy/python/infer.py:294 — Matting/deploy/python/infer.py:294-328 | contrib/MedicalSeg/deploy/python/infer.py:340-374 | contrib/PanopticSeg/deploy/python/infer.py:259-293 | deploy/python/infer.py:162-196 — These 4 members are variants of one another: a block of 28 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 family (4 members, 24 shared lines) · ×1
  • Near-duplicate member family (4 members, 24 shared lines) contrib/RSSegBenchmark/c2fnet/train.py:162 — contrib/RSSegBenchmark/c2fnet/train.py:162-264 | contrib/RSSegBenchmark/c2fnet/val.py:145-205 | contrib/RSSegBenchmark/train.py:155-254 | contrib/RSSegBenchmark/val.py:138-191 — These 4 members are variants of one another: a block of 24 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 family (4 members, 22 shared lines) · ×1
  • Near-duplicate member family (4 members, 22 shared lines) contrib/AutoNUE/core/predict_ensemble.py:54 — contrib/AutoNUE/core/predict_ensemble.py:54-151 | contrib/AutoNUE/core/predict_generate_autolabel.py:52-145 | contrib/RSSegBenchmark/c2fnet/core/predict.py:64-156 | paddleseg/core/predict.py:63-155 — These 4 members are variants of one another: a block of 22 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 family (4 members, 20 shared lines) · ×1
  • Near-duplicate member family (4 members, 20 shared lines) contrib/MedicalSeg/nnunet/utils/base_predictor.py:297 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:297-327 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:339-369 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:283-313 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:325-355 — These 4 members are variants of one another: a block of 20 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 family (3 members, 40 shared lines) · ×1
  • Near-duplicate member family (3 members, 40 shared lines) contrib/CrossPseudoSupervision/val.py:27 — contrib/CrossPseudoSupervision/val.py:27-102 | contrib/QualityInspector/tools/seg/val.py:26-101 | tools/val.py:26-107 — These 3 members are variants of one another: a block of 40 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 3 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 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 31 shared lines) · ×1
  • Near-duplicate member family (3 members, 31 shared lines) contrib/QualityInspector/qinspector/uad/utils/utils.py:299 — contrib/QualityInspector/qinspector/uad/utils/utils.py:299-359 | contrib/QualityInspector/tools/uad/padim/predict.py:164-214 | contrib/QualityInspector/tools/uad/padim/val.py:259-311 — These 3 members are variants of one another: a block of 31 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 3 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 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 18 shared lines) · ×1
  • Near-duplicate member family (3 members, 18 shared lines) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:265 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:265-324 | contrib/MedicalSeg/medicalseg/models/swinunet.py:353-381 | paddleseg/models/backbones/swin_transformer.py:436-474 — These 3 members are variants of one another: a block of 18 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 3 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 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 8 shared lines) · ×1
  • Near-duplicate member family (3 members, 8 shared lines) contrib/CrossPseudoSupervision/utils/utils.py:25 — contrib/CrossPseudoSupervision/utils/utils.py:25-50 | contrib/MedicalSeg/medicalseg/utils/utils.py:116-135 | paddleseg/utils/utils.py:192-211 — These 3 members are variants of one another: a block of 8 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 3 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 3 times.
D4 · Code Duplication · Near-duplicate member pair (65 shared lines) · ×1
  • Near-duplicate member pair (65 shared lines) contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:106 — contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:106-191 | contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.py:643-726 — These two members are variants of one another: 65 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 (61 shared lines) · ×1
  • Near-duplicate member pair (61 shared lines) Matting/ppmatting/models/backbone/hrnet.py:77 — Matting/ppmatting/models/backbone/hrnet.py:77-161 | paddleseg/models/backbones/hrnet.py:79-164 — These two members are variants of one another: 61 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 (58 shared lines) · ×1
  • Near-duplicate member pair (58 shared lines) contrib/AutoNUE/models/backbones/hrnet_nv.py:77 — contrib/AutoNUE/models/backbones/hrnet_nv.py:77-157 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:79-151 — These two members are variants of one another: 58 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 (41 shared lines) · ×1
  • Near-duplicate member pair (41 shared lines) contrib/MedicalSeg/nnunet/datasets/dataloader.py:106 — contrib/MedicalSeg/nnunet/datasets/dataloader.py:106-257 | contrib/MedicalSeg/nnunet/datasets/dataloader.py:309-455 — These two members are variants of one another: 41 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 (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) contrib/MedicalSeg/medicalseg/transforms/functional.py:310 — contrib/MedicalSeg/medicalseg/transforms/functional.py:310-360 | contrib/MedicalSeg/nnunet/transforms/functional.py:216-263 — These two members are variants of one another: 40 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 (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:122 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:122-174 | paddleseg/models/losses/binary_cross_entropy_loss.py:122-177 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (33 shared lines) · ×1
  • Near-duplicate member pair (33 shared lines) contrib/QualityInspector/tools/uad/padim/predict.py:70 — contrib/QualityInspector/tools/uad/padim/predict.py:70-160 | contrib/QualityInspector/tools/uad/padim/val.py:132-255 — These two members are variants of one another: 33 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 (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) contrib/MedicalSeg/medicalseg/models/nnformer.py:407 — contrib/MedicalSeg/medicalseg/models/nnformer.py:407-463 | contrib/MedicalSeg/medicalseg/models/nnformer.py:511-576 — These two members are variants of one another: 30 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 (29 shared lines) · ×1
  • Near-duplicate member pair (29 shared lines) paddleseg/models/backbones/seaformer.py:352 — paddleseg/models/backbones/seaformer.py:352-395 | paddleseg/models/backbones/strideformer.py:482-533 — These two members are variants of one another: 29 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 (27 shared lines) · ×1
  • Near-duplicate member pair (27 shared lines) contrib/QualityInspector/tools/dataset/labelme2seg.py:40 — contrib/QualityInspector/tools/dataset/labelme2seg.py:40-98 | tools/data/labelme2seg.py:79-139 — These two members are variants of one another: 27 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) contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:40 — contrib/CrossPseudoSupervision/models/losses/probohem_cross_entropy_loss.py:40-96 | paddleseg/models/losses/ohem_edge_attention_loss.py:49-116 — 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 · Members sharing a duplicated core (40 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (40 members, 50+ identical tokens) Matting/ppmatting/models/backbone/hrnet.py:639 — Matting/ppmatting/models/backbone/hrnet.py:639-652 | Matting/ppmatting/models/backbone/hrnet.py:657-670 | Matting/ppmatting/models/backbone/hrnet.py:675-688 | Matting/ppmatting/models/backbone/hrnet.py:693-706 | Matting/ppmatting/models/backbone/hrnet.py:711-724 | Matting/ppmatting/models/backbone/hrnet.py:729-742 | Matting/ppmatting/models/backbone/hrnet.py:747-760 | Matting/ppmatting/models/backbone/hrnet.py:765-778 | Matting/ppmatting/models/backbone/hrnet.py:783-796 | Matting/ppmatting/models/backbone/hrnet.py:801-814 | contrib/AutoNUE/models/backbones/hrnet_nv.py:637-651 | contrib/AutoNUE/models/backbones/hrnet_nv.py:656-670 | contrib/AutoNUE/models/backbones/hrnet_nv.py:675-689 | contrib/AutoNUE/models/backbones/hrnet_nv.py:694-708 | contrib/AutoNUE/models/backbones/hrnet_nv.py:713-727 | contrib/AutoNUE/models/backbones/hrnet_nv.py:732-746 | contrib/AutoNUE/models/backbones/hrnet_nv.py:751-765 | contrib/AutoNUE/models/backbones/hrnet_nv.py:770-784 | contrib/AutoNUE/models/backbones/hrnet_nv.py:789-803 | contrib/AutoNUE/models/backbones/hrnet_nv.py:808-822 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:620-633 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:638-651 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:656-669 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:674-687 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:692-705 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:710-723 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:728-741 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:746-759 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:764-777 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:782-795 | paddleseg/models/backbones/hrnet.py:663-676 | paddleseg/models/backbones/hrnet.py:681-694 | paddleseg/models/backbones/hrnet.py:699-712 | paddleseg/models/backbones/hrnet.py:717-730 | paddleseg/models/backbones/hrnet.py:735-748 | paddleseg/models/backbones/hrnet.py:753-766 | paddleseg/models/backbones/hrnet.py:771-784 | paddleseg/models/backbones/hrnet.py:789-802 | paddleseg/models/backbones/hrnet.py:807-820 | paddleseg/models/backbones/hrnet.py:825-838 — These 40 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 40 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 40 times.
D4 · Code Duplication · Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (16 members, 50+ identical tokens) Matting/ppmatting/models/backbone/hrnet.py:185 — Matting/ppmatting/models/backbone/hrnet.py:185-192 | Matting/ppmatting/models/backbone/stdcnet.py:104-111 | contrib/AutoNUE/models/backbones/hrnet_nv.py:192-199 | contrib/AutoNUE/models/ocrnet_nv.py:149-155 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:186-193 | contrib/CityscapesSOTA/models/ocrnet_nv.py:158-164 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:332-337 | paddleseg/models/backbones/efficientformerv2.py:178-193 | paddleseg/models/backbones/hrformer.py:981-996 | paddleseg/models/backbones/hrnet.py:199-206 | paddleseg/models/backbones/stdcnet.py:111-118 | paddleseg/models/backbones/uhrnet.py:366-373 | paddleseg/models/fcn.py:137-142 | paddleseg/models/mscale_ocrnet.py:369-375 | paddleseg/models/ocrnet.py:141-147 | paddleseg/models/pphumanseg_lite.py:95-102 — These 16 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 16 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 16 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Matting/ppmatting/core/predict.py:80 — Matting/ppmatting/core/predict.py:80-90 | contrib/AutoNUE/core/infer.py:66-77 | contrib/AutoNUE/core/infer_crop.py:66-77 | contrib/AutoNUE/core/infer_ensemble.py:66-77 | contrib/AutoNUE/core/infer_ensemble_three.py:66-77 | contrib/AutoNUE/core/infer_generate_autolabel.py:66-77 | contrib/LaneSeg/core/infer.py:108-132 | contrib/PanopticDeepLab/core/infer.py:79-90 — 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 (116 corresponding lines) · ×1
  • Edited copy of a member (116 corresponding lines) Matting/ppmatting/models/backbone/resnet_vd.py:200 — Matting/ppmatting/models/backbone/resnet_vd.py:200-315 | paddleseg/models/backbones/resnet_vd.py:221-348 — These two members are one piece of code written twice and then edited apart: 116 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 (87 corresponding lines) · ×1
  • Edited copy of a member (87 corresponding lines) contrib/PanopticDeepLab/transforms/target_transforms.py:61 — contrib/PanopticDeepLab/transforms/target_transforms.py:61-181 | contrib/PanopticSeg/paddlepanseg/transforms/generate_targets/panoptic_deeplab.py:46-132 — These two members are one piece of code written twice and then edited apart: 87 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 (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:273 — contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:273-351 | contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:519-594 — These two members are one piece of code written twice and then edited apart: 76 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 (123 corresponding lines) · ×1
  • Edited copy of a member (123 corresponding lines) contrib/RSSegBenchmark/c2fnet/train.py:30 — contrib/RSSegBenchmark/c2fnet/train.py:30-158 | contrib/RSSegBenchmark/train.py:29-151 — These two members are one piece of code written twice and then edited apart: 123 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 (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) contrib/DomainAdaptation/models/gscnn.py:88 — contrib/DomainAdaptation/models/gscnn.py:88-154 | paddleseg/models/gscnn.py:144-217 — These two members are one piece of code written twice and then edited apart: 67 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 (71 corresponding lines) · ×1
  • Edited copy of a member (71 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/instance.py:69 — contrib/PanopticDeepLab/utils/evaluation/instance.py:69-139 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:51-121 — These two members are one piece of code written twice and then edited apart: 71 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 (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) EISeg/eiseg/inference/predictor/ops.py:43 — EISeg/eiseg/inference/predictor/ops.py:43-91 | EISeg/med3d/EISegMed3D/inference/ops.py:97-165 — These two members are one piece of code written twice and then edited apart: 49 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 (74 corresponding lines) · ×1
  • Edited copy of a member (74 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/panoptic.py:127 — contrib/PanopticDeepLab/utils/evaluation/panoptic.py:127-200 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/pan_seg_evaluator.py:123-204 — These two members are one piece of code written twice and then edited apart: 74 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) contrib/QualityInspector/tools/uad/padim/train.py:78 — contrib/QualityInspector/tools/uad/padim/train.py:78-149 | contrib/QualityInspector/tools/uad/patchcore/train.py:102-173 — 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) paddleseg/models/ddrnet.py:297 — paddleseg/models/ddrnet.py:297-371 | paddleseg/models/rtformer.py:583-639 — 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 (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) contrib/PanopticDeepLab/utils/evaluation/instance.py:153 — contrib/PanopticDeepLab/utils/evaluation/instance.py:153-227 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:135-209 — 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 (105 corresponding lines) · ×1
  • Edited copy of a member (105 corresponding lines) contrib/MedicalSeg/nnunet/infer.py:42 — contrib/MedicalSeg/nnunet/infer.py:42-146 | contrib/MedicalSeg/nnunet/predict.py:35-158 — These two members are one piece of code written twice and then edited apart: 105 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 (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) paddleseg/datasets/eg1800.py:55 — paddleseg/datasets/eg1800.py:55-101 | paddleseg/datasets/supervisely.py:55-100 — 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 copies of one member (5 members, 93+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 93+ corresponding lines) Matting/deploy/python/infer.py:40 — Matting/deploy/python/infer.py:40-146 | contrib/MedicalSeg/deploy/python/infer.py:42-154 | contrib/PanopticSeg/deploy/python/infer.py:32-124 | deploy/python/infer_benchmark.py:30-128 | deploy/python/infer_dataset.py:34-137 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 93 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) contrib/CrossPseudoSupervision/train.py:108 — contrib/CrossPseudoSupervision/train.py:108-168 | contrib/QualityInspector/tools/seg/train.py:132-190 — These two members are one piece of code written twice and then edited apart: 59 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) EISeg/med3d/EISegMed3D/inference/models.py:397 — EISeg/med3d/EISegMed3D/inference/models.py:397-456 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:200-263 — 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 (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) contrib/MedicalSeg/medicalseg/utils/download.py:123 — contrib/MedicalSeg/medicalseg/utils/download.py:123-163 | paddleseg/utils/download.py:124-180 — These two members are one piece of code written twice and then edited apart: 41 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 (4 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 34+ corresponding lines) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:186 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:186-230 | contrib/MedicalSeg/medicalseg/models/nnformer.py:229-264 | contrib/MedicalSeg/medicalseg/models/nnformer.py:326-359 | paddleseg/models/backbones/swin_transformer.py:153-193 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 34 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 70+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 70+ corresponding lines) contrib/CrossPseudoSupervision/predict.py:29 — contrib/CrossPseudoSupervision/predict.py:29-98 | contrib/QualityInspector/tools/seg/predict.py:27-96 | tools/analyse.py:24-109 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 70 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 copies of one member (3 members, 71+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 71+ corresponding lines) contrib/QualityInspector/tools/det/eval.py:42 — contrib/QualityInspector/tools/det/eval.py:42-119 | contrib/QualityInspector/tools/det/infer.py:42-122 | contrib/QualityInspector/tools/det/train.py:42-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 71 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 copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) contrib/PanopticSeg/paddlepanseg/core/infer.py:20 — contrib/PanopticSeg/paddlepanseg/core/infer.py:20-53 | contrib/RSSegBenchmark/c2fnet/core/infer.py:25-46 | paddleseg/core/infer.py:26-47 — 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 (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) contrib/MedicalSeg/medicalseg/utils/utils.py:77 — contrib/MedicalSeg/medicalseg/utils/utils.py:77-112 | paddleseg/utils/utils.py:152-188 — 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 (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) Matting/ppmatting/models/backbone/mobilenet_v2.py:170 — Matting/ppmatting/models/backbone/mobilenet_v2.py:170-220 | paddleseg/models/backbones/mobilenetv2.py:51-98 — These two members are one piece of code written twice and then edited apart: 48 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, 42+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 42+ corresponding lines) contrib/QualityInspector/tools/det/eval.py:156 — contrib/QualityInspector/tools/det/eval.py:156-197 | contrib/QualityInspector/tools/det/infer.py:189-230 | contrib/QualityInspector/tools/det/train.py:150-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 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 (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:89 — contrib/MedicalSeg/medicalseg/models/losses/binary_cross_entropy_loss.py:89-119 | paddleseg/models/losses/binary_cross_entropy_loss.py:89-119 — 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 copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) paddleseg/models/ann.py:326 — paddleseg/models/ann.py:326-351 | paddleseg/models/ann.py:396-423 | paddleseg/models/ocrnet.py:220-247 — 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 copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:11 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:11-37 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:48-78 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Utils.java:11-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 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 copies of one member (3 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 31+ corresponding lines) contrib/CityscapesSOTA/export.py:27 — contrib/CityscapesSOTA/export.py:27-57 | contrib/PP-HumanSeg/src/seg_demo.py:31-68 | deploy/slim/quant/qat_export.py:30-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 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 copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) contrib/AutoNUE/val.py:94 — contrib/AutoNUE/val.py:94-129 | contrib/MedicalSeg/nnunet/single_fold_eval.py:279-311 | contrib/PanopticDeepLab/val.py:69-104 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 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 copies of one member (4 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 27+ corresponding lines) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:449 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:449-477 | contrib/MedicalSeg/medicalseg/models/swinunet.py:317-349 | contrib/SegmentAnything/segment_anything/modeling/tiny_vit_sam.py:575-603 | paddleseg/models/backbones/swin_transformer.py:407-433 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) contrib/CrossPseudoSupervision/predict.py:120 — contrib/CrossPseudoSupervision/predict.py:120-142 | contrib/QualityInspector/tools/seg/predict.py:118-140 | tools/analyse.py:131-154 | tools/predict.py:134-160 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) Matting/ppmatting/transforms/transforms.py:401 — Matting/ppmatting/transforms/transforms.py:401-417 | Matting/ppmatting/transforms/transforms.py:460-476 | paddleseg/transforms/transforms.py:299-315 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 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 copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) contrib/MedicalSeg/nnunet/utils/base_predictor.py:718 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:718-739 | contrib/MedicalSeg/nnunet/utils/cascade_utils.py:42-65 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:669-688 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 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 copies of one member (5 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 24+ corresponding lines) contrib/QualityInspector/tools/convert_tools/convert_coco_to_RoI_mask.py:30 — contrib/QualityInspector/tools/convert_tools/convert_coco_to_RoI_mask.py:30-66 | contrib/QualityInspector/tools/convert_tools/convert_mask_to_RoI.py:29-66 | contrib/QualityInspector/tools/convert_tools/convert_mask_to_coco.py:25-59 | contrib/SegmentAnything/scripts/promt_predict.py:43-72 | deploy/fastdeploy/matting/cpu-gpu/python/infer.py:7-30 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 24 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) contrib/MedicalSeg/nnunet/datasets/dataset.py:518 — contrib/MedicalSeg/nnunet/datasets/dataset.py:518-530 | contrib/MedicalSeg/tools/preprocess_utils/file_and_folder_operations.py:29-41 | contrib/MedicalSeg/tools/preprocess_utils/file_and_folder_operations.py:49-61 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 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 copies of one member (6 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 22+ corresponding lines) contrib/MedicalSeg/medicalseg/utils/metric.py:111 — contrib/MedicalSeg/medicalseg/utils/metric.py:111-135 | contrib/MedicalSeg/medicalseg/utils/metric.py:139-163 | contrib/MedicalSeg/medicalseg/utils/metric.py:167-188 | paddleseg/utils/metrics.py:122-146 | paddleseg/utils/metrics.py:150-174 | paddleseg/utils/metrics.py:179-200 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 8+ corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:61 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:61-68 | Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:70-77 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:102-109 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:111-118 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Utils.java:61-68 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Utils.java:70-77 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 16+ corresponding lines) Matting/ppmatting/models/backbone/gca_enc.py:361 — Matting/ppmatting/models/backbone/gca_enc.py:361-376 | contrib/CrossPseudoSupervision/models/backbones/resnet.py:56-71 | contrib/CrossPseudoSupervision/models/backbones/resnet.py:119-138 | contrib/DomainAdaptation/models/backbones/resnet.py:62-81 | contrib/RSSegBenchmark/backbones/resnet.py:57-72 | contrib/RSSegBenchmark/backbones/resnet.py:115-134 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) contrib/PanopticSeg/tools/predict.py:25 — contrib/PanopticSeg/tools/predict.py:25-46 | contrib/QualityInspector/tools/dataset/visualize_annotation.py:37-54 | test_tipc/serving_cpp/serving_client.py:26-42 | test_tipc/serving_python/web_service.py:30-49 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) contrib/MedicalSeg/deploy/python/infer.py:514 — contrib/MedicalSeg/deploy/python/infer.py:514-518 | deploy/python/infer.py:263-268 | deploy/python/infer_benchmark.py:179-184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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 copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) contrib/QualityInspector/qinspector/uad/utils/utils.py:285 — contrib/QualityInspector/qinspector/uad/utils/utils.py:285-288 | contrib/QualityInspector/tools/uad/padim/predict.py:218-221 | contrib/QualityInspector/tools/uad/padim/val.py:315-318 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 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 copies of one member (6 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 10+ corresponding lines) contrib/CityscapesSOTA/models/ocrnet_nv.py:65 — contrib/CityscapesSOTA/models/ocrnet_nv.py:65-81 | paddleseg/models/danet.py:49-59 | paddleseg/models/dnlnet.py:60-69 | paddleseg/models/emanet.py:62-72 | paddleseg/models/isanet.py:53-62 | paddleseg/models/ocrnet.py:54-67 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) paddleseg/models/layers/layer_libs.py:192 — paddleseg/models/layers/layer_libs.py:192-208 | paddleseg/models/layers/layer_libs.py:228-245 | paddleseg/models/layers/layer_libs.py:265-281 | paddleseg/models/layers/layer_libs.py:526-539 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 6+ corresponding lines) contrib/MedicalSeg/nnunet/transforms/transform.py:220 — contrib/MedicalSeg/nnunet/transforms/transform.py:220-225 | contrib/MedicalSeg/nnunet/transforms/transform.py:246-255 | contrib/MedicalSeg/nnunet/transforms/transform.py:270-275 | contrib/MedicalSeg/nnunet/transforms/transform.py:327-335 | contrib/MedicalSeg/nnunet/transforms/transform.py:390-398 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) contrib/PanopticDeepLab/models/panoptic_deeplab.py:65 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:65-79 | paddleseg/models/ann.py:57-69 | paddleseg/models/deeplab.py:60-78 | paddleseg/models/fcn.py:54-72 | paddleseg/models/glore.py:56-68 | paddleseg/models/pspnet.py:54-66 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 13 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) Matting/ppmatting/models/backbone/hrnet.py:418 — Matting/ppmatting/models/backbone/hrnet.py:418-430 | paddleseg/models/backbones/hrnet.py:437-450 | paddleseg/models/backbones/resnet_vd.py:128-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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 copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) contrib/LaneSeg/deploy/python/infer.py:60 — contrib/LaneSeg/deploy/python/infer.py:60-66 | contrib/MedicalSeg/deploy/python/infer.py:195-202 | contrib/PP-HumanSeg/src/infer.py:69-75 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 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 copies of one member (3 members, 2+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 2+ corresponding lines) EISeg/eiseg/util/manager.py:14 — EISeg/eiseg/util/manager.py:14-15 | contrib/MedicalSeg/medicalseg/cvlibs/manager.py:76-77 | paddleseg/cvlibs/manager.py:74-75 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 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 (2 corresponding lines) · ×1
  • Edited copy of a member (2 corresponding lines) paddleseg/models/backbones/mix_transformer.py:475 — paddleseg/models/backbones/mix_transformer.py:475-477 | paddleseg/models/layers/vit_adapter_layers.py:57-58 — These two members are one piece of code written twice and then edited apart: 2 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 (137 lines × 2) · ×1
  • Duplicated block (137 lines × 2) contrib/MedicalSeg/medicalseg/utils/progbar.py:69 — contrib/MedicalSeg/medicalseg/utils/progbar.py:69-205 | paddleseg/utils/progbar.py:69-205 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/progbar.py` and `paddleseg/utils/progbar.py` as WHOLE FILES: 100% 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. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/MedicalSeg/medicalseg/utils/progbar.py:69` 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 (83 lines × 2) · ×1
  • Duplicated block (83 lines × 2) contrib/QualityInspector/tools/seg/model/analyze_model.py:48 — contrib/QualityInspector/tools/seg/model/analyze_model.py:48-130 | tools/model/analyze_model.py:48-130 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/analyze_model.py` and `tools/model/analyze_model.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 118 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 (70–72 lines × 2) · ×1
  • Duplicated block (70–72 lines × 2) contrib/RSSegBenchmark/c2fnet/core/val.py:83 — contrib/RSSegBenchmark/c2fnet/core/val.py:83-152 | paddleseg/core/val.py:77-148 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/val.py` and `paddleseg/core/val.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 209 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 (67 lines × 2) · ×1
  • Duplicated block (67 lines × 2) contrib/PanopticDeepLab/utils/evaluation/instance.py:161 — contrib/PanopticDeepLab/utils/evaluation/instance.py:161-227 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:143-209 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/instance.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 228 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 (65–66 lines × 2) · ×1
  • Duplicated block (65–66 lines × 2) contrib/PanopticDeepLab/utils/evaluation/instance.py:241 — contrib/PanopticDeepLab/utils/evaluation/instance.py:241-306 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:223-287 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/instance.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 228 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 `contrib/PanopticDeepLab/utils/evaluation/instance.py:241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) paddleseg/models/u2net.py:83 — paddleseg/models/u2net.py:83-144 | paddleseg/models/u2net.py:197-258 — 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.
D4 · Code Duplication · Duplicated block (58–59 lines × 2) · ×1
  • Duplicated block (58–59 lines × 2) contrib/AutoNUE/models/mscale_ocrnet.py:171 — contrib/AutoNUE/models/mscale_ocrnet.py:171-229 | contrib/CityscapesSOTA/models/mscale_ocrnet.py:92-149 — before extracting anything, compare `contrib/AutoNUE/models/mscale_ocrnet.py` and `contrib/CityscapesSOTA/models/mscale_ocrnet.py` as WHOLE FILES: this scan already matched 5 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 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, `contrib/CityscapesSOTA/models/mscale_ocrnet.py:87` calls `extend` and `contrib/AutoNUE/models/mscale_ocrnet.py:166` 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 (58 lines × 2) · ×1
  • Duplicated block (58 lines × 2) contrib/RSSegBenchmark/c2fnet/train.py:101 — contrib/RSSegBenchmark/c2fnet/train.py:101-158 | contrib/RSSegBenchmark/train.py:94-151 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/train.py` and `contrib/RSSegBenchmark/train.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 390 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 `contrib/RSSegBenchmark/c2fnet/train.py:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (56 lines × 3) · ×1
  • Duplicated block (56 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:397 — EISeg/med3d/EISegMed3D/inference/models.py:397-452 | contrib/MedicalSeg/medicalseg/models/vnet.py:191-246 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:200-255 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) contrib/RSSegBenchmark/c2fnet/core/val.py:192 — contrib/RSSegBenchmark/c2fnet/core/val.py:192-247 | paddleseg/core/val.py:189-244 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/val.py` and `paddleseg/core/val.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 209 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 (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) contrib/PanopticDeepLab/utils/evaluation/instance.py:86 — contrib/PanopticDeepLab/utils/evaluation/instance.py:86-139 | contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py:68-121 — before extracting anything, compare `contrib/PanopticDeepLab/utils/evaluation/instance.py` and `contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 228 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 (46 lines × 12) · ×1
  • Duplicated block (46 lines × 12) contrib/AutoNUE/predict.py:49 — contrib/AutoNUE/predict.py:49-94 | contrib/AutoNUE/predict_ensemble.py:61-106 | contrib/AutoNUE/predict_ensemble_three.py:73-118 | contrib/AutoNUE/val.py:43-88 | contrib/CityscapesSOTA/predict.py:49-94 | contrib/CityscapesSOTA/val.py:43-88 | contrib/DomainAdaptation/val.py:67-112 | contrib/RSSegBenchmark/c2fnet/predict.py:57-102 | contrib/RSSegBenchmark/c2fnet/val.py:72-117 | contrib/RSSegBenchmark/predict.py:50-95 | contrib/RSSegBenchmark/val.py:65-110 | deploy/slim/quant/qat_val.py:64-109 — before extracting anything, compare `contrib/AutoNUE/predict.py` and `contrib/AutoNUE/predict_ensemble.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 188 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 `contrib/AutoNUE/predict.py:49` 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 (46 lines × 2) · ×1
  • Duplicated block (46 lines × 2) contrib/MedicalSeg/medicalseg/transforms/functional.py:369 — contrib/MedicalSeg/medicalseg/transforms/functional.py:369-414 | contrib/MedicalSeg/nnunet/transforms/functional.py:160-205 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (44 lines × 3) · ×1
  • Duplicated block (44 lines × 3) contrib/DomainAdaptation/cvlibs/config.py:248 — contrib/DomainAdaptation/cvlibs/config.py:248-291 | contrib/MedicalSeg/medicalseg/cvlibs/config.py:253-296 | contrib/RSSegBenchmark/c2fnet/cvlibs/config.py:325-368 — before extracting anything, compare `contrib/DomainAdaptation/cvlibs/config.py` and `contrib/MedicalSeg/medicalseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 182 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 (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) contrib/PanopticDeepLab/models/panoptic_deeplab.py:333 — contrib/PanopticDeepLab/models/panoptic_deeplab.py:333-376 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:338-381 — before extracting anything, compare `contrib/PanopticDeepLab/models/panoptic_deeplab.py` and `contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 237 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 (40–43 lines × 2) · ×1
  • Duplicated block (40–43 lines × 2) contrib/QualityInspector/tools/seg/train.py:87 — contrib/QualityInspector/tools/seg/train.py:87-126 | tools/train.py:90-132 — before extracting anything, compare `contrib/QualityInspector/tools/seg/train.py` and `tools/train.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 183 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 `contrib/QualityInspector/tools/seg/train.py:87` 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 (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) contrib/DomainAdaptation/models/gscnn.py:211 — contrib/DomainAdaptation/models/gscnn.py:211-252 | paddleseg/models/gscnn.py:274-315 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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 (38–41 lines × 3) · ×1
  • Duplicated block (38–41 lines × 3) contrib/CrossPseudoSupervision/train.py:25 — contrib/CrossPseudoSupervision/train.py:25-64 | contrib/QualityInspector/tools/seg/train.py:28-68 | tools/train.py:31-68 — before extracting anything, compare `contrib/CrossPseudoSupervision/train.py` and `contrib/QualityInspector/tools/seg/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 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 `contrib/CrossPseudoSupervision/train.py:25` 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 (61 lines × 2) · ×1
  • Duplicated block (61 lines × 2) contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:282 — contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:282-342 | contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:527-587 — 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, `contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:589` calls `ones` and `contrib/MedicalSeg/tools/preprocess_utils/preprocessing.py:343` 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 (40 lines × 7) · ×1
  • Duplicated block (40 lines × 7) contrib/CrossPseudoSupervision/predict.py:54 — contrib/CrossPseudoSupervision/predict.py:54-93 | contrib/CrossPseudoSupervision/val.py:48-87 | contrib/QualityInspector/tools/seg/predict.py:52-91 | contrib/QualityInspector/tools/seg/val.py:47-86 | tools/analyse.py:59-98 | tools/predict.py:57-96 | tools/val.py:47-86 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 `contrib/CrossPseudoSupervision/predict.py:54` 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 (36–39 lines × 3) · ×1
  • Duplicated block (36–39 lines × 3) contrib/AutoNUE/models/backbones/hrnet_nv.py:564 — contrib/AutoNUE/models/backbones/hrnet_nv.py:564-602 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:551-586 | paddleseg/models/backbones/uhrnet.py:753-788 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) contrib/AutoNUE/scripts/train.py:68 — contrib/AutoNUE/scripts/train.py:68-105 | contrib/CityscapesSOTA/scripts/train.py:76-113 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:68` 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 (35–37 lines × 2) · ×1
  • Duplicated block (35–37 lines × 2) contrib/QualityInspector/tools/det/eval.py:81 — contrib/QualityInspector/tools/det/eval.py:81-117 | contrib/QualityInspector/tools/det/infer.py:81-115 — 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 `contrib/QualityInspector/tools/det/eval.py:81` 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 (63 lines × 2) · ×1
  • Duplicated block (63 lines × 2) contrib/DomainAdaptation/models/gscnn.py:88 — contrib/DomainAdaptation/models/gscnn.py:88-150 | paddleseg/models/gscnn.py:144-206 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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 (35 lines × 3) · ×1
  • Duplicated block (35 lines × 3) Matting/tools/train.py:47 — Matting/tools/train.py:47-81 | contrib/RSSegBenchmark/c2fnet/train.py:44-78 | contrib/RSSegBenchmark/train.py:37-71 — before extracting anything, compare `Matting/tools/train.py` and `contrib/RSSegBenchmark/c2fnet/train.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 170 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 `Matting/tools/train.py:47` 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 (34 lines × 11) · ×1
  • Duplicated block (34 lines × 11) Matting/tools/train.py:70 — Matting/tools/train.py:70-103 | contrib/AutoNUE/train.py:52-85 | contrib/CityscapesSOTA/train.py:52-85 | contrib/DomainAdaptation/train.py:56-89 | contrib/LaneSeg/train.py:55-88 | contrib/MedicalSeg/train.py:54-87 | contrib/PanopticDeepLab/train.py:53-86 | contrib/RSSegBenchmark/c2fnet/train.py:67-100 | contrib/RSSegBenchmark/train.py:60-93 | deploy/slim/distill/distill_train.py:61-94 | deploy/slim/quant/qat_train.py:58-91 — before extracting anything, compare `Matting/tools/train.py` and `contrib/AutoNUE/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `Matting/tools/train.py:70` 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 (31–34 lines × 3) · ×1
  • Duplicated block (31–34 lines × 3) contrib/QualityInspector/tools/seg/model/export_onnx.py:85 — contrib/QualityInspector/tools/seg/model/export_onnx.py:85-115 | deploy/python/infer_onnx_trt.py:397-430 | tools/model/export_onnx.py:85-115 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/export_onnx.py` and `deploy/python/infer_onnx_trt.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 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 × 2) · ×1
  • Duplicated block (33–34 lines × 2) paddleseg/models/backbones/stdcnet.py:194 — paddleseg/models/backbones/stdcnet.py:194-226 | paddleseg/models/backbones/stdcnet.py:272-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. Read the line range as the matched WINDOW rather than a finished unit: at `paddleseg/models/backbones/stdcnet.py:194` 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 (29–33 lines × 3) · ×1
  • Duplicated block (29–33 lines × 3) contrib/AutoNUE/models/backbones/hrnet_nv.py:385 — contrib/AutoNUE/models/backbones/hrnet_nv.py:385-417 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:376-404 | paddleseg/models/backbones/uhrnet.py:578-606 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 (32–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) contrib/CrossPseudoSupervision/cvlibs/config.py:214 — contrib/CrossPseudoSupervision/cvlibs/config.py:214-246 | paddleseg/cvlibs/config.py:206-237 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/config.py` and `paddleseg/cvlibs/config.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 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 (32 lines × 5) · ×1
  • Duplicated block (32 lines × 5) REDACTED:105 — REDACTED:105-139 | contrib/LaneSeg/core/train.py:72-103 | contrib/MedicalSeg/medicalseg/core/train.py:49-82 | contrib/PanopticDeepLab/core/train.py:85-116 | contrib/PanopticSeg/paddlepanseg/core/train.py:71-109 — before extracting anything, compare `REDACTED` and `contrib/LaneSeg/core/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `REDACTED:105` 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 (28–32 lines × 3) · ×1
  • Duplicated block (28–32 lines × 3) contrib/AutoNUE/models/backbones/hrnet_nv.py:319 — contrib/AutoNUE/models/backbones/hrnet_nv.py:319-350 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:314-341 | paddleseg/models/backbones/uhrnet.py:515-542 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 `contrib/AutoNUE/models/backbones/hrnet_nv.py:319` 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 lines × 3) · ×1
  • Duplicated block (32 lines × 3) contrib/QualityInspector/tools/det/eval.py:156 — contrib/QualityInspector/tools/det/eval.py:156-187 | contrib/QualityInspector/tools/det/infer.py:189-220 | contrib/QualityInspector/tools/det/train.py:150-181 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (29–32 lines × 2) · ×1
  • Duplicated block (29–32 lines × 2) deploy/python/infer.py:303 — deploy/python/infer.py:303-331 | deploy/python/infer_benchmark.py:72-103 — before extracting anything, compare `deploy/python/infer.py` and `deploy/python/infer_benchmark.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 128 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 `deploy/python/infer.py:303` 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 (19–31 lines × 9) · ×1
  • Duplicated block (19–31 lines × 9) Matting/tools/bg_replace.py:48 — Matting/tools/bg_replace.py:48-78 | contrib/AutoNUE/predict.py:33-53 | contrib/AutoNUE/predict_ensemble.py:45-65 | contrib/AutoNUE/predict_ensemble_three.py:57-77 | contrib/CityscapesSOTA/predict.py:33-53 | contrib/LaneSeg/predict.py:33-53 | contrib/PanopticDeepLab/predict.py:34-52 | contrib/RSSegBenchmark/c2fnet/predict.py:35-61 | contrib/RSSegBenchmark/predict.py:34-54 — before extracting anything, compare `contrib/AutoNUE/predict.py` and `contrib/AutoNUE/predict_ensemble.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 188 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 `Matting/tools/bg_replace.py:48` 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 (31 lines × 3) · ×1
  • Duplicated block (31 lines × 3) contrib/AutoNUE/core/infer.py:172 — contrib/AutoNUE/core/infer.py:172-202 | contrib/AutoNUE/core/infer_crop.py:172-202 | contrib/AutoNUE/core/infer_generate_autolabel.py:172-202 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) contrib/RSSegBenchmark/c2fnet/train.py:214 — contrib/RSSegBenchmark/c2fnet/train.py:214-244 | contrib/RSSegBenchmark/train.py:206-236 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/train.py` and `contrib/RSSegBenchmark/train.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 390 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 `contrib/RSSegBenchmark/c2fnet/train.py:214` 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 (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) paddleseg/models/espnetv1.py:138 — paddleseg/models/espnetv1.py:138-168 | paddleseg/models/espnetv1.py:205-234 — 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 `paddleseg/models/espnetv1.py:138` 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 (29–30 lines × 3) · ×1
  • Duplicated block (29–30 lines × 3) paddleseg/models/backbones/top_transformer.py:656 — paddleseg/models/backbones/top_transformer.py:656-685 | paddleseg/models/backbones/top_transformer.py:690-719 | paddleseg/models/backbones/top_transformer.py:724-752 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `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 (55–58 lines × 4) · ×1
  • Duplicated block (55–58 lines × 4) contrib/AutoNUE/datasets/auto_nue.py:64 — contrib/AutoNUE/datasets/auto_nue.py:64-121 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:64-121 | contrib/AutoNUE/datasets/auto_nue_crop.py:64-121 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:83-137 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/AutoNUE/datasets/auto_nue_autolabel.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 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–29 lines × 3) · ×1
  • Duplicated block (28–29 lines × 3) contrib/AutoNUE/models/mscale_ocrnet.py:82 — contrib/AutoNUE/models/mscale_ocrnet.py:82-110 | contrib/AutoNUE/models/mscale_ocrnet.py:128-156 | contrib/CityscapesSOTA/models/mscale_ocrnet.py:47-74 — before extracting anything, compare `contrib/AutoNUE/models/mscale_ocrnet.py` and `contrib/CityscapesSOTA/models/mscale_ocrnet.py` as WHOLE FILES: this scan already matched 5 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/AutoNUE/models/mscale_ocrnet.py:112` calls `scale_as` and `contrib/AutoNUE/models/mscale_ocrnet.py:159` 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 (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) contrib/LaneSeg/core/train.py:154 — contrib/LaneSeg/core/train.py:154-181 | deploy/slim/distill/distill_utils.py:176-204 — before extracting anything, compare `contrib/LaneSeg/core/train.py` and `deploy/slim/distill/distill_utils.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 240 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 (26–29 lines × 2) · ×1
  • Duplicated block (26–29 lines × 2) contrib/MedicalSeg/deploy/python/infer.py:42 — contrib/MedicalSeg/deploy/python/infer.py:42-70 | deploy/python/infer.py:272-297 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 297 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 `contrib/MedicalSeg/deploy/python/infer.py:42` 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 (27–29 lines × 2) · ×1
  • Duplicated block (27–29 lines × 2) contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:133 — contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:133-159 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:161-189 — 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 (27–28 lines × 5) · ×1
  • Duplicated block (27–28 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:608 — Matting/ppmatting/models/backbone/hrnet.py:608-634 | contrib/AutoNUE/models/backbones/hrnet_nv.py:605-632 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:589-615 | paddleseg/models/backbones/hrnet.py:632-658 | paddleseg/models/backbones/uhrnet.py:795-822 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 (23–28 lines × 4) · ×1
  • Duplicated block (23–28 lines × 4) contrib/CrossPseudoSupervision/predict.py:32 — contrib/CrossPseudoSupervision/predict.py:32-56 | contrib/QualityInspector/tools/seg/predict.py:30-54 | tools/analyse.py:27-54 | tools/predict.py:30-52 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 `contrib/CrossPseudoSupervision/predict.py:32` 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 (28 lines × 3) · ×1
  • Duplicated block (28 lines × 3) Matting/ppmatting/models/backbone/mobilenetv3.py:336 — Matting/ppmatting/models/backbone/mobilenetv3.py:336-363 | paddleseg/models/backbones/mobilenetv3.py:287-314 | paddleseg/models/backbones/strideformer.py:285-312 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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 `Matting/ppmatting/models/backbone/mobilenetv3.py:336` 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 (25–28 lines × 3) · ×1
  • Duplicated block (25–28 lines × 3) contrib/LaneSeg/val.py:92 — contrib/LaneSeg/val.py:92-119 | contrib/RSSegBenchmark/c2fnet/val.py:173-200 | contrib/RSSegBenchmark/val.py:165-189 — before extracting anything, compare `contrib/LaneSeg/val.py` and `contrib/RSSegBenchmark/c2fnet/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 `contrib/LaneSeg/val.py:92` 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 (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) paddleseg/models/knet.py:141 — paddleseg/models/knet.py:141-167 | paddleseg/models/upernet.py:139-166 — 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 (25–28 lines × 2) · ×1
  • Duplicated block (25–28 lines × 2) REDACTED:100 — REDACTED:100-124 | REDACTED:105-132 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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–27 lines × 7) · ×1
  • Duplicated block (26–27 lines × 7) contrib/AutoNUE/core/infer.py:215 — contrib/AutoNUE/core/infer.py:215-241 | contrib/AutoNUE/core/infer_crop.py:215-241 | contrib/AutoNUE/core/infer_ensemble.py:168-194 | contrib/AutoNUE/core/infer_ensemble_three.py:168-194 | contrib/AutoNUE/core/infer_generate_autolabel.py:215-241 | contrib/RSSegBenchmark/c2fnet/core/infer.py:217-242 | paddleseg/core/infer.py:204-230 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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–27 lines × 3) · ×1
  • Duplicated block (26–27 lines × 3) Matting/deploy/python/infer.py:102 — Matting/deploy/python/infer.py:102-128 | contrib/MedicalSeg/deploy/python/infer.py:76-102 | deploy/python/infer_dataset.py:86-111 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 `Matting/deploy/python/infer.py:102` 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 (25–27 lines × 2) · ×1
  • Duplicated block (25–27 lines × 2) Matting/ppmatting/models/backbone/mobilenet_v2.py:181 — Matting/ppmatting/models/backbone/mobilenet_v2.py:181-207 | paddleseg/models/backbones/mobilenetv2.py:67-91 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenet_v2.py` and `paddleseg/models/backbones/mobilenetv2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 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 `Matting/ppmatting/models/backbone/mobilenet_v2.py:181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `paddleseg/models/backbones/mobilenetv2.py:67` calls `ConvBNLayer` and `Matting/ppmatting/models/backbone/mobilenet_v2.py:181` 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) contrib/MedicalSeg/medicalseg/utils/metric.py:65 — contrib/MedicalSeg/medicalseg/utils/metric.py:65-107 | paddleseg/utils/metrics.py:76-118 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/metric.py` and `paddleseg/utils/metrics.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 106 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 (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) contrib/RSSegBenchmark/c2fnet/core/infer.py:140 — contrib/RSSegBenchmark/c2fnet/core/infer.py:140-165 | paddleseg/core/infer.py:152-178 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/core/infer.py` and `paddleseg/core/infer.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 145 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) contrib/QualityInspector/tools/uad/padim/predict.py:185 — contrib/QualityInspector/tools/uad/padim/predict.py:185-214 | contrib/QualityInspector/tools/uad/padim/val.py:283-311 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/predict.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 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, `contrib/QualityInspector/tools/uad/padim/val.py:281` calls `set_text`, `imshow` and `contrib/QualityInspector/tools/uad/padim/predict.py:184` 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–26 lines × 2) · ×1
  • Duplicated block (20–26 lines × 2) contrib/SegmentAnything/segment_anything/build_sam.py:72 — contrib/SegmentAnything/segment_anything/build_sam.py:72-97 | contrib/SegmentAnything/segment_anything/build_sam.py:134-153 — 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 `contrib/SegmentAnything/segment_anything/build_sam.py:72` 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 (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) paddleseg/models/u2net.py:45 — paddleseg/models/u2net.py:45-79 | paddleseg/models/u2net.py:159-193 — 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 (25 lines × 4) · ×1
  • Duplicated block (25 lines × 4) contrib/AutoNUE/core/val.py:125 — contrib/AutoNUE/core/val.py:125-149 | contrib/AutoNUE/core/val_crop.py:140-164 | contrib/RSSegBenchmark/c2fnet/core/val.py:178-202 | paddleseg/core/val.py:175-199 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) Matting/deploy/python/infer.py:40 — Matting/deploy/python/infer.py:40-63 | Matting/tools/bg_replace.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 `Matting/deploy/python/infer.py:40` 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 (21–24 lines × 3) · ×1
  • Duplicated block (21–24 lines × 3) contrib/MedicalSeg/deploy/python/infer.py:91 — contrib/MedicalSeg/deploy/python/infer.py:91-114 | deploy/python/infer.py:321-342 | deploy/python/infer_benchmark.py:92-112 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 297 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 `contrib/MedicalSeg/deploy/python/infer.py:91` 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 (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) paddleseg/models/pointrend.py:321 — paddleseg/models/pointrend.py:321-343 | paddleseg/models/pointrend.py:618-641 — 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.
D4 · Code Duplication · Duplicated block (21–23 lines × 5) · ×1
  • Duplicated block (21–23 lines × 5) Matting/tools/train.py:128 — Matting/tools/train.py:128-148 | contrib/QualityInspector/tools/seg/train.py:88-109 | contrib/RSSegBenchmark/c2fnet/train.py:112-132 | contrib/RSSegBenchmark/train.py:105-125 | tools/train.py:91-113 — before extracting anything, compare `Matting/tools/train.py` and `contrib/RSSegBenchmark/c2fnet/train.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 170 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 `Matting/tools/train.py:128` 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 (22 lines × 12) · ×1
  • Duplicated block (22 lines × 12) Matting/tools/train.py:72 — Matting/tools/train.py:72-93 | Matting/tools/val.py:44-65 | contrib/AutoNUE/train.py:54-75 | contrib/CityscapesSOTA/train.py:54-75 | contrib/DomainAdaptation/train.py:58-79 | contrib/LaneSeg/train.py:57-78 | contrib/MedicalSeg/train.py:56-77 | contrib/PanopticDeepLab/train.py:55-76 | contrib/RSSegBenchmark/c2fnet/train.py:69-90 | contrib/RSSegBenchmark/train.py:62-83 | deploy/slim/distill/distill_train.py:63-84 | deploy/slim/quant/qat_train.py:60-81 — before extracting anything, compare `Matting/tools/train.py` and `Matting/tools/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/tools/train.py:72` 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 (31 lines × 5) · ×1
  • Duplicated block (31 lines × 5) contrib/AutoNUE/core/infer.py:132 — contrib/AutoNUE/core/infer.py:132-162 | contrib/AutoNUE/core/infer_crop.py:132-162 | contrib/AutoNUE/core/infer_generate_autolabel.py:132-162 | contrib/RSSegBenchmark/c2fnet/core/infer.py:101-131 | paddleseg/core/infer.py:112-142 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 (20–22 lines × 4) · ×1
  • Duplicated block (20–22 lines × 4) contrib/MedicalSeg/deploy/python/infer.py:86 — contrib/MedicalSeg/deploy/python/infer.py:86-107 | deploy/python/infer.py:316-335 | deploy/python/infer_benchmark.py:87-108 | deploy/python/infer_dataset.py:96-117 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 297 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 `contrib/MedicalSeg/deploy/python/infer.py:86` 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 (20–22 lines × 3) · ×1
  • Duplicated block (20–22 lines × 3) contrib/AutoNUE/models/backbones/hrnet_nv.py:488 — contrib/AutoNUE/models/backbones/hrnet_nv.py:488-509 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:477-496 | paddleseg/models/backbones/uhrnet.py:679-698 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 × 3) · ×1
  • Duplicated block (21–22 lines × 3) contrib/MedicalSeg/tools/prepare_abdomen.py:83 — contrib/MedicalSeg/tools/prepare_abdomen.py:83-103 | contrib/MedicalSeg/tools/prepare_lung_coronavirus.py:68-89 | contrib/MedicalSeg/tools/prepare_mri_spine_seg.py:58-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18–22 lines × 3) · ×1
  • Duplicated block (18–22 lines × 3) contrib/PanopticSeg/tools/val.py:35 — contrib/PanopticSeg/tools/val.py:35-52 | contrib/QualityInspector/tools/seg/train.py:43-64 | tools/train.py:44-63 — before extracting anything, compare `contrib/QualityInspector/tools/seg/train.py` and `tools/train.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 183 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 `contrib/PanopticSeg/tools/val.py:35` 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 (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) EISeg/eiseg/inference/predictor/base.py:189 — EISeg/eiseg/inference/predictor/base.py:189-208 | EISeg/med3d/EISegMed3D/inference/predictor.py:246-267 — 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 `EISeg/eiseg/inference/predictor/base.py:189` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `EISeg/med3d/EISegMed3D/inference/predictor.py:243` calls `info` and `EISeg/eiseg/inference/predictor/base.py:188` 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–22 lines × 3) · ×1
  • Duplicated block (4–22 lines × 3) Matting/deploy/python/infer.py:580 — Matting/deploy/python/infer.py:580-601 | Matting/deploy/python/infer.py:621-641 | Matting/deploy/python/infer.py:709-712 — 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 (17–22 lines × 2) · ×1
  • Duplicated block (17–22 lines × 2) contrib/LaneSeg/core/predict.py:107 — contrib/LaneSeg/core/predict.py:107-128 | contrib/RSSegBenchmark/c2fnet/core/predict.py:140-156 — before extracting anything, compare `contrib/LaneSeg/core/predict.py` and `contrib/RSSegBenchmark/c2fnet/core/predict.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 (253 lines × 2) · ×1
  • Duplicated block (253 lines × 2) contrib/QualityInspector/tools/seg/model/plot_model_performance.py:26 — contrib/QualityInspector/tools/seg/model/plot_model_performance.py:26-278 | tools/model/plot_model_performance.py:26-278 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/plot_model_performance.py` and `tools/model/plot_model_performance.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 330 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 (20–21 lines × 3) · ×1
  • Duplicated block (20–21 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:329 — EISeg/med3d/EISegMed3D/inference/models.py:329-348 | contrib/MedicalSeg/medicalseg/models/vnet.py:126-146 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:133-152 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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 `EISeg/med3d/EISegMed3D/inference/models.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.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) contrib/AutoNUE/core/predict_generate_autolabel.py:52 — contrib/AutoNUE/core/predict_generate_autolabel.py:52-80 | contrib/LaneSeg/core/predict.py:47-67 | paddleseg/core/predict.py:63-93 — before extracting anything, compare `contrib/AutoNUE/core/predict_generate_autolabel.py` and `contrib/LaneSeg/core/predict.py` as WHOLE FILES: this scan already matched 3 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 (17–21 lines × 3) · ×1
  • Duplicated block (17–21 lines × 3) contrib/CrossPseudoSupervision/train.py:67 — contrib/CrossPseudoSupervision/train.py:67-87 | contrib/QualityInspector/tools/seg/train.py:69-89 | tools/train.py:69-85 — before extracting anything, compare `contrib/CrossPseudoSupervision/train.py` and `contrib/QualityInspector/tools/seg/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 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 `contrib/CrossPseudoSupervision/train.py:67` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/QualityInspector/tools/seg/train.py:66` calls `add_argument` and `tools/train.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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) paddleseg/datasets/ade.py:46 — paddleseg/datasets/ade.py:46-66 | paddleseg/datasets/mini_deep_globe_road_extraction.py:48-67 — before extracting anything, compare `paddleseg/datasets/ade.py` and `paddleseg/datasets/mini_deep_globe_road_extraction.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 `paddleseg/datasets/ade.py:46` 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–36 lines × 2) · ×1
  • Duplicated block (35–36 lines × 2) paddleseg/datasets/eg1800.py:55 — paddleseg/datasets/eg1800.py:55-90 | paddleseg/datasets/supervisely.py:55-89 — before extracting anything, compare `paddleseg/datasets/eg1800.py` and `paddleseg/datasets/supervisely.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 95 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 `paddleseg/datasets/eg1800.py:55` 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 (20 lines × 12) · ×1
  • Duplicated block (20 lines × 12) Matting/deploy/python/infer.py:60 — Matting/deploy/python/infer.py:60-79 | Matting/tools/train.py:66-85 | contrib/AutoNUE/train.py:48-67 | contrib/CityscapesSOTA/train.py:48-67 | contrib/DomainAdaptation/train.py:52-71 | contrib/LaneSeg/train.py:51-70 | contrib/MedicalSeg/train.py:50-69 | contrib/PanopticDeepLab/train.py:49-68 | contrib/RSSegBenchmark/c2fnet/train.py:63-82 | contrib/RSSegBenchmark/train.py:56-75 | deploy/slim/distill/distill_train.py:57-76 | deploy/slim/quant/qat_train.py:54-73 — before extracting anything, compare `Matting/tools/train.py` and `contrib/AutoNUE/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `Matting/deploy/python/infer.py:60` 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 (20 lines × 11) · ×1
  • Duplicated block (20 lines × 11) Matting/tools/train.py:43 — Matting/tools/train.py:43-62 | contrib/AutoNUE/train.py:30-49 | contrib/CityscapesSOTA/train.py:30-49 | contrib/DomainAdaptation/train.py:34-53 | contrib/LaneSeg/train.py:33-52 | contrib/MedicalSeg/train.py:32-51 | contrib/PanopticDeepLab/train.py:31-50 | contrib/RSSegBenchmark/c2fnet/train.py:40-59 | contrib/RSSegBenchmark/train.py:33-52 | deploy/slim/distill/distill_train.py:39-58 | deploy/slim/quant/qat_train.py:36-55 — before extracting anything, compare `Matting/tools/train.py` and `contrib/AutoNUE/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `Matting/tools/train.py:43` 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 (20 lines × 5) · ×1
  • Duplicated block (20 lines × 5) Matting/tools/export.py:36 — Matting/tools/export.py:36-55 | contrib/LaneSeg/export.py:27-46 | contrib/MedicalSeg/export.py:26-45 | contrib/MedicalSeg/nnunet/export.py:32-51 | deploy/python/infer_benchmark.py:30-49 — before extracting anything, compare `Matting/tools/export.py` and `contrib/MedicalSeg/export.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. 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 `Matting/tools/export.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.
D4 · Code Duplication · Duplicated block (16–20 lines × 5) · ×1
  • Duplicated block (16–20 lines × 5) contrib/CrossPseudoSupervision/predict.py:32 — contrib/CrossPseudoSupervision/predict.py:32-47 | contrib/PP-HumanSeg/src/seg_demo.py:40-56 | contrib/QualityInspector/tools/seg/predict.py:30-45 | tools/analyse.py:28-47 | tools/predict.py:30-45 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 `contrib/CrossPseudoSupervision/predict.py:32` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `tools/analyse.py:28` calls `add_argument` and `contrib/CrossPseudoSupervision/predict.py:32` does not — after which the two agree again for 5 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–20 lines × 4) · ×1
  • Duplicated block (4–20 lines × 4) contrib/MedicalSeg/medicalseg/utils/visualize.py:45 — contrib/MedicalSeg/medicalseg/utils/visualize.py:45-64 | contrib/SegmentAnything/scripts/amg_paddle.py:193-212 | contrib/SegmentAnything/scripts/text_to_sam_clip.py:114-133 | paddleseg/utils/visualize.py:44-47 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/visualize.py` and `paddleseg/utils/visualize.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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. 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, `contrib/SegmentAnything/scripts/amg_paddle.py:212` calls `LUT` and `paddleseg/utils/visualize.py:47` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) Matting/tools/val.py:36 — Matting/tools/val.py:36-53 | contrib/RSSegBenchmark/val.py:44-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. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/tools/val.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. 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 (15–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) contrib/LaneSeg/export.py:80 — contrib/LaneSeg/export.py:80-99 | contrib/MedicalSeg/nnunet/export.py:98-112 — before extracting anything, compare `contrib/LaneSeg/export.py` and `contrib/MedicalSeg/nnunet/export.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 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 (3–20 lines × 3) · ×1
  • Duplicated block (3–20 lines × 3) contrib/MedicalSeg/nnunet/utils/base_predictor.py:385 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:385-404 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:412-414 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:447-465 — 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. 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, `contrib/MedicalSeg/nnunet/utils/base_predictor.py:405` calls `inference_apply_nonlin`, `self`, `flip` and `contrib/MedicalSeg/nnunet/utils/base_predictor.py:414` 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 (15–19 lines × 9) · ×1
  • Duplicated block (15–19 lines × 9) Matting/tools/predict.py:40 — Matting/tools/predict.py:40-55 | contrib/AutoNUE/predict.py:32-46 | contrib/AutoNUE/predict_ensemble.py:40-58 | contrib/AutoNUE/predict_ensemble_three.py:52-70 | contrib/CityscapesSOTA/predict.py:32-46 | contrib/LaneSeg/predict.py:32-46 | contrib/PanopticDeepLab/predict.py:33-47 | contrib/RSSegBenchmark/c2fnet/predict.py:34-48 | contrib/RSSegBenchmark/predict.py:33-47 — before extracting anything, compare `Matting/tools/predict.py` and `contrib/AutoNUE/predict.py` as WHOLE FILES: this scan already matched 4 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. 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 `Matting/tools/predict.py:40` 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 (18–19 lines × 6) · ×1
  • Duplicated block (18–19 lines × 6) contrib/AutoNUE/train.py:99 — contrib/AutoNUE/train.py:99-116 | contrib/CityscapesSOTA/train.py:99-116 | contrib/DomainAdaptation/train.py:123-141 | contrib/LaneSeg/train.py:129-146 | contrib/MedicalSeg/train.py:142-159 | contrib/PanopticDeepLab/train.py:118-135 — `contrib/AutoNUE/train.py` and `contrib/CityscapesSOTA/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 185 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/DomainAdaptation/train.py:121` calls `info`, `format` and `contrib/LaneSeg/train.py:127` 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 (22 lines × 5) · ×1
  • Duplicated block (22 lines × 5) contrib/AutoNUE/core/infer.py:24 — contrib/AutoNUE/core/infer.py:24-45 | contrib/AutoNUE/core/infer_crop.py:24-45 | contrib/AutoNUE/core/infer_ensemble.py:24-45 | contrib/AutoNUE/core/infer_ensemble_three.py:24-45 | contrib/AutoNUE/core/infer_generate_autolabel.py:24-45 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 (17–19 lines × 5) · ×1
  • Duplicated block (17–19 lines × 5) contrib/AutoNUE/scripts/train.py:120 — contrib/AutoNUE/scripts/train.py:120-137 | contrib/CityscapesSOTA/scripts/train.py:124-140 | contrib/LaneSeg/core/train.py:129-145 | contrib/PanopticDeepLab/core/train.py:139-155 | contrib/PanopticSeg/paddlepanseg/core/train.py:151-169 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 (17–18 lines × 9) · ×1
  • Duplicated block (17–18 lines × 9) contrib/AutoNUE/scripts/train.py:192 — contrib/AutoNUE/scripts/train.py:192-208 | contrib/CityscapesSOTA/scripts/train.py:195-211 | contrib/CrossPseudoSupervision/core/train.py:310-326 | contrib/LaneSeg/core/train.py:235-251 | contrib/PanopticDeepLab/core/train.py:218-235 | contrib/PanopticSeg/paddlepanseg/core/train.py:205-222 | contrib/RSSegBenchmark/c2fnet/core/train.py:274-290 | deploy/slim/distill/distill_utils.py:278-294 | paddleseg/core/train.py:311-327 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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, `contrib/PanopticDeepLab/core/train.py:214` calls `info`, `format` and `contrib/AutoNUE/scripts/train.py:191` 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 × 6) · ×1
  • Duplicated block (18 lines × 6) contrib/DomainAdaptation/val.py:145 — contrib/DomainAdaptation/val.py:145-162 | contrib/LaneSeg/val.py:97-114 | contrib/MedicalSeg/nnunet/single_fold_eval.py:290-307 | contrib/MedicalSeg/val.py:95-112 | contrib/RSSegBenchmark/c2fnet/val.py:178-195 | contrib/RSSegBenchmark/val.py:170-187 — `contrib/DomainAdaptation/val.py` and `contrib/LaneSeg/val.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 78 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: `Config` names `cvlibs` in one and `medicalseg.cvlibs` 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 (16–18 lines × 4) · ×1
  • Duplicated block (16–18 lines × 4) Matting/ppmatting/metrics/metric.py:38 — Matting/ppmatting/metrics/metric.py:38-53 | Matting/ppmatting/metrics/metric.py:82-97 | Matting/ppmatting/metrics/metric.py:160-176 | Matting/ppmatting/metrics/metric.py:214-231 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Matting/ppmatting/metrics/metric.py:56` calls `sum` and `Matting/ppmatting/metrics/metric.py:100` 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 (16–18 lines × 3) · ×1
  • Duplicated block (16–18 lines × 3) contrib/AutoNUE/scripts/train.py:131 — contrib/AutoNUE/scripts/train.py:131-148 | contrib/CityscapesSOTA/scripts/train.py:135-151 | deploy/slim/distill/distill_utils.py:166-181 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:131` 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 (15–18 lines × 3) · ×1
  • Duplicated block (15–18 lines × 3) contrib/LaneSeg/train.py:89 — contrib/LaneSeg/train.py:89-103 | contrib/MedicalSeg/train.py:88-105 | deploy/slim/quant/qat_train.py:92-109 — `contrib/LaneSeg/train.py` and `contrib/MedicalSeg/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 263 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/LaneSeg/train.py:89` 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 (14–18 lines × 2) · ×1
  • Duplicated block (14–18 lines × 2) contrib/MedicalSeg/deploy/python/infer.py:523 — contrib/MedicalSeg/deploy/python/infer.py:523-540 | deploy/python/infer.py:372-385 — before extracting anything, compare `contrib/MedicalSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 297 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 `contrib/MedicalSeg/deploy/python/infer.py:523` 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 (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) contrib/QualityInspector/tools/uad/padim/predict.py:107 — contrib/QualityInspector/tools/uad/padim/predict.py:107-124 | contrib/QualityInspector/tools/uad/padim/train.py:183-199 — 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 (16–17 lines × 9) · ×1
  • Duplicated block (16–17 lines × 9) contrib/AutoNUE/train.py:35 — contrib/AutoNUE/train.py:35-51 | contrib/CityscapesSOTA/train.py:35-51 | contrib/DomainAdaptation/train.py:39-55 | contrib/LaneSeg/train.py:38-54 | contrib/MedicalSeg/train.py:37-53 | contrib/PanopticDeepLab/train.py:36-52 | deploy/slim/distill/distill_train.py:44-60 | deploy/slim/prune/prune.py:36-51 | deploy/slim/quant/qat_train.py:41-57 — `contrib/AutoNUE/train.py` and `contrib/CityscapesSOTA/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 185 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/AutoNUE/train.py:35` 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 (18 lines × 7) · ×1
  • Duplicated block (18 lines × 7) contrib/AutoNUE/core/infer.py:45 — contrib/AutoNUE/core/infer.py:45-62 | contrib/AutoNUE/core/infer_crop.py:45-62 | contrib/AutoNUE/core/infer_ensemble.py:45-62 | contrib/AutoNUE/core/infer_ensemble_three.py:45-62 | contrib/AutoNUE/core/infer_generate_autolabel.py:45-62 | contrib/LaneSeg/core/infer.py:87-104 | contrib/PanopticDeepLab/core/infer.py:58-75 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 (17 lines × 5) · ×1
  • Duplicated block (17 lines × 5) contrib/AutoNUE/datasets/auto_nue.py:84 — contrib/AutoNUE/datasets/auto_nue.py:84-100 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:84-100 | contrib/AutoNUE/datasets/auto_nue_crop.py:84-100 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:103-119 | paddleseg/datasets/cityscapes.py:74-90 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/AutoNUE/datasets/auto_nue_autolabel.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 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 `contrib/AutoNUE/datasets/auto_nue.py:84` 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 (15–17 lines × 5) · ×1
  • Duplicated block (15–17 lines × 5) contrib/AutoNUE/scripts/train.py:126 — contrib/AutoNUE/scripts/train.py:126-141 | contrib/CityscapesSOTA/scripts/train.py:130-144 | contrib/PanopticDeepLab/core/train.py:145-159 | contrib/PanopticSeg/paddlepanseg/core/train.py:158-174 | deploy/slim/distill/distill_utils.py:161-175 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 (8–17 lines × 4) · ×1
  • Duplicated block (8–17 lines × 4) contrib/PanopticSeg/tools/train.py:47 — contrib/PanopticSeg/tools/train.py:47-63 | contrib/QualityInspector/tools/seg/model/export_onnx.py:48-55 | deploy/python/infer_onnx_trt.py:64-74 | tools/model/export_onnx.py:48-55 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/export_onnx.py` and `deploy/python/infer_onnx_trt.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 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 `contrib/PanopticSeg/tools/train.py:47` 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 (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) Matting/tools/export.py:110 — Matting/tools/export.py:110-126 | deploy/slim/quant/qat_export.py:110-124 — 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 (3–17 lines × 3) · ×1
  • Duplicated block (3–17 lines × 3) contrib/MedicalSeg/nnunet/utils/static_predictor.py:369 — contrib/MedicalSeg/nnunet/utils/static_predictor.py:369-385 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:393-395 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:425-440 — 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. 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, `contrib/MedicalSeg/nnunet/utils/static_predictor.py:386` calls `inference_apply_nonlin`, `self`, `flip` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py:395` 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 (16 lines × 13) · ×1
  • Duplicated block (16 lines × 13) Matting/tools/train.py:72 — Matting/tools/train.py:72-87 | Matting/tools/val.py:44-59 | contrib/AutoNUE/train.py:54-69 | contrib/CityscapesSOTA/train.py:54-69 | contrib/DomainAdaptation/train.py:58-73 | contrib/LaneSeg/train.py:57-72 | contrib/MedicalSeg/train.py:56-71 | contrib/PanopticDeepLab/predict.py:39-54 | contrib/PanopticDeepLab/train.py:55-70 | contrib/RSSegBenchmark/c2fnet/train.py:69-84 | contrib/RSSegBenchmark/train.py:62-77 | deploy/slim/distill/distill_train.py:63-78 | deploy/slim/quant/qat_train.py:60-75 — before extracting anything, compare `Matting/tools/train.py` and `Matting/tools/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/tools/train.py:72` 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 × 11) · ×1
  • Duplicated block (16 lines × 11) Matting/deploy/python/infer.py:48 — Matting/deploy/python/infer.py:48-63 | Matting/tools/bg_replace.py:47-62 | contrib/AutoNUE/predict.py:32-47 | contrib/AutoNUE/predict_ensemble.py:44-59 | contrib/AutoNUE/predict_ensemble_three.py:56-71 | contrib/CityscapesSOTA/predict.py:32-47 | contrib/LaneSeg/predict.py:32-47 | contrib/MedicalSeg/nnunet/all_folds_eval.py:126-141 | contrib/PanopticDeepLab/predict.py:33-48 | contrib/RSSegBenchmark/c2fnet/predict.py:34-49 | contrib/RSSegBenchmark/predict.py:33-48 — before extracting anything, compare `contrib/AutoNUE/predict.py` and `contrib/AutoNUE/predict_ensemble.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 188 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 `Matting/deploy/python/infer.py:48` 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 × 8) · ×1
  • Duplicated block (16 lines × 8) Matting/tools/train.py:90 — Matting/tools/train.py:90-105 | Matting/tools/val.py:56-71 | contrib/AutoNUE/val.py:38-55 | contrib/CityscapesSOTA/val.py:38-55 | contrib/DomainAdaptation/val.py:62-79 | contrib/RSSegBenchmark/c2fnet/val.py:67-84 | contrib/RSSegBenchmark/val.py:60-77 | deploy/slim/quant/qat_val.py:59-76 — before extracting anything, compare `Matting/tools/train.py` and `Matting/tools/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Matting/tools/train.py:90` 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 (15–16 lines × 7) · ×1
  • Duplicated block (15–16 lines × 7) contrib/AutoNUE/scripts/train.py:124 — contrib/AutoNUE/scripts/train.py:124-139 | contrib/CityscapesSOTA/scripts/train.py:128-142 | contrib/LaneSeg/core/train.py:133-147 | contrib/PanopticDeepLab/core/train.py:143-157 | contrib/PanopticSeg/paddlepanseg/core/train.py:156-171 | contrib/RSSegBenchmark/c2fnet/core/train.py:170-184 | deploy/slim/distill/distill_utils.py:159-173 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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, `contrib/RSSegBenchmark/c2fnet/core/train.py:167` calls `to_static`, `info` and `contrib/AutoNUE/scripts/train.py:122` 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 lines × 7) · ×1
  • Duplicated block (16 lines × 7) contrib/AutoNUE/val.py:32 — contrib/AutoNUE/val.py:32-49 | contrib/CityscapesSOTA/val.py:32-49 | contrib/DomainAdaptation/val.py:56-73 | contrib/LaneSeg/val.py:38-54 | contrib/PanopticDeepLab/val.py:34-49 | deploy/slim/quant/ptq.py:33-48 | deploy/slim/quant/qat_val.py:53-70 — `contrib/AutoNUE/val.py` and `contrib/CityscapesSOTA/val.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 162 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `contrib/AutoNUE/val.py:32` 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 (14–16 lines × 5) · ×1
  • Duplicated block (14–16 lines × 5) Matting/deploy/python/infer.py:100 — Matting/deploy/python/infer.py:100-114 | contrib/MedicalSeg/deploy/python/infer.py:73-88 | deploy/python/infer.py:300-313 | deploy/python/infer_benchmark.py:69-84 | deploy/python/infer_dataset.py:83-98 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/MedicalSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 190 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 `Matting/deploy/python/infer.py:100` 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 (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) contrib/AutoNUE/predict.py:100 — contrib/AutoNUE/predict.py:100-115 | contrib/AutoNUE/predict_ensemble.py:112-127 | contrib/AutoNUE/predict_ensemble_three.py:124-139 | contrib/AutoNUE/tools/IDD_labeling.py:16-31 | contrib/PanopticDeepLab/predict.py:74-89 — before extracting anything, compare `contrib/AutoNUE/predict.py` and `contrib/AutoNUE/predict_ensemble.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 188 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–16 lines × 4) · ×1
  • Duplicated block (14–16 lines × 4) Matting/ppmatting/models/ppmattingv2.py:549 — Matting/ppmatting/models/ppmattingv2.py:549-562 | paddleseg/models/backbones/seaformer.py:447-462 | paddleseg/models/backbones/strideformer.py:615-629 | paddleseg/models/backbones/top_transformer.py:359-372 — before extracting anything, compare `Matting/ppmatting/models/ppmattingv2.py` and `paddleseg/models/backbones/top_transformer.py` as WHOLE FILES: this scan already matched 9 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 `paddleseg/models/backbones/seaformer.py:447` 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 (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:300 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:300-317 | contrib/MedicalSeg/medicalseg/models/swinunet.py:356-373 | paddleseg/models/backbones/swin_transformer.py:444-461 — 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 (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:459 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:459-473 | contrib/MedicalSeg/medicalseg/models/swinunet.py:328-343 | paddleseg/models/backbones/swin_transformer.py:416-430 — 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 `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:459` 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 (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) contrib/PanopticSeg/deploy/python/infer.py:65 — contrib/PanopticSeg/deploy/python/infer.py:65-80 | deploy/python/infer.py:306-319 | deploy/python/infer_benchmark.py:75-90 — before extracting anything, compare `contrib/PanopticSeg/deploy/python/infer.py` and `deploy/python/infer.py` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `contrib/PanopticSeg/deploy/python/infer.py:65` 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 (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) contrib/RSSegBenchmark/c2fnet/predict.py:153 — contrib/RSSegBenchmark/c2fnet/predict.py:153-167 | contrib/RSSegBenchmark/c2fnet/train.py:173-187 | contrib/RSSegBenchmark/c2fnet/val.py:147-161 | contrib/RSSegBenchmark/predict.py:146-160 | contrib/RSSegBenchmark/train.py:166-180 | contrib/RSSegBenchmark/val.py:140-154 — before extracting anything, compare `contrib/RSSegBenchmark/c2fnet/predict.py` and `contrib/RSSegBenchmark/c2fnet/train.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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, `contrib/RSSegBenchmark/c2fnet/predict.py:170` calls `check_sync_info` and `contrib/RSSegBenchmark/predict.py:164` 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 (14–15 lines × 5) · ×1
  • Duplicated block (14–15 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:281 — Matting/ppmatting/models/backbone/hrnet.py:281-294 | contrib/AutoNUE/models/backbones/hrnet_nv.py:283-297 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:278-291 | paddleseg/models/backbones/hrnet.py:296-309 | paddleseg/models/backbones/uhrnet.py:479-492 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:281` 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 (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) contrib/AutoNUE/scripts/train.py:239 — contrib/AutoNUE/scripts/train.py:239-253 | contrib/CityscapesSOTA/scripts/train.py:243-257 | contrib/LaneSeg/core/train.py:282-296 | contrib/RSSegBenchmark/c2fnet/core/train.py:323-337 | deploy/slim/distill/distill_utils.py:327-341 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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–15 lines × 5) · ×1
  • Duplicated block (9–15 lines × 5) contrib/CrossPseudoSupervision/predict.py:29 — contrib/CrossPseudoSupervision/predict.py:29-43 | contrib/QualityInspector/tools/seg/predict.py:27-41 | tools/analyse.py:24-38 | tools/data/split_dataset_list.py:24-32 | tools/predict.py:27-41 — before extracting anything, compare `contrib/CrossPseudoSupervision/predict.py` and `contrib/QualityInspector/tools/seg/predict.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 160 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 `contrib/CrossPseudoSupervision/predict.py:29` 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 (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) Matting/ppmatting/models/backbone/hrnet.py:231 — Matting/ppmatting/models/backbone/hrnet.py:231-245 | contrib/AutoNUE/models/backbones/hrnet_nv.py:234-248 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:230-243 | paddleseg/models/backbones/hrnet.py:245-259 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:231` 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 (13–15 lines × 4) · ×1
  • Duplicated block (13–15 lines × 4) Matting/ppmatting/models/backbone/hrnet.py:340 — Matting/ppmatting/models/backbone/hrnet.py:340-352 | contrib/AutoNUE/models/backbones/hrnet_nv.py:344-358 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:336-348 | paddleseg/models/backbones/hrnet.py:356-368 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:340` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Matting/ppmatting/models/backbone/hrnet.py:354` calls `Add`, `Activation` and `contrib/AutoNUE/models/backbones/hrnet_nv.py:360` 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–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) contrib/AutoNUE/models/backbones/hrnet_nv.py:527 — contrib/AutoNUE/models/backbones/hrnet_nv.py:527-541 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:515-527 | paddleseg/models/backbones/uhrnet.py:717-729 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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–22 lines × 3) · ×1
  • Duplicated block (13–22 lines × 3) contrib/AutoNUE/models/ocrnet_nv.py:110 — contrib/AutoNUE/models/ocrnet_nv.py:110-131 | contrib/CityscapesSOTA/models/ocrnet_nv.py:119-140 | paddleseg/models/ocrnet.py:113-125 — before extracting anything, compare `contrib/AutoNUE/models/ocrnet_nv.py` and `contrib/CityscapesSOTA/models/ocrnet_nv.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 163 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–14 lines × 40) · ×1
  • Duplicated block (13–14 lines × 40) Matting/ppmatting/models/backbone/hrnet.py:640 — Matting/ppmatting/models/backbone/hrnet.py:640-652 | Matting/ppmatting/models/backbone/hrnet.py:658-670 | Matting/ppmatting/models/backbone/hrnet.py:676-688 | Matting/ppmatting/models/backbone/hrnet.py:694-706 | Matting/ppmatting/models/backbone/hrnet.py:712-724 | Matting/ppmatting/models/backbone/hrnet.py:730-742 | Matting/ppmatting/models/backbone/hrnet.py:748-760 | Matting/ppmatting/models/backbone/hrnet.py:766-778 | Matting/ppmatting/models/backbone/hrnet.py:784-796 | Matting/ppmatting/models/backbone/hrnet.py:802-814 | contrib/AutoNUE/models/backbones/hrnet_nv.py:638-651 | contrib/AutoNUE/models/backbones/hrnet_nv.py:657-670 | contrib/AutoNUE/models/backbones/hrnet_nv.py:676-689 | contrib/AutoNUE/models/backbones/hrnet_nv.py:695-708 | contrib/AutoNUE/models/backbones/hrnet_nv.py:714-727 | contrib/AutoNUE/models/backbones/hrnet_nv.py:733-746 | contrib/AutoNUE/models/backbones/hrnet_nv.py:752-765 | contrib/AutoNUE/models/backbones/hrnet_nv.py:771-784 | contrib/AutoNUE/models/backbones/hrnet_nv.py:790-803 | contrib/AutoNUE/models/backbones/hrnet_nv.py:809-822 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:621-633 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:639-651 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:657-669 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:675-687 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:693-705 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:711-723 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:729-741 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:747-759 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:765-777 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:783-795 | paddleseg/models/backbones/hrnet.py:664-676 | paddleseg/models/backbones/hrnet.py:682-694 | paddleseg/models/backbones/hrnet.py:700-712 | paddleseg/models/backbones/hrnet.py:718-730 | paddleseg/models/backbones/hrnet.py:736-748 | paddleseg/models/backbones/hrnet.py:754-766 | paddleseg/models/backbones/hrnet.py:772-784 | paddleseg/models/backbones/hrnet.py:790-802 | paddleseg/models/backbones/hrnet.py:808-820 | paddleseg/models/backbones/hrnet.py:826-838 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:640` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (7–14 lines × 7) · ×1
  • Duplicated block (7–14 lines × 7) REDACTED:600 — REDACTED:600-612 | contrib/CityscapesSOTA/tools/convert_cityscapes_autolabeling.py:20-33 | contrib/MedicalSeg/medicalseg/utils/visualize.py:113-119 | contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:48-54 | paddleseg/utils/visualize.py:113-119 | tools/data/gray2pseudo_color.py:48-54 | tools/data/labelme2seg.py:42-48 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/utils/visualize.py` and `paddleseg/utils/visualize.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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–14 lines × 5) · ×1
  • Duplicated block (13–14 lines × 5) Matting/ppmatting/models/backbone/hrnet.py:576 — Matting/ppmatting/models/backbone/hrnet.py:576-589 | contrib/AutoNUE/models/backbones/hrnet_nv.py:573-586 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:559-571 | paddleseg/models/backbones/hrnet.py:600-613 | paddleseg/models/backbones/uhrnet.py:761-773 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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 `Matting/ppmatting/models/backbone/hrnet.py:576` 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 (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) contrib/AutoNUE/val.py:94 — contrib/AutoNUE/val.py:94-107 | contrib/CityscapesSOTA/val.py:94-107 | contrib/MedicalSeg/nnunet/single_fold_eval.py:279-293 | contrib/PanopticDeepLab/val.py:69-82 — `contrib/AutoNUE/val.py` and `contrib/CityscapesSOTA/val.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 162 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (24–28 lines × 2) · ×1
  • Duplicated block (24–28 lines × 2) contrib/AutoNUE/models/backbones/hrnet_nv.py:105 — contrib/AutoNUE/models/backbones/hrnet_nv.py:105-132 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:105-128 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 `contrib/AutoNUE/models/backbones/hrnet_nv.py:105` 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 (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) contrib/CrossPseudoSupervision/cvlibs/builder.py:172 — contrib/CrossPseudoSupervision/cvlibs/builder.py:172-182 | paddleseg/cvlibs/builder.py:227-240 — before extracting anything, compare `contrib/CrossPseudoSupervision/cvlibs/builder.py` and `paddleseg/cvlibs/builder.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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 `paddleseg/cvlibs/builder.py:227` 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 (12–13 lines × 7) · ×1
  • Duplicated block (12–13 lines × 7) contrib/AutoNUE/datasets/auto_nue.py:74 — contrib/AutoNUE/datasets/auto_nue.py:74-86 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:74-86 | contrib/AutoNUE/datasets/auto_nue_crop.py:74-86 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:93-105 | contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py:86-97 | paddleseg/datasets/cityscapes.py:64-76 | paddleseg/datasets/cocostuff.py:61-72 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/AutoNUE/datasets/auto_nue_autolabel.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 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 `contrib/AutoNUE/datasets/auto_nue.py:74` 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 (13 lines × 7) · ×1
  • Duplicated block (13 lines × 7) contrib/AutoNUE/scripts/train.py:244 — contrib/AutoNUE/scripts/train.py:244-256 | contrib/CityscapesSOTA/scripts/train.py:248-260 | contrib/LaneSeg/core/train.py:287-299 | contrib/PanopticDeepLab/core/train.py:280-292 | contrib/PanopticSeg/paddlepanseg/core/train.py:274-286 | contrib/RSSegBenchmark/c2fnet/core/train.py:328-340 | deploy/slim/distill/distill_utils.py:332-344 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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, `contrib/LaneSeg/core/train.py:301` calls `add_scalar` and `contrib/AutoNUE/scripts/train.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 (13 lines × 6) · ×1
  • Duplicated block (13 lines × 6) contrib/LaneSeg/train.py:177 — contrib/LaneSeg/train.py:177-189 | contrib/MedicalSeg/train.py:191-203 | contrib/MedicalSeg/train.py:210-222 | contrib/PanopticDeepLab/train.py:155-167 | contrib/RSSegBenchmark/c2fnet/train.py:247-259 | contrib/RSSegBenchmark/train.py:237-249 — `contrib/LaneSeg/train.py` and `contrib/MedicalSeg/train.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 263 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (11–13 lines × 4) · ×1
  • Duplicated block (11–13 lines × 4) contrib/DomainAdaptation/models/gscnn.py:227 — contrib/DomainAdaptation/models/gscnn.py:227-239 | contrib/PanopticDeepLab/models/panoptic_deeplab.py:261-271 | contrib/PanopticSeg/paddlepanseg/models/panoptic_deeplab.py:266-276 | paddleseg/models/gscnn.py:290-302 — before extracting anything, compare `contrib/DomainAdaptation/models/gscnn.py` and `paddleseg/models/gscnn.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 214 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–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:388 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:388-400 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:450-461 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:369-381 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:425-436 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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, `contrib/MedicalSeg/nnunet/utils/base_predictor.py:386` calls `to_tensor`, `astype` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py:367` 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 (9–13 lines × 4) · ×1
  • Duplicated block (9–13 lines × 4) contrib/QualityInspector/tools/seg/export.py:27 — contrib/QualityInspector/tools/seg/export.py:27-39 | contrib/QualityInspector/tools/seg/model/export_onnx.py:44-52 | tools/export.py:28-40 | tools/model/export_onnx.py:44-52 — before extracting anything, compare `contrib/QualityInspector/tools/seg/model/export_onnx.py` and `tools/model/export_onnx.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `contrib/QualityInspector/tools/seg/export.py:27` 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 (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) contrib/AutoNUE/datasets/auto_nue.py:156 — contrib/AutoNUE/datasets/auto_nue.py:156-168 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:161-172 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:169-180 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/AutoNUE/datasets/auto_nue_autolabel.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) contrib/CityscapesSOTA/scripts/train.py:45 — contrib/CityscapesSOTA/scripts/train.py:45-57 | contrib/RSSegBenchmark/c2fnet/core/train.py:46-56 | paddleseg/core/train.py:53-63 — before extracting anything, compare `contrib/CityscapesSOTA/scripts/train.py` and `contrib/RSSegBenchmark/c2fnet/core/train.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 193 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 `contrib/CityscapesSOTA/scripts/train.py:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) contrib/CrossPseudoSupervision/val.py:124 — contrib/CrossPseudoSupervision/val.py:124-148 | contrib/QualityInspector/tools/seg/val.py:123-147 | tools/val.py:131-155 — before extracting anything, compare `contrib/CrossPseudoSupervision/val.py` and `contrib/QualityInspector/tools/seg/val.py` as WHOLE FILES: this scan already matched 5 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 lines × 20) · ×1
  • Duplicated block (12 lines × 20) Matting/tools/bg_replace_video.py:37 — Matting/tools/bg_replace_video.py:37-49 | Matting/tools/predict.py:37-49 | Matting/tools/predict_video.py:37-49 | contrib/AutoNUE/predict.py:30-41 | contrib/AutoNUE/predict_ensemble.py:30-41 | contrib/AutoNUE/predict_ensemble_three.py:30-41 | contrib/AutoNUE/val.py:30-41 | contrib/CityscapesSOTA/predict.py:30-41 | contrib/CityscapesSOTA/val.py:30-41 | contrib/DomainAdaptation/val.py:54-65 | contrib/LaneSeg/deploy/python/infer.py:145-156 | contrib/LaneSeg/predict.py:30-41 | contrib/LaneSeg/val.py:36-47 | contrib/PanopticDeepLab/predict.py:31-42 | contrib/PanopticDeepLab/val.py:32-43 | contrib/RSSegBenchmark/c2fnet/predict.py:32-43 | contrib/RSSegBenchmark/c2fnet/train.py:32-43 | contrib/RSSegBenchmark/predict.py:31-42 | deploy/slim/quant/ptq.py:31-42 | deploy/slim/quant/qat_val.py:51-62 — before extracting anything, compare `Matting/tools/bg_replace_video.py` and `Matting/tools/predict.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 `Matting/tools/bg_replace_video.py:37` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deploy/slim/quant/ptq.py:25` calls `enable_static` and `Matting/tools/bg_replace_video.py:32` 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 (12 lines × 18) · ×1
  • Duplicated block (12 lines × 18) Matting/tools/predict.py:37 — Matting/tools/predict.py:37-49 | contrib/AutoNUE/predict.py:30-41 | contrib/AutoNUE/predict_ensemble.py:38-53 | contrib/AutoNUE/predict_ensemble_three.py:50-65 | contrib/AutoNUE/val.py:30-41 | contrib/CityscapesSOTA/predict.py:30-41 | contrib/CityscapesSOTA/val.py:30-41 | contrib/DomainAdaptation/val.py:54-65 | contrib/LaneSeg/deploy/python/infer.py:145-156 | contrib/LaneSeg/predict.py:30-41 | contrib/LaneSeg/val.py:36-47 | contrib/PanopticDeepLab/predict.py:31-42 | contrib/PanopticDeepLab/val.py:32-43 | contrib/RSSegBenchmark/c2fnet/predict.py:32-43 | contrib/RSSegBenchmark/c2fnet/train.py:32-43 | contrib/RSSegBenchmark/predict.py:31-42 | deploy/slim/quant/ptq.py:31-42 | deploy/slim/quant/qat_val.py:51-62 — before extracting anything, compare `Matting/tools/predict.py` and `contrib/AutoNUE/predict.py` as WHOLE FILES: this scan already matched 4 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. 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 `Matting/tools/predict.py:37` 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 (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) EISeg/med3d/EISegMed3D/inference/models.py:258 — EISeg/med3d/EISegMed3D/inference/models.py:258-269 | contrib/MedicalSeg/medicalseg/models/vnet.py:63-72 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:64-75 — before extracting anything, compare `EISeg/med3d/EISegMed3D/inference/models.py` and `contrib/MedicalSeg/medicalseg/models/vnet.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 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–12 lines × 3) · ×1
  • Duplicated block (9–12 lines × 3) contrib/LaneSeg/datasets/tusimple.py:97 — contrib/LaneSeg/datasets/tusimple.py:97-108 | paddleseg/datasets/optic_disc_seg.py:79-87 | paddleseg/datasets/pp_humanseg14k.py:64-72 — before extracting anything, compare `paddleseg/datasets/optic_disc_seg.py` and `paddleseg/datasets/pp_humanseg14k.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) contrib/AutoNUE/models/backbones/hrnet_nv.py:134 — contrib/AutoNUE/models/backbones/hrnet_nv.py:134-145 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:131-139 — before extracting anything, compare `contrib/AutoNUE/models/backbones/hrnet_nv.py` and `contrib/CityscapesSOTA/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 477 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 `contrib/AutoNUE/models/backbones/hrnet_nv.py:134` 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 (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) contrib/MedicalSeg/medicalseg/models/vnet.py:161 — contrib/MedicalSeg/medicalseg/models/vnet.py:161-170 | contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py:168-179 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/models/vnet.py` and `contrib/MedicalSeg/medicalseg/models/vnet_deepsup.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 161 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 (11 lines × 21) · ×1
  • Duplicated block (11 lines × 21) Matting/tools/bg_replace_video.py:36 — Matting/tools/bg_replace_video.py:36-47 | Matting/tools/predict.py:36-47 | Matting/tools/predict_video.py:36-47 | contrib/AutoNUE/predict.py:27-39 | contrib/AutoNUE/predict_ensemble.py:27-39 | contrib/AutoNUE/predict_ensemble_three.py:27-39 | contrib/AutoNUE/val.py:27-39 | contrib/CityscapesSOTA/predict.py:27-39 | contrib/CityscapesSOTA/val.py:27-39 | contrib/DomainAdaptation/val.py:51-63 | contrib/LaneSeg/deploy/python/infer.py:144-154 | contrib/LaneSeg/predict.py:27-39 | contrib/LaneSeg/val.py:33-45 | contrib/PanopticDeepLab/predict.py:28-40 | contrib/PanopticDeepLab/val.py:29-41 | contrib/RSSegBenchmark/c2fnet/predict.py:29-41 | contrib/RSSegBenchmark/c2fnet/train.py:30-41 | contrib/RSSegBenchmark/c2fnet/val.py:45-57 | contrib/RSSegBenchmark/predict.py:28-40 | deploy/slim/quant/ptq.py:29-40 | deploy/slim/quant/qat_val.py:48-60 — before extracting anything, compare `Matting/tools/bg_replace_video.py` and `Matting/tools/predict.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 `Matting/tools/bg_replace_video.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. 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, `deploy/slim/quant/ptq.py:25` calls `enable_static` and `Matting/tools/bg_replace_video.py:32` 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–11 lines × 7) · ×1
  • Duplicated block (10–11 lines × 7) contrib/AutoNUE/core/predict_ensemble.py:77 — contrib/AutoNUE/core/predict_ensemble.py:77-87 | contrib/AutoNUE/core/predict_ensemble_three.py:84-94 | contrib/AutoNUE/core/predict_generate_autolabel.py:73-83 | contrib/LaneSeg/core/predict.py:60-70 | contrib/PanopticDeepLab/core/predict.py:91-100 | contrib/RSSegBenchmark/c2fnet/core/predict.py:92-102 | paddleseg/core/predict.py:86-96 — before extracting anything, compare `contrib/AutoNUE/core/predict_ensemble.py` and `contrib/AutoNUE/core/predict_ensemble_three.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 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, `contrib/AutoNUE/core/predict_ensemble.py:75` calls `load_entire_model`, `eval` and `contrib/AutoNUE/core/predict_generate_autolabel.py:70` 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–11 lines × 6) · ×1
  • Duplicated block (9–11 lines × 6) contrib/AutoNUE/core/val.py:61 — contrib/AutoNUE/core/val.py:61-69 | contrib/AutoNUE/core/val_crop.py:61-69 | contrib/DomainAdaptation/script/val.py:200-210 | contrib/MedicalSeg/medicalseg/core/val.py:62-70 | contrib/RSSegBenchmark/c2fnet/core/val.py:75-83 | paddleseg/core/val.py:69-77 — before extracting anything, compare `contrib/AutoNUE/core/val.py` and `contrib/AutoNUE/core/val_crop.py` as WHOLE FILES: this scan already matched 8 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. 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 `contrib/AutoNUE/core/val.py:61` 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, `contrib/DomainAdaptation/script/val.py:196` calls `info`, `Eval`, `reset` and `contrib/AutoNUE/core/val.py:59` 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 (8–11 lines × 3) · ×1
  • Duplicated block (8–11 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:608 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:608-618 | contrib/MedicalSeg/medicalseg/models/nnformer.py:859-866 | paddleseg/models/backbones/swin_transformer.py:606-615 — 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 `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:608` 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 (15–21 lines × 2) · ×1
  • Duplicated block (15–21 lines × 2) contrib/CrossPseudoSupervision/core/train.py:269 — contrib/CrossPseudoSupervision/core/train.py:269-289 | paddleseg/core/train.py:270-284 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) paddleseg/models/backbones/lite_hrnet.py:64 — paddleseg/models/backbones/lite_hrnet.py:64-71 | paddleseg/models/sinet.py:115-125 — 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 (10 lines × 9) · ×1
  • Duplicated block (10 lines × 9) paddleseg/datasets/ade.py:70 — paddleseg/datasets/ade.py:70-79 | paddleseg/datasets/chase_db1.py:73-82 | paddleseg/datasets/drive.py:71-80 | paddleseg/datasets/eg1800.py:75-84 | paddleseg/datasets/hrf.py:70-79 | paddleseg/datasets/mini_deep_globe_road_extraction.py:70-79 | paddleseg/datasets/optic_disc_seg.py:70-79 | paddleseg/datasets/stare.py:70-79 | paddleseg/datasets/supervisely.py:75-84 — before extracting anything, compare `paddleseg/datasets/ade.py` and `paddleseg/datasets/mini_deep_globe_road_extraction.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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, `paddleseg/datasets/optic_disc_seg.py:82` calls `join` and `paddleseg/datasets/mini_deep_globe_road_extraction.py:81` 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 (9–10 lines × 6) · ×1
  • Duplicated block (9–10 lines × 6) contrib/AutoNUE/scripts/train.py:173 — contrib/AutoNUE/scripts/train.py:173-181 | contrib/CityscapesSOTA/scripts/train.py:176-184 | contrib/LaneSeg/core/train.py:216-224 | contrib/MedicalSeg/medicalseg/core/train.py:174-183 | contrib/PanopticDeepLab/core/train.py:195-203 | contrib/RSSegBenchmark/c2fnet/core/train.py:255-263 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:173` 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 (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) contrib/MedicalSeg/test.py:72 — contrib/MedicalSeg/test.py:72-80 | contrib/MedicalSeg/train.py:123-132 | contrib/MedicalSeg/val.py:72-79 — before extracting anything, compare `contrib/MedicalSeg/test.py` and `contrib/MedicalSeg/val.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 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 `contrib/MedicalSeg/train.py:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (7–9 lines × 12) · ×1
  • Duplicated block (7–9 lines × 12) REDACTED:292 — REDACTED:292-298 | contrib/AutoNUE/scripts/train.py:235-241 | contrib/CityscapesSOTA/scripts/train.py:239-245 | contrib/CrossPseudoSupervision/core/train.py:358-365 | contrib/DomainAdaptation/script/train.py:497-505 | contrib/LaneSeg/core/train.py:278-284 | contrib/MedicalSeg/medicalseg/core/train.py:245-251 | contrib/MedicalSeg/nnunet/core/train.py:221-227 | contrib/PanopticDeepLab/core/train.py:247-253 | contrib/PanopticSeg/paddlepanseg/core/train.py:234-240 | contrib/RSSegBenchmark/c2fnet/core/train.py:319-325 | deploy/slim/distill/distill_utils.py:323-329 — before extracting anything, compare `REDACTED` and `contrib/AutoNUE/scripts/train.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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 `REDACTED:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `contrib/CrossPseudoSupervision/core/train.py:355` calls `save`, `state_dict`, `join` and `REDACTED:290` 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 (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) paddleseg/datasets/ade.py:69 — paddleseg/datasets/ade.py:69-77 | paddleseg/datasets/chase_db1.py:72-80 | paddleseg/datasets/drive.py:70-78 | paddleseg/datasets/eg1800.py:74-82 | paddleseg/datasets/hrf.py:69-77 | paddleseg/datasets/mini_deep_globe_road_extraction.py:69-77 | paddleseg/datasets/optic_disc_seg.py:69-77 | paddleseg/datasets/stare.py:69-77 | paddleseg/datasets/supervisely.py:74-82 | paddleseg/datasets/voc.py:67-75 — before extracting anything, compare `paddleseg/datasets/ade.py` and `paddleseg/datasets/mini_deep_globe_road_extraction.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 `paddleseg/datasets/ade.py:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `paddleseg/datasets/voc.py:77` calls `join` and `paddleseg/datasets/eg1800.py:84` 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 (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) contrib/QualityInspector/tools/uad/padim/train.py:48 — contrib/QualityInspector/tools/uad/padim/train.py:48-56 | contrib/QualityInspector/tools/uad/padim/val.py:56-64 | contrib/QualityInspector/tools/uad/patchcore/train.py:46-54 | contrib/QualityInspector/tools/uad/patchcore/val.py:46-54 | contrib/QualityInspector/tools/uad/stfpm/predict.py:36-44 | contrib/QualityInspector/tools/uad/stfpm/train.py:41-49 | contrib/QualityInspector/tools/uad/stfpm/val.py:39-47 — before extracting anything, compare `contrib/QualityInspector/tools/uad/padim/train.py` and `contrib/QualityInspector/tools/uad/padim/val.py` as WHOLE FILES: this scan already matched 4 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `contrib/QualityInspector/tools/uad/patchcore/train.py:54` calls `add_argument` and `contrib/QualityInspector/tools/uad/padim/train.py:56` 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 (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) contrib/AutoNUE/core/infer.py:188 — contrib/AutoNUE/core/infer.py:188-196 | contrib/AutoNUE/core/infer_crop.py:188-196 | contrib/AutoNUE/core/infer_generate_autolabel.py:188-196 | contrib/RSSegBenchmark/c2fnet/core/infer.py:157-165 | paddleseg/core/infer.py:170-178 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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, `contrib/RSSegBenchmark/c2fnet/core/infer.py:155` calls `hasattr`, `transpose` and `contrib/AutoNUE/core/infer.py:186` 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 × 4) · ×1
  • Duplicated block (8–9 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:196 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:196-203 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:490-498 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:183-190 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:465-473 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) EISeg/eiseg/plugin/video/video_tools.py:65 — EISeg/eiseg/plugin/video/video_tools.py:65-71 | EISeg/eiseg/util/vis.py:112-120 — 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 (2–9 lines × 3) · ×1
  • Duplicated block (2–9 lines × 3) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:186 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:186-194 | contrib/MedicalSeg/medicalseg/models/nnformer.py:329-330 | paddleseg/models/backbones/swin_transformer.py:153-161 — 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 `contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:186` 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 (4–9 lines × 3) · ×1
  • Duplicated block (4–9 lines × 3) paddleseg/models/backbones/xception_deeplab.py:309 — paddleseg/models/backbones/xception_deeplab.py:309-312 | paddleseg/models/backbones/xception_deeplab.py:333-341 | paddleseg/models/backbones/xception_deeplab.py:355-363 — 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. 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–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) paddleseg/models/ddrnet.py:161 — paddleseg/models/ddrnet.py:161-166 | paddleseg/models/rtformer.py:177-185 — 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 (9 lines × 14) · ×1
  • Duplicated block (9 lines × 14) contrib/CrossPseudoSupervision/train.py:127 — contrib/CrossPseudoSupervision/train.py:127-135 | contrib/CrossPseudoSupervision/val.py:132-140 | contrib/LaneSeg/train.py:149-157 | contrib/LaneSeg/val.py:86-94 | contrib/MedicalSeg/train.py:162-170 | contrib/QualityInspector/tools/seg/train.py:150-158 | contrib/QualityInspector/tools/seg/val.py:131-139 | contrib/RSSegBenchmark/c2fnet/train.py:207-215 | contrib/RSSegBenchmark/c2fnet/val.py:167-175 | contrib/RSSegBenchmark/train.py:199-207 | contrib/RSSegBenchmark/val.py:159-167 | deploy/slim/quant/qat_val.py:140-148 | tools/train.py:202-210 | tools/val.py:139-147 — before extracting anything, compare `contrib/CrossPseudoSupervision/train.py` and `contrib/QualityInspector/tools/seg/train.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 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, `contrib/CrossPseudoSupervision/train.py:137` calls `convert_sync_batchnorm` and `deploy/slim/quant/qat_val.py:150` 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 (8 lines × 10) · ×1
  • Duplicated block (8 lines × 10) REDACTED:286 — REDACTED:286-293 | contrib/AutoNUE/scripts/train.py:229-236 | contrib/CityscapesSOTA/scripts/train.py:233-240 | contrib/LaneSeg/core/train.py:272-279 | contrib/MedicalSeg/medicalseg/core/train.py:239-246 | contrib/PanopticDeepLab/core/train.py:241-248 | contrib/PanopticSeg/paddlepanseg/core/train.py:228-235 | contrib/RSSegBenchmark/c2fnet/core/train.py:313-320 | deploy/slim/distill/distill_utils.py:317-324 | paddleseg/core/train.py:360-367 — before extracting anything, compare `REDACTED` and `contrib/AutoNUE/scripts/train.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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 `REDACTED:286` 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 (8 lines × 8) · ×1
  • Duplicated block (8 lines × 8) contrib/AutoNUE/datasets/auto_nue.py:83 — contrib/AutoNUE/datasets/auto_nue.py:83-91 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:83-91 | contrib/AutoNUE/datasets/auto_nue_autolabel.py:132-139 | contrib/AutoNUE/datasets/auto_nue_crop.py:83-91 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:102-110 | contrib/CityscapesSOTA/datasets/cityscapes_autolabeling.py:145-152 | paddleseg/datasets/cityscapes.py:73-81 | paddleseg/datasets/cocostuff.py:69-76 — before extracting anything, compare `contrib/AutoNUE/datasets/auto_nue.py` and `contrib/AutoNUE/datasets/auto_nue_autolabel.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 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 `contrib/AutoNUE/datasets/auto_nue.py:83` 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 (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) contrib/AutoNUE/scripts/train.py:173 — contrib/AutoNUE/scripts/train.py:173-180 | contrib/CityscapesSOTA/scripts/train.py:176-183 | contrib/LaneSeg/core/train.py:216-223 | contrib/MedicalSeg/medicalseg/core/train.py:174-182 | contrib/PanopticDeepLab/core/train.py:195-202 | contrib/RSSegBenchmark/c2fnet/core/train.py:255-262 | deploy/slim/distill/distill_utils.py:253-260 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/AutoNUE/scripts/train.py:173` 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 (7–8 lines × 6) · ×1
  • Duplicated block (7–8 lines × 6) paddleseg/models/backbones/mix_transformer.py:48 — paddleseg/models/backbones/mix_transformer.py:48-54 | paddleseg/models/backbones/mix_transformer.py:105-111 | paddleseg/models/backbones/mix_transformer.py:186-192 | paddleseg/models/backbones/mix_transformer.py:236-242 | paddleseg/models/backbones/mix_transformer.py:380-386 | paddleseg/models/backbones/swin_transformer.py:672-679 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6–8 lines × 4) · ×1
  • Duplicated block (6–8 lines × 4) contrib/MedicalSeg/nnunet/utils/base_predictor.py:593 — contrib/MedicalSeg/nnunet/utils/base_predictor.py:593-598 | contrib/MedicalSeg/nnunet/utils/base_predictor.py:619-626 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:567-572 | contrib/MedicalSeg/nnunet/utils/static_predictor.py:593-600 — before extracting anything, compare `contrib/MedicalSeg/nnunet/utils/base_predictor.py` and `contrib/MedicalSeg/nnunet/utils/static_predictor.py` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 356 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 `contrib/MedicalSeg/nnunet/utils/base_predictor.py:593` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (3–7 lines × 3) · ×1
  • Duplicated block (3–7 lines × 3) contrib/QualityInspector/tools/uad/stfpm/predict.py:88 — contrib/QualityInspector/tools/uad/stfpm/predict.py:88-94 | contrib/QualityInspector/tools/uad/stfpm/val.py:129-135 | paddleseg/models/stfpm.py:39-41 — before extracting anything, compare `contrib/QualityInspector/tools/uad/stfpm/predict.py` and `contrib/QualityInspector/tools/uad/stfpm/val.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 (6 lines × 11) · ×1
  • Duplicated block (6 lines × 11) REDACTED:289 — REDACTED:289-294 | contrib/AutoNUE/scripts/train.py:232-237 | contrib/CityscapesSOTA/scripts/train.py:236-241 | contrib/CrossPseudoSupervision/core/train.py:352-358 | contrib/LaneSeg/core/train.py:275-280 | contrib/MedicalSeg/medicalseg/core/train.py:242-247 | contrib/PanopticDeepLab/core/train.py:244-249 | contrib/PanopticSeg/paddlepanseg/core/train.py:231-236 | contrib/RSSegBenchmark/c2fnet/core/train.py:316-321 | deploy/slim/distill/distill_utils.py:320-325 | paddleseg/core/train.py:363-368 — before extracting anything, compare `REDACTED` and `contrib/AutoNUE/scripts/train.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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, `contrib/CrossPseudoSupervision/core/train.py:359` calls `save`, `state_dict`, `join` and `REDACTED:295` 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 (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) contrib/AutoNUE/scripts/train.py:172 — contrib/AutoNUE/scripts/train.py:172-177 | contrib/CityscapesSOTA/scripts/train.py:175-180 | contrib/LaneSeg/core/train.py:215-220 | contrib/MedicalSeg/medicalseg/core/train.py:173-179 | contrib/MedicalSeg/nnunet/core/train.py:153-159 | contrib/PanopticDeepLab/core/train.py:194-199 | contrib/PanopticSeg/paddlepanseg/core/train.py:183-189 | contrib/RSSegBenchmark/c2fnet/core/train.py:254-259 | deploy/slim/distill/distill_utils.py:252-257 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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, `contrib/PanopticSeg/paddlepanseg/core/train.py:192` calls `get_lr` and `contrib/AutoNUE/scripts/train.py:180` 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 (6 lines × 16) · ×1
  • Duplicated block (6 lines × 16) Matting/ppmatting/models/backbone/hrnet.py:185 — Matting/ppmatting/models/backbone/hrnet.py:185-190 | Matting/ppmatting/models/backbone/stdcnet.py:104-109 | contrib/AutoNUE/models/backbones/hrnet_nv.py:192-197 | contrib/AutoNUE/models/ocrnet_nv.py:150-155 | contrib/CityscapesSOTA/models/backbones/hrnet_nv.py:186-191 | contrib/CityscapesSOTA/models/ocrnet_nv.py:159-164 | contrib/RSSegBenchmark/c2fnet/models/c2fnet.py:332-337 | paddleseg/models/backbones/efficientformerv2.py:178-183 | paddleseg/models/backbones/hrformer.py:981-986 | paddleseg/models/backbones/hrnet.py:199-204 | paddleseg/models/backbones/stdcnet.py:111-116 | paddleseg/models/backbones/uhrnet.py:366-371 | paddleseg/models/fcn.py:137-142 | paddleseg/models/mscale_ocrnet.py:370-375 | paddleseg/models/ocrnet.py:142-147 | paddleseg/models/pphumanseg_lite.py:95-100 — before extracting anything, compare `Matting/ppmatting/models/backbone/hrnet.py` and `contrib/AutoNUE/models/backbones/hrnet_nv.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 237 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, `contrib/AutoNUE/models/backbones/hrnet_nv.py:187` calls `concat` and `paddleseg/models/pphumanseg_lite.py:90` 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 (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) contrib/AutoNUE/scripts/train.py:229 — contrib/AutoNUE/scripts/train.py:229-233 | contrib/CityscapesSOTA/scripts/train.py:233-237 | contrib/DomainAdaptation/script/train.py:487-493 | contrib/LaneSeg/core/train.py:272-276 | contrib/MedicalSeg/medicalseg/core/train.py:239-243 | contrib/RSSegBenchmark/c2fnet/core/train.py:313-317 | deploy/slim/distill/distill_utils.py:317-321 | paddleseg/core/train.py:360-364 — before extracting anything, compare `contrib/AutoNUE/scripts/train.py` and `contrib/CityscapesSOTA/scripts/train.py` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 388 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 `contrib/DomainAdaptation/script/train.py:487` 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) contrib/MedicalSeg/medicalseg/transforms/functional.py:258 — contrib/MedicalSeg/medicalseg/transforms/functional.py:258-263 | contrib/MedicalSeg/medicalseg/transforms/functional.py:282-287 | contrib/MedicalSeg/nnunet/transforms/functional.py:286-291 | contrib/MedicalSeg/nnunet/transforms/functional.py:310-315 | contrib/MedicalSeg/nnunet/transforms/functional.py:761-765 — before extracting anything, compare `contrib/MedicalSeg/medicalseg/transforms/functional.py` and `contrib/MedicalSeg/nnunet/transforms/functional.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 `contrib/MedicalSeg/medicalseg/transforms/functional.py:258` 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, `contrib/MedicalSeg/medicalseg/transforms/functional.py:266` calls `uniform` and `contrib/MedicalSeg/medicalseg/transforms/functional.py:289` 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 (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) Matting/deploy/python/infer.py:274 — Matting/deploy/python/infer.py:274-278 | contrib/LaneSeg/deploy/python/infer.py:85-89 | contrib/PanopticSeg/deploy/python/infer.py:239-243 | deploy/python/infer.py:142-146 — before extracting anything, compare `Matting/deploy/python/infer.py` and `contrib/PanopticSeg/deploy/python/infer.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 (7 lines × 24) · ×1
  • Duplicated block (7 lines × 24) Matting/ppmatting/models/backbone/mobilenetv3.py:421 — Matting/ppmatting/models/backbone/mobilenetv3.py:421-427 | Matting/ppmatting/models/backbone/mobilenetv3.py:432-438 | Matting/ppmatting/models/backbone/mobilenetv3.py:443-449 | Matting/ppmatting/models/backbone/mobilenetv3.py:454-460 | Matting/ppmatting/models/backbone/mobilenetv3.py:465-471 | Matting/ppmatting/models/backbone/mobilenetv3.py:476-482 | Matting/ppmatting/models/backbone/mobilenetv3.py:487-493 | Matting/ppmatting/models/backbone/mobilenetv3.py:498-504 | Matting/ppmatting/models/backbone/mobilenetv3.py:509-515 | Matting/ppmatting/models/backbone/mobilenetv3.py:520-526 | Matting/ppmatting/models/backbone/mobilenetv3.py:531-537 | Matting/ppmatting/models/backbone/mobilenetv3.py:542-548 | paddleseg/models/backbones/mobilenetv3.py:371-377 | paddleseg/models/backbones/mobilenetv3.py:382-388 | paddleseg/models/backbones/mobilenetv3.py:393-399 | paddleseg/models/backbones/mobilenetv3.py:404-410 | paddleseg/models/backbones/mobilenetv3.py:415-421 | paddleseg/models/backbones/mobilenetv3.py:426-432 | paddleseg/models/backbones/mobilenetv3.py:437-443 | paddleseg/models/backbones/mobilenetv3.py:448-454 | paddleseg/models/backbones/mobilenetv3.py:459-465 | paddleseg/models/backbones/mobilenetv3.py:470-476 | paddleseg/models/backbones/mobilenetv3.py:481-487 | paddleseg/models/backbones/mobilenetv3.py:492-498 — before extracting anything, compare `Matting/ppmatting/models/backbone/mobilenetv3.py` and `paddleseg/models/backbones/mobilenetv3.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 107 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 (20 lines × 7) · ×1
  • Duplicated block (20 lines × 7) contrib/AutoNUE/core/infer.py:81 — contrib/AutoNUE/core/infer.py:81-100 | contrib/AutoNUE/core/infer_crop.py:81-100 | contrib/AutoNUE/core/infer_ensemble.py:81-100 | contrib/AutoNUE/core/infer_ensemble_three.py:81-100 | contrib/AutoNUE/core/infer_generate_autolabel.py:81-100 | contrib/RSSegBenchmark/c2fnet/core/infer.py:50-69 | paddleseg/core/infer.py:51-70 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) contrib/AutoNUE/core/infer.py:104 — contrib/AutoNUE/core/infer.py:104-109 | contrib/AutoNUE/core/infer_crop.py:104-109 | contrib/AutoNUE/core/infer_ensemble.py:104-109 | contrib/AutoNUE/core/infer_ensemble_three.py:104-109 | contrib/AutoNUE/core/infer_generate_autolabel.py:104-109 | contrib/RSSegBenchmark/c2fnet/core/infer.py:73-78 | paddleseg/core/infer.py:84-89 — before extracting anything, compare `contrib/AutoNUE/core/infer.py` and `contrib/AutoNUE/core/infer_crop.py` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 219 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 (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:60 — contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.py:60-65 | contrib/MedicalSeg/medicalseg/models/nnformer.py:121-126 | REDACTED:47-52 | paddleseg/models/backbones/swin_transformer.py:43-48 | REDACTED:45-50 | paddleseg/models/backbones/vit_adapter.py:76-81 — 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. 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 × 6) · ×1
  • Duplicated block (9 lines × 6) paddleseg/models/ann.py:72 — paddleseg/models/ann.py:72-80 | paddleseg/models/deeplab.py:191-199 | paddleseg/models/fcn.py:75-83 | paddleseg/models/gcnet.py:68-76 | paddleseg/models/glore.py:71-79 | paddleseg/models/pspnet.py:69-77 — 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 6 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 (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:15 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:15-37 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java:56-78 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Utils.java:15-37 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java` and `deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/Utils.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Utils.java:15` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–18 lines × 3) · ×1
  • Duplicated block (4–18 lines × 3) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:117 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:117-134 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/examples/segmentation/SegmentationSettingsActivity.java:95-98 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/SettingsActivity.java:117-134 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/SettingsActivity.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 111 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 `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:117` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (110 lines × 3) · ×1
  • Duplicated block (110 lines × 3) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/AppCompatPreferenceActivity.java:1 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/AppCompatPreferenceActivity.java:1-126 | deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/view/AppCompatPreferenceActivity.java:1-110 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/AppCompatPreferenceActivity.java:1-126 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/AppCompatPreferenceActivity.java` and `deploy/fastdeploy/semantic_segmentation/android/app/src/main/java/com/baidu/paddle/fastdeploy/app/ui/view/AppCompatPreferenceActivity.java` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/AppCompatPreferenceActivity.java:1` 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 · Edited copy of a member (77 corresponding lines) · ×1
  • Edited copy of a member (77 corresponding lines) tools/analyse.py:24 — tools/analyse.py:24-109 | tools/predict.py:27-108 — These two members are one piece of code written twice and then edited apart: 77 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 (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:81 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/SettingsActivity.java:81-134 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/SettingsActivity.java:81-134 — These two members are one piece of code written twice and then edited apart: 54 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 (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:462 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:462-513 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:329-378 — 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 (65 corresponding lines) · ×1
  • Edited copy of a member (65 corresponding lines) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:91 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:91-163 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:76-140 — These two members are one piece of code written twice and then edited apart: 65 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 (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) tools/data/create_dataset_list.py:23 — tools/data/create_dataset_list.py:23-65 | tools/data/split_dataset_list.py:24-53 — These two members are one piece of code written twice and then edited apart: 30 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 (62–65 lines × 2) · ×1
  • Duplicated block (62–65 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:99 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:99-163 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:79-140 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 180 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 `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:99` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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, `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/MainActivity.java:96` calls `findViewById` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/MainActivity.java:78` 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 (42–43 lines × 2) · ×1
  • Duplicated block (42–43 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:130 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java:130-172 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java:128-169 — before extracting anything, compare `Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/Predictor.java` and `deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/Predictor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 139 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (35–39 lines × 2) · ×1
  • Duplicated block (35–39 lines × 2) Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/visual/Visualize.java:22 — Matting/deploy/human_matting_android_demo/app/src/main/java/com/paddle/demo/matting/visual/Visualize.java:22-56 | deploy/lite/human_segmentation_demo/app/src/main/java/com/baidu/paddle/lite/demo/segmentation/visual/Visualize.java:16-54 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×1
  • JavaScript dependencies are not locked deploy/web/example/package.json:11 — deploy/web/example/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
Minor — 690 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×578
  • Orphaned file REDACTED: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 paddleseg/models/backbones/hrformer.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 contrib/MedicalSeg/medicalseg/models/nnformer.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 paddleseg/models/backbones/lite_hrnet.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 paddleseg/models/backbones/uhrnet.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 paddleseg/models/pointrend.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 contrib/MedicalSeg/medicalseg/transforms/transform.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 paddleseg/models/backbones/swin_transformer.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 contrib/MedicalSeg/nnunet/utils/base_predictor.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 contrib/MedicalSeg/tools/preprocess_utils/experiment_planner.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 paddleseg/models/backbones/hrnet.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 contrib/MedicalSeg/nnunet/transforms/functional.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 contrib/CityscapesSOTA/models/backbones/hrnet_nv.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 Matting/ppmatting/models/backbone/hrnet.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 contrib/MedicalSeg/nnunet/utils/static_predictor.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 contrib/MedicalSeg/medicalseg/models/backbones/swin_transformer.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 paddleseg/models/backbones/efficientformerv2.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 Matting/deploy/python/infer.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 contrib/MedicalSeg/nnunet/transforms/transform.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 Matting/ppmatting/transforms/transforms.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 paddleseg/models/rtformer.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 contrib/AutoNUE/models/backbones/hrnet_nv.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 paddleseg/models/maskformer.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 paddleseg/models/backbones/pidnet.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 paddleseg/models/backbones/strideformer.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.
  • + 553 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate contrib/CrossPseudoSupervision/cvlibs/config.py:225 — `('=' in item) and (len(item.split('=')) == 2)` appears character-identically in 2 files — contrib/CrossPseudoSupervision/cvlibs/config.py, paddleseg/cvlibs/config.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:234 — `(iter) % log_iters == 0 and local_rank == 0` appears character-identically in 10 files — REDACTED, contrib/AutoNUE/scripts/train.py, contrib/CityscapesSOTA/scripts/train.py, contrib/DomainAdaptation/script/train.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 contrib/MedicalSeg/medicalseg/transforms/functional.py:418 — `(len(sample_data.shape) != 3) and (len(sample_data.shape) != 4)` appears character-identically in 2 files — contrib/MedicalSeg/medicalseg/transforms/functional.py, contrib/MedicalSeg/nnunet/transforms/functional.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 Matting/ppmatting/transforms/transforms.py:411 — `(max_long is not None) and (min_long is not None)` appears character-identically in 2 files — Matting/ppmatting/transforms/transforms.py, paddleseg/transforms/transforms.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 contrib/MedicalSeg/medicalseg/utils/download.py:152 — `(not tarfile.is_tarfile(savepath)) and ( not zipfile.is_zipfile(savepath))` appears character-identically in 2 files — contrib/MedicalSeg/medicalseg/utils/download.py, paddleseg/utils/download.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 contrib/MedicalSeg/medicalseg/transforms/functional.py:218 — `(np.random.uniform() < p_isotropic) and different_sigma_per_axis` appears character-identically in 2 files — contrib/MedicalSeg/medicalseg/transforms/functional.py, contrib/MedicalSeg/nnunet/transforms/functional.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 contrib/AutoNUE/core/infer.py:48 — `(op.max_long is not None) and (long_edge > op.max_long)` appears character-identically in 7 files — contrib/AutoNUE/core/infer.py, contrib/AutoNUE/core/infer_crop.py, contrib/AutoNUE/core/infer_ensemble.py, contrib/AutoNUE/core/infer_ensemble_three.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 contrib/AutoNUE/core/infer.py:52 — `(op.min_long is not None) and (long_edge < op.min_long)` appears character-identically in 7 files — contrib/AutoNUE/core/infer.py, contrib/AutoNUE/core/infer_crop.py, contrib/AutoNUE/core/infer_ensemble.py, contrib/AutoNUE/core/infer_ensemble_three.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 Matting/ppmatting/transforms/transforms.py:423 — `(self.max_long is not None) and (long_edge > self.max_long)` appears character-identically in 2 files — Matting/ppmatting/transforms/transforms.py, paddleseg/transforms/transforms.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 Matting/ppmatting/transforms/transforms.py:425 — `(self.min_long is not None) and (long_edge < self.min_long)` appears character-identically in 2 files — Matting/ppmatting/transforms/transforms.py, paddleseg/transforms/transforms.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 contrib/MedicalSeg/medicalseg/transforms/functional.py:430 — `2 in axes and len(sample_data.shape) == 4` appears character-identically in 2 files — contrib/MedicalSeg/medicalseg/transforms/functional.py, contrib/MedicalSeg/nnunet/transforms/functional.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 contrib/QualityInspector/tools/dataset/gray2pseudo_color.py:95 — `args.dataset_dir is None or args.file_separator is None` appears character-identically in 2 files — contrib/QualityInspector/tools/dataset/gray2pseudo_color.py, tools/data/gray2pseudo_color.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 contrib/RSSegBenchmark/c2fnet/predict.py:153 — `args.device == 'gpu' and env_info[ 'Paddle compiled with cuda'] and env_info['GPUs used']` appears character-identically in 6 files — contrib/RSSegBenchmark/c2fnet/predict.py, contrib/RSSegBenchmark/c2fnet/train.py, contrib/RSSegBenchmark/c2fnet/val.py, contrib/RSSegBenchmark/predict.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 contrib/QualityInspector/tools/end2end/predict.py:65 — `args.device == 'mlu' and paddle.is_compiled_with_mlu()` appears character-identically in 7 files — contrib/QualityInspector/tools/end2end/predict.py, contrib/RSSegBenchmark/c2fnet/predict.py, contrib/RSSegBenchmark/c2fnet/train.py, contrib/RSSegBenchmark/c2fnet/val.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 contrib/RSSegBenchmark/c2fnet/predict.py:158 — `args.device == 'npu' and paddle.is_compiled_with_custom_device('npu')` appears character-identically in 6 files — contrib/RSSegBenchmark/c2fnet/predict.py, contrib/RSSegBenchmark/c2fnet/train.py, contrib/RSSegBenchmark/c2fnet/val.py, contrib/RSSegBenchmark/predict.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 contrib/QualityInspector/tools/end2end/predict.py:61 — `args.device == 'xpu' and paddle.is_compiled_with_xpu()` appears character-identically in 7 files — contrib/QualityInspector/tools/end2end/predict.py, contrib/RSSegBenchmark/c2fnet/predict.py, contrib/RSSegBenchmark/c2fnet/train.py, contrib/RSSegBenchmark/c2fnet/val.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 deploy/python/infer_benchmark.py:192 — `args.resize_width == 0 and args.resize_height == 0` appears character-identically in 2 files — deploy/python/infer_benchmark.py, deploy/python/infer_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 deploy/python/infer_benchmark.py:167 — `args.resize_width > 0 and args.resize_height > 0` appears character-identically in 2 files — deploy/python/infer_benchmark.py, deploy/python/infer_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 contrib/DomainAdaptation/utils/config_check.py:40 — `cfg.dic.get('model', None) and cfg.dic['model'].get('num_classes', None)` appears character-identically in 2 files — contrib/DomainAdaptation/utils/config_check.py, contrib/MedicalSeg/medicalseg/utils/config_check.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 contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py:234 — `cost_class != 0 or cost_mask != 0 or cost_dice != 0` appears character-identically in 2 files — contrib/PanopticSeg/paddlepanseg/runners/maskformer_runner.py, paddleseg/models/losses/maskformer_loss.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 contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py:56 — `cuda_home is not None and os.path.isdir(cuda_home)` appears character-identically in 2 files — contrib/MedicalSeg/medicalseg/utils/env_util/sys_env.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Matting/ppmatting/models/backbone/resnet_vd.py:272 — `dilation_dict and block in dilation_dict` appears character-identically in 2 files — Matting/ppmatting/models/backbone/resnet_vd.py, paddleseg/models/backbones/resnet_vd.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 contrib/QualityInspector/tools/uad/padim/predict.py:155 — `dir_name and not os.path.exists(dir_name)` appears character-identically in 6 files — contrib/QualityInspector/tools/uad/padim/predict.py, contrib/QualityInspector/tools/uad/padim/train.py, contrib/QualityInspector/tools/uad/padim/val.py, contrib/QualityInspector/tools/uad/patchcore/predict.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 contrib/AutoNUE/predict.py:130 — `env_info['Paddle compiled with cuda'] and env_info[ 'GPUs used']` appears character-identically in 20 files — contrib/AutoNUE/predict.py, contrib/AutoNUE/predict_ensemble.py, contrib/AutoNUE/predict_ensemble_three.py, contrib/AutoNUE/train.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 Matting/deploy/python/infer.py:180 — `hasattr(PredictConfig, "collect_shape_range_info") and hasattr(PredictConfig, "enable_tuned_tensorrt_dynamic_shape") and args.device == "gpu…` appears character-identically in 3 files — Matting/deploy/python/infer.py, contrib/MedicalSeg/deploy/python/infer.py, deploy/python/infer.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.
  • + 15 more in this group — see findings.md.
M4 · Documentation accuracy · README/code drift · ×28
  • README/code drift Matting/README.md:68 — Matting/README.md links to `../configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml`, but `configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml` 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 Matting/README.md:69 — Matting/README.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_512.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_512.yml` 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 Matting/README.md:70 — Matting/README.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml` 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 Matting/README.md:71 — Matting/README.md links to `../configs/human_matting/human_matting-resnet34_vd.yml`, but `configs/human_matting/human_matting-resnet34_vd.yml` 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 Matting/README.md:72 — Matting/README.md links to `../configs/modnet/modnet-mobilenetv2.yml`, but `configs/modnet/modnet-mobilenetv2.yml` 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 Matting/README.md:73 — Matting/README.md links to `../configs/modnet/modnet-resnet50_vd.yml`, but `configs/modnet/modnet-resnet50_vd.yml` 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 Matting/README.md:74 — Matting/README.md links to `../configs/modnet/modnet-hrnet_w18.yml`, but `configs/modnet/modnet-hrnet_w18.yml` 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 Matting/README.md:75 — Matting/README.md links to `../configs/dim/dim-vgg16.yml`, but `configs/dim/dim-vgg16.yml` 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 Matting/README_CN.md:66 — Matting/README_CN.md links to `../configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml`, but `configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml` 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 Matting/README_CN.md:67 — Matting/README_CN.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_512.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_512.yml` 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 Matting/README_CN.md:68 — Matting/README_CN.md links to `../configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml`, but `configs/ppmatting/ppmatting-hrnet_w18-human_1024.yml` 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 Matting/README_CN.md:69 — Matting/README_CN.md links to `../configs/human_matting/human_matting-resnet34_vd.yml`, but `configs/human_matting/human_matting-resnet34_vd.yml` 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 Matting/README_CN.md:70 — Matting/README_CN.md links to `../configs/modnet/modnet-mobilenetv2.yml`, but `configs/modnet/modnet-mobilenetv2.yml` 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 Matting/README_CN.md:71 — Matting/README_CN.md links to `../configs/modnet/modnet-resnet50_vd.yml`, but `configs/modnet/modnet-resnet50_vd.yml` 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 Matting/README_CN.md:72 — Matting/README_CN.md links to `../configs/modnet/modnet-hrnet_w18.yml`, but `configs/modnet/modnet-hrnet_w18.yml` 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 Matting/README_CN.md:73 — Matting/README_CN.md links to `../configs/dim/dim-vgg16.yml`, but `configs/dim/dim-vgg16.yml` 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 configs/pp_liteseg/README.md:74 — configs/pp_liteseg/README.md links to `../../docs/evaluation/evaluate/evaluate.md`, but `docs/evaluation/evaluate/evaluate.md` 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 configs/pssl/README.md:128 — configs/pssl/README.md links to `./pp_liteseg_stdc2_cityscapes_1024x512_scale1.0_160k.yml`, but `configs/pssl/pp_liteseg_stdc2_cityscapes_1024x512_scale1.0_160k.yml` 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 contrib/MedicalSeg/README.md:211 — contrib/MedicalSeg/README.md links to `../medicalseg/datasets/lung_coronavirus.py`, but `contrib/medicalseg/datasets/lung_coronavirus.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 contrib/MedicalSeg/README.md:211 — contrib/MedicalSeg/README.md links to `../tools/prepare_lung_coronavirus.py`, but `contrib/tools/prepare_lung_coronavirus.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 contrib/MedicalSeg/README_CN.md:172 — contrib/MedicalSeg/README_CN.md links to `../run-vnet.sh`, but `contrib/run-vnet.sh` 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 contrib/MedicalSeg/README_CN.md:218 — contrib/MedicalSeg/README_CN.md links to `../medicalseg/datasets/lung_coronavirus.py`, but `contrib/medicalseg/datasets/lung_coronavirus.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 contrib/MedicalSeg/README_CN.md:218 — contrib/MedicalSeg/README_CN.md links to `../tools/prepare_lung_coronavirus.py`, but `contrib/tools/prepare_lung_coronavirus.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 contrib/PP-HumanSeg/README.md:367 — contrib/PP-HumanSeg/README.md links to `../../docs/evaluation/evaluate/evaluate.md`, but `docs/evaluation/evaluate/evaluate.md` 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 contrib/PP-HumanSeg/README_cn.md:369 — contrib/PP-HumanSeg/README_cn.md links to `../../docs/evaluation/evaluate/evaluate_cn.md`, but `docs/evaluation/evaluate/evaluate_cn.md` 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.
  • + 3 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×18
  • Interpolated log message defeats structured logging deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/paddleseg_grpc_client.py:38 — `debug` at line 38 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/paddleseg_grpc_client.py:46 — `info` at line 46 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deploy/fastdeploy/semantic_segmentation/serving/fastdeploy_serving/paddleseg_grpc_client.py:47 — `info` at line 47 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:438 — `info` at line 438 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:519 — `info` at line 519 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:584 — `info` at line 584 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:815 — `info` at line 815 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:952 — `info` at line 952 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:1070 — `info` at line 1070 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:1079 — `info` at line 1079 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:1145 — `info` at line 1145 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:1199 — `info` at line 1199 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:1288 — `info` at line 1288 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:1293 — `info` at line 1293 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/med3d/EISegMed3D/EISegMed3D.py:1546 — `info` at line 1546 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging REDACTED:1097 — `info` at line 1097 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/eiseg/controller.py:111 — `info` at line 111 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging EISeg/eiseg/controller.py:118 — `info` at line 118 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×6
  • Projects may be oversized for their cohesion setup.py:1 — `(repository root)` (67459 LoC, 881 module-visible types across 76 directories) overshoots its size bounds. 6 of 11 build unit(s) (Gradle, 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.
  • Projects may be oversized for their cohesion contrib/MedicalSeg/REDACTED:1 — `contrib/MedicalSeg` (21619 LoC, 235 module-visible types across 21 directories) overshoots its size bounds. 6 of 11 build unit(s) (Gradle, 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.
  • Projects may be oversized for their cohesion EISeg/setup.py:1 — `EISeg` (12732 LoC, 99 module-visible types across 17 directories) overshoots its size bounds. 6 of 11 build unit(s) (Gradle, 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.
  • Projects may be oversized for their cohesion REDACTED:1 — `contrib/QualityInspector` (7199 LoC, 67 module-visible types across 18 directories) overshoots its size bounds. 6 of 11 build unit(s) (Gradle, 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.
  • Projects may be oversized for their cohesion Matting/REDACTED:1 — `Matting` (9916 LoC, 152 module-visible types across 12 directories) overshoots its size bounds. 6 of 11 build unit(s) (Gradle, 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.
  • Projects may be oversized for their cohesion contrib/PanopticSeg/setup.py:1 — `contrib/PanopticSeg` (6878 LoC, 83 module-visible types across 15 directories) overshoots its size bounds. 6 of 11 build unit(s) (Gradle, 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file REDACTED: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 EISeg/med3d/EISegMed3D/EISegMed3D.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 paddleseg/transforms/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.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found deploy/fastdeploy/semantic_segmentation/android/app/build.gradle:1 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `deploy/fastdeploy/semantic_segmentation/android/app/build.gradle` makes this repository a deployable product (line 1).
D21 · Naming Consistency · `ConvertRGBToID` spells `ID` where 13 names in the project spell it `Id` · ×1
  • `ConvertRGBToID` spells `ID` where 13 names in the project spell it `Id` contrib/PanopticSeg/paddlepanseg/transforms/transforms.py:43 — 13 of 14 names in project paddleseg spell the token `Id` (13 of 14; unit: names in project paddleseg containing `Id`). Peers: COCO.delAnnotation(annId) (EISeg/eiseg/util/coco/coco.py:228); COCO.delAnnotation(imgId) (EISeg/eiseg/util/coco/coco.py:228); COCO.updateAnnotation(imgId) (EISeg/eiseg/util/coco/coco.py:240); COCOeval.computeIoU(imgId) (EISeg/eiseg/util/coco/cocoeval.py:171); COCOeval.computeIoU(catId) (EISeg/eiseg/util/coco/cocoeval.py:171). Rename to `ConvertRGBToId`. [rule N6]
D21 · Naming Consistency · `ConvBnReLU2D` spells `Bn` where 27 names in the project spell it `BN` · ×1
  • `ConvBnReLU2D` spells `Bn` where 27 names in the project spell it `BN` paddleseg/models/unet_3plus.py:256 — 27 of 28 names in project paddleseg spell the token `BN` (27 of 28; unit: names in project paddleseg containing `BN`). Peers: Matting.ppmatting.models.backbone.mobilenet_v2.ConvBNLayer (Matting/ppmatting/models/backbone/mobilenet_v2.py:47); Matting.ppmatting.models.backbone.mobilenetv3.ConvBNLayer (Matting/ppmatting/models/backbone/mobilenetv3.py:277); Matting.ppmatting.models.backbone.resnet_vd.ConvBNLayer (Matting/ppmatting/models/backbone/resnet_vd.py:29); Matting.ppmatting.models.backbone.stdcnet.ConvBNRelu (Matting/ppmatting/models/backbone/stdcnet.py:114); contrib.PanopticDeepLab.models.panoptic_deeplab.SeparableConvBNReLU (contrib/PanopticDeepLab/models/panoptic_deeplab.py:196). Rename to `ConvBNReLU2D`. [rule N6]
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Dormant codebase · ×1
  • Dormant codebase — 581 of 581 significant files have no living knowledge — the codebase as a whole is dormant, not 581 separate risks. Counted over 581 of the 830 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M1 · Documentation (README) · Thin README · ×1
  • Thin README README.md:1 — The root README is 0 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers.
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.
P1 · CI/CD gates · CI build step not evidenced · ×1
  • CI build step not evidenced — A CI pipeline exists but no build step was matched — changes may merge without the build ever running. A build step may be invoked directly as a command, or declared as a task that a runner named in the pipeline resolves.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 1 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 deploy/web/example/package.json:11 — `deploy/web/example/package.json` 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`.
P4 · Deployment & Rollback · No rollback/health safety · ×1
  • No rollback/health safety — Deployment automation exists but no readiness/liveness probes, rolling-update strategy, lifecycle hooks or migration job were evidenced — a bad release is harder to detect and reverse.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X5 · Nullable reference types · Java packages are not null-marked everywhere · ×1
  • Java packages are not null-marked everywhere — 0/6 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

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 --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-3980899ba7044ca8926bbc1358f6da40/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-3980899ba7044ca8926bbc1358f6da40/history-1.json --exit-code 0 --source .3artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=1998" --report-format json --report-path /tmp/watchdog-gitleaks-3980899ba7044ca8926bbc1358f6da40/history-2.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-2.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-3980899ba7044ca8926bbc1358f6da40/tree.json --exit-code 0 --source .2artifacts/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 .97artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .3artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 2 file(s) — `EISeg/tool/ts/Arabic.ts`, `EISeg/tool/ts/English.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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 Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e6f9-e4c0-7d28-93c0-354ab084a838 · 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