Public report of brycedrennan/imaginAIry, 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 reportMeasured 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, 21:44 UTC · Survey ID cd_bba0ab29d17242cc9b06a48f451dee6d
brycedrennan/imaginAIry
Measured 17 November 2026, 21:41 UTC, at code version 1c79db1
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 scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 31,150 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.2 person-years · Weakest lens: Security and Compliance, 32.1
Findings by how serious they are
51 critical283 serious160 minor
16 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 21:41 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
45of 45 dimensions measured by tools.
490of 494 findings point to an exact file and line, so you can open each one in the code. The other 4 concern the repository as a whole, such as missing documentation.
45dimensions across 6 lenses, read from 31,150 lines of product code in 1 project.
brycedrennan/imaginAIry is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because we found no access checks on the code's endpoints or handlers and nine of the dependencies have a known vulnerability. It scores 45.7 out of 100, which the At risk rating leaves unchanged.
Security and Compliance, at 32.1, is the weakest lens and counts most in the score. The best first step is adding access checks, worth about 11.8 points. Recording design decisions comes next, worth about 3.5 points. Raising Security and Compliance to 70 would lift the score to about 56.3.
Twenty-three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fourteen known security holes in the packages the code depends on can be used by attackers, and six places in the code run text as code, which an attacker could use. Pinning each tool to an exact version, updating the vulnerable packages and replacing text run as code with direct calls would close these risks. The five pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions. The two unsafe settings in infrastructure or container files need changing to safe values.
The product code is 31,150 lines, about €30,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe 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.
If Security and Compliance rose from 32.1 to 70, the lowest score rated Strong, the score would rise from 45.7 to about 56.3.
Code composition: what the lines of code are
Product code 92%Tests 8%
Rebuild cost: about €30,000 · Estimate
Cost to rebuild
€10,000 to €51,000, for 168 to 533 hours of work, about 0.2 person-years for one engineer
Difficulty of the problem
Standard, 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.
Size
Medium: 31,150 lines of product code
What it is not
Not 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
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
Raises the score by about 11.8 points · Medium effort · Access Controls
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with setup.py.
Raises the score by about 3.5 points · Low effort · ADR Quality
3
Resolve the 9 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9).
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 €30,000 to build again, about 0.2 person-years of work. Its weakest lens is Security and Compliance, at 32.1 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do. Of all the actions in this report, it raises the score most for the work it takes: about 11.8 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 449 lines over the last 90 days, which is about 1,821 lines a year. At that pace, the extra work comes to an estimated 0.1 to 0.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
237 modules, with 150 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; 197 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.
modules.sgm.diffusionmodules.model uses modules.attention, so a change to modules.attention can break modules.sgm.diffusionmodules.model, while a change to modules.sgm.diffusionmodules.model can't break modules.attention.
Position
Below the diagonal: modules.sgm.diffusionmodules.model uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.layers.chain uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.fluxion.layers.chain, while a change to vendored.refiners.fluxion.layers.chain can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.fluxion.layers.chain uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.clip.tokenizer uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.clip.tokenizer, while a change to vendored.refiners.foundationals.clip.tokenizer can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.clip.tokenizer uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.adapters.lora uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.fluxion.adapters.lora, while a change to vendored.refiners.fluxion.adapters.lora can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.fluxion.adapters.lora uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.adapters.lora uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.fluxion.adapters.lora, while a change to vendored.refiners.fluxion.adapters.lora can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.fluxion.adapters.lora uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.adapters.lora uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.fluxion.adapters.lora, while a change to vendored.refiners.fluxion.adapters.lora can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.fluxion.adapters.lora uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.layers.attentions uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.fluxion.layers.attentions, while a change to vendored.refiners.fluxion.layers.attentions can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.fluxion.layers.attentions uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.layers.attentions uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.fluxion.layers.attentions, while a change to vendored.refiners.fluxion.layers.attentions can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.fluxion.layers.attentions uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.layers.linear uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.fluxion.layers.linear, while a change to vendored.refiners.fluxion.layers.linear can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.fluxion.layers.linear uses a module listed above it, which is the healthy direction.
vendored.refiners.fluxion.layers.linear uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.fluxion.layers.linear, while a change to vendored.refiners.fluxion.layers.linear can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.fluxion.layers.linear uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.clip.text_encoder uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.clip.text_encoder, while a change to vendored.refiners.foundationals.clip.text_encoder can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.clip.text_encoder uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.dinov2.vit uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.dinov2.vit, while a change to vendored.refiners.foundationals.dinov2.vit can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.dinov2.vit uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.dinov2.vit uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.dinov2.vit, while a change to vendored.refiners.foundationals.dinov2.vit can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.dinov2.vit uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.auto_encoder uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.auto_encoder, while a change to vendored.refiners.foundationals.latent_diffusion.auto_encoder can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.auto_encoder uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.cross_attention uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.cross_attention uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.cross_attention, while a change to vendored.refiners.foundationals.latent_diffusion.cross_attention can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.cross_attention uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.freeu uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.freeu, while a change to vendored.refiners.foundationals.latent_diffusion.freeu can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.freeu uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.freeu uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.latent_diffusion.freeu, while a change to vendored.refiners.foundationals.latent_diffusion.freeu can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.freeu uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.freeu uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.freeu, while a change to vendored.refiners.foundationals.latent_diffusion.freeu can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.freeu uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.range_adapter uses a type in vendored.refiners.fluxion.adapters.adapter.
vendored.refiners.foundationals.latent_diffusion.range_adapter uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.range_adapter, while a change to vendored.refiners.foundationals.latent_diffusion.range_adapter can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.range_adapter uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.range_adapter uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.range_adapter uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.range_adapter, while a change to vendored.refiners.foundationals.latent_diffusion.range_adapter can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.range_adapter uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses a type in vendored.refiners.fluxion.adapters.adapter.
vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.self_attention_guidance, while a change to vendored.refiners.foundationals.latent_diffusion.self_attention_guidance can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses a type in vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler.
vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler, so a change to vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler can break vendored.refiners.foundationals.latent_diffusion.self_attention_guidance, while a change to vendored.refiners.foundationals.latent_diffusion.self_attention_guidance can't break vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.self_attention_guidance, while a change to vendored.refiners.foundationals.latent_diffusion.self_attention_guidance can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.self_attention_guidance uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.t2i_adapter uses a type in vendored.refiners.fluxion.adapters.adapter.
vendored.refiners.foundationals.latent_diffusion.t2i_adapter uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.t2i_adapter, while a change to vendored.refiners.foundationals.latent_diffusion.t2i_adapter can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.t2i_adapter uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.t2i_adapter uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.latent_diffusion.t2i_adapter, while a change to vendored.refiners.foundationals.latent_diffusion.t2i_adapter can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.t2i_adapter uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.t2i_adapter uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.t2i_adapter, while a change to vendored.refiners.foundationals.latent_diffusion.t2i_adapter can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.t2i_adapter uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in vendored.refiners.foundationals.segment_anything.image_encoder uses a type in vendored.refiners.fluxion.layers.module.
vendored.refiners.foundationals.segment_anything.image_encoder uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.segment_anything.image_encoder, while a change to vendored.refiners.foundationals.segment_anything.image_encoder can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.image_encoder uses a module listed above it, which is the healthy direction.
8 pairs of types, where a type in vendored.refiners.foundationals.segment_anything.image_encoder uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.segment_anything.image_encoder uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.segment_anything.image_encoder, while a change to vendored.refiners.foundationals.segment_anything.image_encoder can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.image_encoder uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.segment_anything.mask_decoder uses a type in vendored.refiners.fluxion.layers.module.
vendored.refiners.foundationals.segment_anything.mask_decoder uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.segment_anything.mask_decoder, while a change to vendored.refiners.foundationals.segment_anything.mask_decoder can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.mask_decoder uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.segment_anything.mask_decoder uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.segment_anything.mask_decoder, while a change to vendored.refiners.foundationals.segment_anything.mask_decoder can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.mask_decoder uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.segment_anything.prompt_encoder uses a type in vendored.refiners.fluxion.layers.module.
vendored.refiners.foundationals.segment_anything.prompt_encoder uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.segment_anything.prompt_encoder, while a change to vendored.refiners.foundationals.segment_anything.prompt_encoder can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.prompt_encoder uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in vendored.refiners.foundationals.segment_anything.prompt_encoder uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.segment_anything.prompt_encoder uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.segment_anything.prompt_encoder, while a change to vendored.refiners.foundationals.segment_anything.prompt_encoder can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.prompt_encoder uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.clip.concepts uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.clip.concepts, while a change to vendored.refiners.foundationals.clip.concepts can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.clip.concepts uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.clip.concepts uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.clip.concepts, while a change to vendored.refiners.foundationals.clip.concepts can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.clip.concepts uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.clip.concepts uses vendored.refiners.foundationals.clip.tokenizer, so a change to vendored.refiners.foundationals.clip.tokenizer can break vendored.refiners.foundationals.clip.concepts, while a change to vendored.refiners.foundationals.clip.concepts can't break vendored.refiners.foundationals.clip.tokenizer.
Position
Below the diagonal: vendored.refiners.foundationals.clip.concepts uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.clip.concepts uses vendored.refiners.foundationals.clip.text_encoder, so a change to vendored.refiners.foundationals.clip.text_encoder can break vendored.refiners.foundationals.clip.concepts, while a change to vendored.refiners.foundationals.clip.concepts can't break vendored.refiners.foundationals.clip.text_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.clip.concepts uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.image_prompt uses a type in vendored.refiners.fluxion.adapters.adapter.
vendored.refiners.foundationals.latent_diffusion.image_prompt uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.image_prompt, while a change to vendored.refiners.foundationals.latent_diffusion.image_prompt can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.image_prompt uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.image_prompt uses a type in vendored.refiners.fluxion.layers.module.
vendored.refiners.foundationals.latent_diffusion.image_prompt uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.latent_diffusion.image_prompt, while a change to vendored.refiners.foundationals.latent_diffusion.image_prompt can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.image_prompt uses a module listed above it, which is the healthy direction.
10 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.image_prompt uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.image_prompt uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.image_prompt, while a change to vendored.refiners.foundationals.latent_diffusion.image_prompt can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.image_prompt uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.image_prompt uses a type in vendored.refiners.fluxion.layers.attentions.
vendored.refiners.foundationals.latent_diffusion.image_prompt uses vendored.refiners.fluxion.layers.attentions, so a change to vendored.refiners.fluxion.layers.attentions can break vendored.refiners.foundationals.latent_diffusion.image_prompt, while a change to vendored.refiners.foundationals.latent_diffusion.image_prompt can't break vendored.refiners.fluxion.layers.attentions.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.image_prompt uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.image_prompt uses vendored.refiners.fluxion.layers.linear, so a change to vendored.refiners.fluxion.layers.linear can break vendored.refiners.foundationals.latent_diffusion.image_prompt, while a change to vendored.refiners.foundationals.latent_diffusion.image_prompt can't break vendored.refiners.fluxion.layers.linear.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.image_prompt uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.latent_diffusion.model uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.latent_diffusion.model, while a change to vendored.refiners.foundationals.latent_diffusion.model can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.model uses a type in vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler.
vendored.refiners.foundationals.latent_diffusion.model uses vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler, so a change to vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler can break vendored.refiners.foundationals.latent_diffusion.model, while a change to vendored.refiners.foundationals.latent_diffusion.model can't break vendored.refiners.foundationals.latent_diffusion.schedulers.scheduler.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.model uses a type in vendored.refiners.foundationals.latent_diffusion.auto_encoder.
vendored.refiners.foundationals.latent_diffusion.model uses vendored.refiners.foundationals.latent_diffusion.auto_encoder, so a change to vendored.refiners.foundationals.latent_diffusion.auto_encoder can break vendored.refiners.foundationals.latent_diffusion.model, while a change to vendored.refiners.foundationals.latent_diffusion.model can't break vendored.refiners.foundationals.latent_diffusion.auto_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.model uses a module listed above it, which is the healthy direction.
8 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet uses a type in vendored.refiners.foundationals.latent_diffusion.cross_attention.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet uses vendored.refiners.foundationals.latent_diffusion.cross_attention, so a change to vendored.refiners.foundationals.latent_diffusion.cross_attention can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet can't break vendored.refiners.foundationals.latent_diffusion.cross_attention.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a type in vendored.refiners.fluxion.adapters.adapter.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a type in vendored.refiners.foundationals.clip.tokenizer.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses vendored.refiners.foundationals.clip.tokenizer, so a change to vendored.refiners.foundationals.clip.tokenizer can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder can't break vendored.refiners.foundationals.clip.tokenizer.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a type in vendored.refiners.foundationals.clip.text_encoder.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses vendored.refiners.foundationals.clip.text_encoder, so a change to vendored.refiners.foundationals.clip.text_encoder can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder can't break vendored.refiners.foundationals.clip.text_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder uses a module listed above it, which is the healthy direction.
7 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet uses a type in vendored.refiners.foundationals.latent_diffusion.cross_attention.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet uses vendored.refiners.foundationals.latent_diffusion.cross_attention, so a change to vendored.refiners.foundationals.latent_diffusion.cross_attention can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet can't break vendored.refiners.foundationals.latent_diffusion.cross_attention.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet uses a module listed above it, which is the healthy direction.
vendored.refiners.foundationals.segment_anything.model uses vendored.refiners.fluxion.layers.module, so a change to vendored.refiners.fluxion.layers.module can break vendored.refiners.foundationals.segment_anything.model, while a change to vendored.refiners.foundationals.segment_anything.model can't break vendored.refiners.fluxion.layers.module.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.segment_anything.model uses a type in vendored.refiners.foundationals.segment_anything.image_encoder.
vendored.refiners.foundationals.segment_anything.model uses vendored.refiners.foundationals.segment_anything.image_encoder, so a change to vendored.refiners.foundationals.segment_anything.image_encoder can break vendored.refiners.foundationals.segment_anything.model, while a change to vendored.refiners.foundationals.segment_anything.model can't break vendored.refiners.foundationals.segment_anything.image_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.segment_anything.model uses a type in vendored.refiners.foundationals.segment_anything.mask_decoder.
vendored.refiners.foundationals.segment_anything.model uses vendored.refiners.foundationals.segment_anything.mask_decoder, so a change to vendored.refiners.foundationals.segment_anything.mask_decoder can break vendored.refiners.foundationals.segment_anything.model, while a change to vendored.refiners.foundationals.segment_anything.model can't break vendored.refiners.foundationals.segment_anything.mask_decoder.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.model uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.segment_anything.model uses a type in vendored.refiners.foundationals.segment_anything.prompt_encoder.
vendored.refiners.foundationals.segment_anything.model uses vendored.refiners.foundationals.segment_anything.prompt_encoder, so a change to vendored.refiners.foundationals.segment_anything.prompt_encoder can break vendored.refiners.foundationals.segment_anything.model, while a change to vendored.refiners.foundationals.segment_anything.model can't break vendored.refiners.foundationals.segment_anything.prompt_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.segment_anything.model uses a module listed above it, which is the healthy direction.
utils uses vendored.refiners.foundationals.latent_diffusion.model, so a change to vendored.refiners.foundationals.latent_diffusion.model can break utils, while a change to utils can't break vendored.refiners.foundationals.latent_diffusion.model.
Position
Below the diagonal: utils uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a type in vendored.refiners.fluxion.adapters.adapter.
vendored.refiners.foundationals.latent_diffusion.reference_only_control uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.reference_only_control, while a change to vendored.refiners.foundationals.latent_diffusion.reference_only_control can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.reference_only_control uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.reference_only_control, while a change to vendored.refiners.foundationals.latent_diffusion.reference_only_control can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a type in vendored.refiners.fluxion.layers.attentions.
vendored.refiners.foundationals.latent_diffusion.reference_only_control uses vendored.refiners.fluxion.layers.attentions, so a change to vendored.refiners.fluxion.layers.attentions can break vendored.refiners.foundationals.latent_diffusion.reference_only_control, while a change to vendored.refiners.foundationals.latent_diffusion.reference_only_control can't break vendored.refiners.fluxion.layers.attentions.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet.
vendored.refiners.foundationals.latent_diffusion.reference_only_control uses vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet, so a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet can break vendored.refiners.foundationals.latent_diffusion.reference_only_control, while a change to vendored.refiners.foundationals.latent_diffusion.reference_only_control can't break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.reference_only_control uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses a type in vendored.refiners.fluxion.adapters.adapter.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses vendored.refiners.fluxion.adapters.adapter, so a change to vendored.refiners.fluxion.adapters.adapter can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet can't break vendored.refiners.fluxion.adapters.adapter.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses a type in vendored.refiners.fluxion.layers.chain.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses vendored.refiners.fluxion.layers.chain, so a change to vendored.refiners.fluxion.layers.chain can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet can't break vendored.refiners.fluxion.layers.chain.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet, so a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet can't break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a type in vendored.refiners.foundationals.clip.text_encoder.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses vendored.refiners.foundationals.clip.text_encoder, so a change to vendored.refiners.foundationals.clip.text_encoder can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model can't break vendored.refiners.foundationals.clip.text_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a type in vendored.refiners.foundationals.latent_diffusion.auto_encoder.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses vendored.refiners.foundationals.latent_diffusion.auto_encoder, so a change to vendored.refiners.foundationals.latent_diffusion.auto_encoder can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model can't break vendored.refiners.foundationals.latent_diffusion.auto_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a type in vendored.refiners.foundationals.latent_diffusion.model.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses vendored.refiners.foundationals.latent_diffusion.model, so a change to vendored.refiners.foundationals.latent_diffusion.model can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model can't break vendored.refiners.foundationals.latent_diffusion.model.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet, so a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model can't break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.unet.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a type in vendored.refiners.foundationals.latent_diffusion.auto_encoder.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses vendored.refiners.foundationals.latent_diffusion.auto_encoder, so a change to vendored.refiners.foundationals.latent_diffusion.auto_encoder can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model can't break vendored.refiners.foundationals.latent_diffusion.auto_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a type in vendored.refiners.foundationals.latent_diffusion.model.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses vendored.refiners.foundationals.latent_diffusion.model, so a change to vendored.refiners.foundationals.latent_diffusion.model can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model can't break vendored.refiners.foundationals.latent_diffusion.model.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder, so a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model can't break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a type in vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet.
vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet, so a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet can break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model, while a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model can't break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet.
Position
Below the diagonal: vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model uses a module listed above it, which is the healthy direction.
modules.refiners_sd uses vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model, so a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model can break modules.refiners_sd, while a change to modules.refiners_sd can't break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_1.model.
Position
Below the diagonal: modules.refiners_sd uses a module listed above it, which is the healthy direction.
modules.refiners_sd uses vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model, so a change to vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model can break modules.refiners_sd, while a change to modules.refiners_sd can't break vendored.refiners.foundationals.latent_diffusion.stable_diffusion_xl.model.
Position
Below the diagonal: modules.refiners_sd uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 62.3 · Adequate · gated by D4, X4 ·
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 category
Findings
Severity
A05:2025 — Injection
43
High / Critical
A03:2025 — Software Supply Chain Failures
23
High / Critical
A02:2025 — Security Misconfiguration
4
High / Critical
Roadmap
Top priorities: Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may 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; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with setup.py.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may 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.
Code Duplication: Members sharing a duplicated core (5 members, 50+ identical tokens)
imaginairy/modules/autoencoder.py
7.0
Mixed
Code Duplication: Edited copies of one member (3 members, 27+ corresponding lines)
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 — 51
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 — 283
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 — 160
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
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 45 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 45 dimensions across the health lenses
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
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, 490 of 494 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Python half could not be measured — the pytest suite ran no test, so nothing was measured (its dependency install failed (pip exit 1: no error line printed), so its suite was not run against dependencies it does not declare). Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py) and this repository declares a Python test suite (repository root, 39 test files), but it was not re-run: its dependency install failed (pip exit 1: no error line printed), so its suite was not run against dependencies it does not declare. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 34 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
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. Single-maintainer repository — bus factor is not applicable (17 contributor(s) across 543 commit(s) sampled, automation and bot accounts excluded). One of them holds 92% of the history; the other 16 hold 0.5% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D26 Project Cohesion — 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. `(repository root)` (30946 LoC, 896 module-visible types across 59 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
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. Render strategy: boot via ToolchainServer (.). the service did not build — `python3 -m venv /tmp/wd-venv && . /tmp/wd-venv/bin/activate && pip install -q -e . && pip install -q uvicorn` exited -1: Tool stalled (no output) after 00:02:00.0287054.; runtime evidence skipped (launch chosen because imaginairy/http_app/app.py defines the FastAPI application 'app' at module level).
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP, Rust and Elixir source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP, Rust or Elixir was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — 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. 39 further occurrence(s) are not listed individually; the score already reflects all 79.
X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
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.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
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.
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 requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: 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.
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.
15 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was generate_compvis._generate_single_image at 55. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being api.load_model at 17 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: imaginairy/modules/midas/api.py (api.load_model at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 15 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with generate_compvis._generate_single_image (cyclomatic 55), generate_refiners.generate_single_image (cyclomatic 50), UNetModel.__init__ (cyclomatic 45). — 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 15 together lifts Cyclomatic Complexity from 7.4 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 27 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 34 bodies over 15 down to 15 or less in Cognitive Complexity — start with UNetModel.__init__ (cognitive 108), generate_compvis._generate_single_image (cognitive 89), generate_refiners.generate_single_image (cognitive 77). — 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 34 together lifts Cognitive Complexity from 5.9 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.3 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 11 FileTooLong finding(s) in God Classes — start with model.py (2), openaimodel.py (2), ddpm.py. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D4 · Code Duplication3.8 / 10Weak✓ 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.
120 duplicated block group(s) detected. 15.5 % of the production lines (4,829 of 31,150) are in a reported copy. A further 60 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 93 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with attention.py (2), ddpm.py (2), model.py. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 7 Duplicated block (19 lines × 2) finding(s) in Code Duplication — start with generate_compvis.py, attention.py, autoencoder.py. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 7 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with arg_schedule.py, attention.py, model.py. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
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.
0 of 92 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 34 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (58 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 12 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged.
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.
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.
16 deducted task-comment markers across 31150 LoC (0.0/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 15 TodoComment finding(s) in Explicit Debt — start with ddpm.py (8), attention.py (2), encoders.py. — One of this dimension's main actionable groups (15 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with imagine.py. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 23 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
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.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with setup.py. — 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.
Do you agree with this assessment?
D27 · Navigability7.7 / 10Strong✓ 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.
87 % of calls cross a namespace and 0 % go through an interface, but 46 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.
Scattered collaborators
What to do
Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d27_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
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).
43 finding(s): 0 critical, 35 high, 8 medium, 0 low. 23 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 issue-level).
No action in Static Analysis (SAST) — all 23 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (23 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 9 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9). — One of this dimension's main actionable groups (9 issue-level).
Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 1 Critical vulnerability 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.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
106 of 106 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is imaginairy/modules/diffusion/ddpm.py. Counted over 106 of the 174 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Most significant orphaned file · ×3imaginairy/modules/diffusion/ddpm.py:1
Dormant codebase
What to do
Resolve the 103 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (3), openaimodel.py (2), attention.py (2). — One of this dimension's main actionable groups (103 recommendation-level).
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with ddpm.py, modules.py, model.py. — One of this dimension's main actionable groups (3 recommendation-level).
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.
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.
Resolve the 2 Change coupling finding(s) in Change Coupling — start with ddim.py, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with generate.py. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 34 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.
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.
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.
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.
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.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
This repository serves requests — a request handler (@app.post() (imaginairy/http_app/app.py:44) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected. — imaginairy/http_app/app.py:44
What to do
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
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.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
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.
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.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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. — REDACTED:3
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.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
What to do
Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — REDACTED:20, imaginairy/utils/downloads.py:61
What to do
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
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.
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.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
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.
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. — imaginairy/cli/unslow_the_cli.py:79
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
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.
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 125 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. — REDACTED:125
`debug` at line 137 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. — REDACTED:137
`debug` at line 81 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. — REDACTED:81
`debug` at line 195 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. — REDACTED:195
`info` at line 345 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:345
`info` at line 61 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. — imaginairy/utils/animations.py:61
`info` at line 110 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. — imaginairy/utils/downloads.py:110
`debug` at line 214 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. — imaginairy/utils/downloads.py:214
`info` at line 64 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. — imaginairy/utils/model_manager.py:64
`error` at line 74 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — imaginairy/utils/model_manager.py:74
`warning` at line 138 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — imaginairy/utils/model_manager.py:138
`debug` at line 299 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. — imaginairy/utils/model_manager.py:299
`debug` at line 313 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. — imaginairy/utils/model_manager.py:313
`debug` at line 373 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. — imaginairy/utils/model_manager.py:373
`debug` at line 378 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. — imaginairy/utils/model_manager.py:378
`debug` at line 564 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. — imaginairy/utils/model_manager.py:564
`debug` at line 577 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. — imaginairy/utils/model_manager.py:577
`debug` at line 595 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. — imaginairy/utils/model_manager.py:595
`debug` at line 596 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. — imaginairy/utils/model_manager.py:596
`info` at line 661 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. — imaginairy/utils/model_manager.py:661
`info` at line 725 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. (×2) — imaginairy/utils/model_manager.py:725, imaginairy/modules/refiners_sd.py:725
`warning` 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.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — imaginairy/utils/model_manager.py:815
`debug` at line 34 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. — imaginairy/utils/safety.py:34
`debug` at line 51 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. — imaginairy/utils/safety.py:51
`info` at line 165 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. — imaginairy/utils/safety.py:165
`info` at line 171 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. — imaginairy/utils/safety.py:171
`debug` at line 43 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. — imaginairy/utils/tile_up.py:43
`debug` at line 157 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. — imaginairy/modules/autoencoder.py:157
`debug` at line 396 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. — imaginairy/modules/refiners_sd.py:396
`info` at line 740 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. — imaginairy/modules/refiners_sd.py:740
`debug` at line 829 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. — imaginairy/modules/refiners_sd.py:829
`debug` at line 856 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. — imaginairy/modules/refiners_sd.py:856
`warning` at line 45 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — imaginairy/modules/sgm/attention.py:45
`debug` at line 398 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. — imaginairy/modules/sgm/attention.py:398
`debug` at line 529 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. — imaginairy/modules/sgm/attention.py:529
`debug` at line 575 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. — imaginairy/modules/sgm/attention.py:575
`debug` at line 695 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. — imaginairy/modules/sgm/attention.py:695
`warning` at line 704 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — imaginairy/modules/sgm/attention.py:704
`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. — imaginairy/modules/sgm/diffusion.py:111
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.
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.
D36 Supply-chain Provenance & Signing — 1 observation(s) recorded · 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.
X10 Duplicated predicate — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 69 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the service did not build — `python3 -m venv /tmp/wd-venv && . /tmp/wd-venv/bin/activate && pip install -q -e . && pip install -q uvicorn` exited -1: Tool stalled (no output) after 00:02:00.0287054.; runtime evidence skipped (launch chosen because imaginairy/http_app/app.py defines the FastAPI application 'app' at module level) This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~2890 lines of test source are present (.py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .py suite was found but not re-run
D12 Dependency Hygiene — Not scored — 34 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
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.
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 10 candidate(s) found and not reported.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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.
D5 Coupling — Not applicable — this Python build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — Python suite
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (22 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, 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'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
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.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — 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
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
TodoComment imaginairy/modules/encoders.py:68— # TODO: typical value? — 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 imaginairy/modules/sgm/attention.py:492— # TODO: Use this directly in the attention operation, as a bias — 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 imaginairy/modules/sgm/attention.py:629— # (todo might depend on head_dim, check, falls back to semi-optimized kernels for dim!=[16,32,64,128]) — 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 imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:161— # TODO: shape not yet optional — 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 imaginairy/modules/diffusion/ddpm.py:967— # todo load once not every time, shorten code — 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 imaginairy/modules/diffusion/ddpm.py:1149— # TODO: drop this option — 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 imaginairy/modules/diffusion/ddpm.py:1167— # todo can only deal with one conditioning atm — 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 imaginairy/modules/diffusion/ddpm.py:1188— # todo check for completeness — 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 imaginairy/modules/diffusion/ddpm.py:1191— # todo extend to list with more than one elem — 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 imaginairy/modules/diffusion/ddpm.py:1270— # Todo make this more efficient — 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 imaginairy/modules/diffusion/ddpm.py:1278— # todo can't deal with multiple model outputs check this never happens — 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 imaginairy/modules/diffusion/ddpm.py:1473— # todo: get null label from cond_stage_model — 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 imaginairy/modules/diffusion/openaimodel.py:331— # TODO: check checkpoint usage, is True # TODO: fix the .half call!!! — 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 imaginairy/enhancers/clip_masking.py:67— # todo: add an outer blur (not gaussian) — 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 imaginairy/api/generate_refiners.py:430— # todo: do something smarter — 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.
FileTooLong: diffusion/ddpm.py imaginairy/modules/diffusion/ddpm.py— FileTooLong — 1605 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1105 over it, 3.21× 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: encoders/modules.py imaginairy/modules/sgm/encoders/modules.py— FileTooLong — 858 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 358 over it, 1.72× 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: diffusion/model.py imaginairy/modules/diffusion/model.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: modules/refiners_sd.py imaginairy/modules/refiners_sd.py— FileTooLong — 693 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 193 over it, 1.39× 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 — 660 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 160 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: img_processors/openpose.py imaginairy/img_processors/openpose.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: utils/model_manager.py imaginairy/utils/model_manager.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: diffusionmodules/openaimodel.py imaginairy/modules/sgm/diffusionmodules/openaimodel.py— FileTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 109 over it, 1.22× 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: sgm/attention.py imaginairy/modules/sgm/attention.py— FileTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 108 over it, 1.22× 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: diffusion/openaimodel.py imaginairy/modules/diffusion/openaimodel.py— FileTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 83 over it, 1.17× 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: diffusionmodules/model.py imaginairy/modules/sgm/diffusionmodules/model.py— FileTooLong — 550 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 50 over it, 1.10× 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.
Duplicated block (12 lines × 2) imaginairy/modules/attention.py:84— imaginairy/modules/attention.py:84-95 | imaginairy/modules/sgm/attention.py:142-153 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/attention.py:101— imaginairy/modules/attention.py:101-112 | imaginairy/utils/model_cache.py:101-112 — 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) imaginairy/modules/diffusion/ddpm.py:311— imaginairy/modules/diffusion/ddpm.py:311-322 | imaginairy/modules/sgm/diffusion.py:218-229 — 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) imaginairy/modules/diffusion/ddpm.py:1617— imaginairy/modules/diffusion/ddpm.py:1617-1628 | imaginairy/modules/diffusion/ddpm.py:1633-1644 — 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) imaginairy/modules/diffusion/model.py:29— imaginairy/modules/diffusion/model.py:29-42 | imaginairy/modules/sgm/diffusionmodules/model.py:29-40 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/diffusion/openaimodel.py:220— imaginairy/modules/diffusion/openaimodel.py:220-231 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:271-282 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/openaimodel.py:220` 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) imaginairy/modules/diffusion/util.py:173— imaginairy/modules/diffusion/util.py:173-184 | imaginairy/modules/sgm/diffusionmodules/util.py:186-197 — 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) imaginairy/samplers/ddim.py:57— imaginairy/samplers/ddim.py:57-68 | imaginairy/samplers/plms.py:65-76 — before extracting anything, compare `imaginairy/samplers/ddim.py` and `imaginairy/samplers/plms.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. Read the line range as the matched WINDOW rather than a finished unit: at `imaginairy/samplers/ddim.py:57` 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) imaginairy/samplers/editing.py:50— imaginairy/samplers/editing.py:50-61 | imaginairy/samplers/kdiff.py:256-267 — 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) imaginairy/utils/model_manager.py:746— imaginairy/utils/model_manager.py:746-757 | imaginairy/utils/model_manager.py:766-777 — 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 `imaginairy/utils/model_manager.py:746` 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) imaginairy/cli/arg_schedule.py:28— imaginairy/cli/arg_schedule.py:28-39 | imaginairy/utils/prompt_schedules.py:34-45 — 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 (19 lines × 2) imaginairy/api/generate_compvis.py:189— imaginairy/api/generate_compvis.py:189-207 | imaginairy/api/generate_refiners.py:163-181 — before extracting anything, compare `imaginairy/api/generate_compvis.py` and `imaginairy/api/generate_refiners.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) imaginairy/modules/attention.py:396— imaginairy/modules/attention.py:396-414 | imaginairy/modules/sgm/attention.py:717-735 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/attention.py:396` 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) imaginairy/modules/autoencoder.py:461— imaginairy/modules/autoencoder.py:461-479 | imaginairy/modules/diffusion/ddpm.py:945-963 — 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 (19 lines × 2) imaginairy/modules/encoders.py:133— imaginairy/modules/encoders.py:133-151 | imaginairy/modules/sgm/encoders/modules.py:393-411 — before extracting anything, compare `imaginairy/modules/encoders.py` and `imaginairy/modules/sgm/encoders/modules.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) REDACTED:170— REDACTED:170-188 | REDACTED:193-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:170` 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) imaginairy/modules/sgm/diffusionmodules/openaimodel.py:585— imaginairy/modules/sgm/diffusionmodules/openaimodel.py:585-603 | imaginairy/modules/sgm/diffusionmodules/video_model.py:160-178 — before extracting anything, compare `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/video_model.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. 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 (19 lines × 2) imaginairy/modules/sgm/diffusionmodules/denoiser_weighting.py:8— imaginairy/modules/sgm/diffusionmodules/denoiser_weighting.py:8-26 | imaginairy/modules/sgm/diffusionmodules/loss_weighting.py:11-34 — 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) imaginairy/cli/arg_schedule.py:54— imaginairy/cli/arg_schedule.py:54-60 | imaginairy/utils/prompt_schedules.py:24-30 — 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) imaginairy/modules/attention.py:301— imaginairy/modules/attention.py:301-307 | imaginairy/modules/sgm/attention.py:494-500 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/diffusion/model.py:84— imaginairy/modules/diffusion/model.py:84-90 | imaginairy/modules/sgm/diffusionmodules/model.py:87-93 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/distributions.py:47— imaginairy/modules/distributions.py:47-53 | imaginairy/modules/sgm/distributions/distributions.py:65-71 — before extracting anything, compare `imaginairy/modules/distributions.py` and `imaginairy/modules/sgm/distributions/distributions.py` as WHOLE FILES: 88% 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 (7 lines × 2) imaginairy/modules/encoders.py:211— imaginairy/modules/encoders.py:211-217 | imaginairy/modules/sgm/encoders/modules.py:571-577 — before extracting anything, compare `imaginairy/modules/encoders.py` and `imaginairy/modules/sgm/encoders/modules.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/diffusion/openaimodel.py:57— imaginairy/modules/diffusion/openaimodel.py:57-63 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:55-61 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/diffusion/ddpm.py:526— imaginairy/modules/diffusion/ddpm.py:526-532 | imaginairy/modules/diffusion/upscaling.py:68-74 — 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 (9 lines × 2) imaginairy/api/video_sample.py:454— imaginairy/api/video_sample.py:454-462 | imaginairy/utils/img_utils.py:43-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. 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) imaginairy/img_processors/openpose.py:571— imaginairy/img_processors/openpose.py:571-579 | imaginairy/img_processors/openpose.py:587-595 — 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 `imaginairy/img_processors/openpose.py:571` 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) imaginairy/modules/autoencoder.py:182— imaginairy/modules/autoencoder.py:182-191 | imaginairy/modules/autoencoder.py:280-288 — 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 `imaginairy/modules/autoencoder.py:182` 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) imaginairy/modules/diffusion/ddpm.py:1510— imaginairy/modules/diffusion/ddpm.py:1510-1518 | imaginairy/modules/diffusion/ddpm.py:1849-1857 — 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) imaginairy/modules/diffusion/model.py:188— imaginairy/modules/diffusion/model.py:188-196 | imaginairy/modules/diffusion/model.py:214-223 — 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) imaginairy/modules/diffusion/openaimodel.py:278— imaginairy/modules/diffusion/openaimodel.py:278-286 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:351-359 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/img_processors/openpose.py:197— imaginairy/img_processors/openpose.py:197-201 | imaginairy/img_processors/openpose.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.
Duplicated block (5 lines × 2) imaginairy/modules/diffusion/ddpm.py:678— imaginairy/modules/diffusion/ddpm.py:678-683 | imaginairy/modules/diffusion/ddpm.py:1875-1879 — 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) imaginairy/modules/attention.py:77— imaginairy/modules/attention.py:77-81 | imaginairy/modules/sgm/attention.py:135-139 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/autoencoder.py:575— imaginairy/modules/autoencoder.py:575-579 | imaginairy/modules/diffusion/ddpm.py:922-926 — 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 (5 lines × 2) imaginairy/modules/diffusion/model.py:342— imaginairy/modules/diffusion/model.py:342-346 | imaginairy/modules/sgm/diffusionmodules/model.py:272-276 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/sgm/diffusionmodules/guiders.py:41— imaginairy/modules/sgm/diffusionmodules/guiders.py:41-45 | imaginairy/modules/sgm/diffusionmodules/guiders.py:98-102 — 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) · ×5
Edited copy of a member (18 corresponding lines) imaginairy/modules/diffusion/model.py:29— imaginairy/modules/diffusion/model.py:29-48 | imaginairy/modules/sgm/diffusionmodules/model.py:29-46 — 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) imaginairy/api/video_sample.py:444— imaginairy/api/video_sample.py:444-462 | imaginairy/utils/img_utils.py:34-51 — 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) imaginairy/cli/arg_schedule.py:43— imaginairy/cli/arg_schedule.py:43-60 | imaginairy/utils/prompt_schedules.py:12-30 — 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) imaginairy/modules/diffusion/openaimodel.py:154— imaginairy/modules/diffusion/openaimodel.py:154-171 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:188-212 — 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) imaginairy/modules/sgm/diffusionmodules/sampling.py:115— imaginairy/modules/sgm/diffusionmodules/sampling.py:115-135 | imaginairy/modules/sgm/diffusionmodules/sampling.py:350-367 — 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.
Duplicated block (14 lines × 2) imaginairy/modules/clip_embedders.py:35— imaginairy/modules/clip_embedders.py:35-48 | imaginairy/modules/encoders.py:79-92 — 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 (14 lines × 2) imaginairy/modules/refiners_sd.py:165— imaginairy/modules/refiners_sd.py:165-178 | imaginairy/modules/refiners_sd.py:302-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 (14 lines × 2) imaginairy/modules/refiners_sd.py:472— imaginairy/modules/refiners_sd.py:472-485 | imaginairy/modules/refiners_sd.py:638-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 (14 lines × 2) imaginairy/modules/sgm/encoders/modules.py:292— imaginairy/modules/sgm/encoders/modules.py:292-305 | imaginairy/modules/sgm/encoders/modules.py:335-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. 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) imaginairy/modules/autoencoder.py:445— imaginairy/modules/autoencoder.py:445-458 | imaginairy/modules/diffusion/ddpm.py:929-942 — 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 `imaginairy/modules/autoencoder.py:445` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×4
Edited copy of a member (11 corresponding lines) imaginairy/utils/model_cache.py:200— imaginairy/utils/model_cache.py:200-210 | imaginairy/utils/model_cache.py:214-230 — 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) imaginairy/modules/diffusion/ddpm.py:722— imaginairy/modules/diffusion/ddpm.py:722-732 | imaginairy/modules/refiners_sd.py:83-93 — 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) imaginairy/modules/midas/midas/backbones/beit.py:200— imaginairy/modules/midas/midas/backbones/beit.py:200-213 | REDACTED:228-238 — 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) scripts/weights_debug.py:5— scripts/weights_debug.py:5-15 | imaginairy/weight_management/pattern_collapse.py:39-50 — 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.
Duplicated block (18 lines × 2) imaginairy/enhancers/video_interpolation/rife/msssim.py:106— imaginairy/enhancers/video_interpolation/rife/msssim.py:106-123 | imaginairy/enhancers/video_interpolation/rife/msssim.py:194-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. Read the line range as the matched WINDOW rather than a finished unit: at `imaginairy/enhancers/video_interpolation/rife/msssim.py:106` 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 (18 lines × 2) imaginairy/modules/midas/midas/midas_net.py:64— imaginairy/modules/midas/midas/midas_net.py:64-81 | imaginairy/modules/midas/midas/midas_net_custom.py:138-155 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `imaginairy/modules/midas/midas/midas_net_custom.py:136` calls `contiguous` and `imaginairy/modules/midas/midas/midas_net.py:61` 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 (18 lines × 2) imaginairy/modules/refiners_sd.py:489— imaginairy/modules/refiners_sd.py:489-506 | imaginairy/modules/refiners_sd.py:661-678 — 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 `imaginairy/modules/refiners_sd.py:489` 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 (18 lines × 2) imaginairy/modules/diffusion/openaimodel.py:405— imaginairy/modules/diffusion/openaimodel.py:405-422 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:453-470 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (10 lines × 2) imaginairy/modules/attention.py:267— imaginairy/modules/attention.py:267-276 | imaginairy/modules/sgm/attention.py:406-415 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/api/generate_flux.py:232— imaginairy/api/generate_flux.py:232-241 | imaginairy/api/generate_refiners.py:451-460 — 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, `imaginairy/api/generate_refiners.py:462` calls `eject` and `imaginairy/api/generate_flux.py:243` 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) imaginairy/modules/distributions.py:9— imaginairy/modules/distributions.py:9-18 | imaginairy/modules/sgm/distributions/distributions.py:28-37 — before extracting anything, compare `imaginairy/modules/distributions.py` and `imaginairy/modules/sgm/distributions/distributions.py` as WHOLE FILES: 88% 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) imaginairy/modules/midas/midas/backbones/beit.py:217— imaginairy/modules/midas/midas/backbones/beit.py:217-226 | REDACTED:114-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. 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 (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) imaginairy/modules/diffusion/openaimodel.py:270— imaginairy/modules/diffusion/openaimodel.py:270-289 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:339-364 — 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) imaginairy/modules/diffusion/model.py:131— imaginairy/modules/diffusion/model.py:131-162 | imaginairy/modules/sgm/diffusionmodules/model.py:134-153 — 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) imaginairy/modules/encoders.py:133— imaginairy/modules/encoders.py:133-152 | imaginairy/modules/sgm/encoders/modules.py:393-414 — 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 (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) imaginairy/modules/sgm/diffusionmodules/guiders.py:37— imaginairy/modules/sgm/diffusionmodules/guiders.py:37-45 | imaginairy/modules/sgm/diffusionmodules/guiders.py:94-102 — 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) imaginairy/modules/sgm/diffusionmodules/openaimodel.py:137— imaginairy/modules/sgm/diffusionmodules/openaimodel.py:137-147 | imaginairy/modules/diffusion/openaimodel.py:105-113 — 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) imaginairy/cli/arg_schedule.py:64— imaginairy/cli/arg_schedule.py:64-74 | imaginairy/utils/prompt_schedules.py:68-76 — 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 (7 corresponding lines) · ×3
Edited copy of a member (7 corresponding lines) imaginairy/modules/distributions.py:46— imaginairy/modules/distributions.py:46-53 | imaginairy/modules/sgm/distributions/distributions.py:65-71 — 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) imaginairy/modules/diffusion/util.py:158— imaginairy/modules/diffusion/util.py:158-164 | imaginairy/modules/sgm/diffusionmodules/util.py:167-177 — 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) imaginairy/modules/encoders.py:64— imaginairy/modules/encoders.py:64-70 | imaginairy/modules/sgm/encoders/modules.py:276-283 — 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.
Duplicated block (25 lines × 2) imaginairy/modules/sgm/attention.py:246— imaginairy/modules/sgm/attention.py:246-270 | imaginairy/modules/sgm/attention.py:322-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) imaginairy/modules/sgm/autoencoding/temporal_ae.py:121— imaginairy/modules/sgm/autoencoding/temporal_ae.py:121-145 | imaginairy/modules/sgm/autoencoding/temporal_ae.py:193-217 — 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 (25 lines × 2) imaginairy/modules/sgm/autoencoding/temporal_ae.py:151— imaginairy/modules/sgm/autoencoding/temporal_ae.py:151-175 | imaginairy/modules/sgm/autoencoding/temporal_ae.py:223-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `imaginairy/modules/sgm/autoencoding/temporal_ae.py:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) imaginairy/modules/diffusion/openaimodel.py:813— imaginairy/modules/diffusion/openaimodel.py:813-829 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:830-846 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/encoders.py:182— imaginairy/modules/encoders.py:182-198 | imaginairy/modules/sgm/encoders/modules.py:542-558 — before extracting anything, compare `imaginairy/modules/encoders.py` and `imaginairy/modules/sgm/encoders/modules.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/refiners_sd.py:227— imaginairy/modules/refiners_sd.py:227-243 | imaginairy/modules/refiners_sd.py:514-530 — 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) imaginairy/modules/autoencoder.py:215— imaginairy/modules/autoencoder.py:215-230 | imaginairy/modules/refiners_sd.py:751-766 — 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 (16 lines × 2) imaginairy/samplers/ddim.py:71— imaginairy/samplers/ddim.py:71-86 | imaginairy/samplers/plms.py:81-96 — before extracting anything, compare `imaginairy/samplers/ddim.py` and `imaginairy/samplers/plms.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.
Duplicated block (16 lines × 2) imaginairy/modules/diffusion/openaimodel.py:373— imaginairy/modules/diffusion/openaimodel.py:373-388 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:425-440 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `imaginairy/modules/diffusion/openaimodel.py:391` calls `count_flops`, `count_flops_attn` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py:443` 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) imaginairy/modules/diffusion/ddpm.py:1544— imaginairy/modules/diffusion/ddpm.py:1544-1558 | imaginairy/modules/diffusion/ddpm.py:1880-1894 — 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 `imaginairy/modules/diffusion/ddpm.py:1544` 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 lines × 2) imaginairy/modules/refiners_sd.py:146— imaginairy/modules/refiners_sd.py:146-160 | imaginairy/modules/refiners_sd.py:283-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. Read the line range as the matched WINDOW rather than a finished unit: at `imaginairy/modules/refiners_sd.py:146` 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 (15 lines × 2) imaginairy/modules/sgm/attention.py:222— imaginairy/modules/sgm/attention.py:222-236 | imaginairy/modules/sgm/attention.py:297-311 — 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) imaginairy/modules/clip_embedders.py:120— imaginairy/modules/clip_embedders.py:120-130 | imaginairy/modules/sgm/encoders/modules.py:649-659 — 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 (11 lines × 2) imaginairy/modules/encoders.py:220— imaginairy/modules/encoders.py:220-230 | imaginairy/modules/sgm/encoders/modules.py:580-590 — before extracting anything, compare `imaginairy/modules/encoders.py` and `imaginairy/modules/sgm/encoders/modules.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 lines × 2) imaginairy/modules/refiners_sd.py:246— imaginairy/modules/refiners_sd.py:246-256 | imaginairy/modules/refiners_sd.py:533-543 — 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.
Model.__init__ (cognitive 21) imaginairy/modules/diffusion/model.py:376— Model.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model.__init__ (cognitive 21) imaginairy/modules/sgm/diffusionmodules/model.py:321— Model.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model.forward (cognitive 19) imaginairy/modules/diffusion/model.py:497— Model.forward has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 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.
Model.forward (cognitive 19) imaginairy/modules/sgm/diffusionmodules/model.py:442— Model.forward has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 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.
Change coupling: ddim.py ↔ plms.py imaginairy/samplers/ddim.py:1— `imaginairy/samplers/ddim.py` and `imaginairy/samplers/plms.py` change together 82% of the time (18 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `dbc6a249` fix: k-diff samplers made more stable by skipping second to last step; `70c58467` fix: img2img was broken for all samplers except ddim,plms; `7af1ab66` fix: add workaround for bug in k_diffusion on mps — run `git show` on any of them.
Change coupling: REDACTED ↔ setup.py imaginairy/__init__.py:1— `imaginairy/__init__.py` and `setup.py` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `477d161c` build: better communicate lack of support for Python 3.11; `0fb03f2a` fix/version: 2.0.1; `7087c4a6` feature: automatic mask generation — run `git show` on any of them.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) imaginairy/modules/diffusion/model.py:167— imaginairy/modules/diffusion/model.py:167-182 | imaginairy/modules/diffusion/model.py:288-304 | imaginairy/modules/sgm/diffusionmodules/model.py:165-180 | imaginairy/modules/sgm/diffusionmodules/model.py:215-231 — 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) imaginairy/modules/diffusion/model.py:499— imaginairy/modules/diffusion/model.py:499-544 | imaginairy/modules/diffusion/model.py:641-664 | imaginairy/modules/sgm/diffusionmodules/model.py:444-489 | imaginairy/modules/sgm/diffusionmodules/model.py:586-609 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) imaginairy/modules/attention.py:280— imaginairy/modules/attention.py:280-308 | imaginairy/modules/diffusion/model.py:307-337 — 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) imaginairy/modules/refiners_sd.py:191— imaginairy/modules/refiners_sd.py:191-219 | imaginairy/modules/refiners_sd.py:330-361 — 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 (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) imaginairy/modules/sgm/autoencoding/temporal_ae.py:121— imaginairy/modules/sgm/autoencoding/temporal_ae.py:121-148 | imaginairy/modules/sgm/autoencoding/temporal_ae.py:193-220 — 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) imaginairy/modules/midas/midas/midas_net.py:54— imaginairy/modules/midas/midas/midas_net.py:54-81 | imaginairy/modules/midas/midas/midas_net_custom.py:125-155 — 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 (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) imaginairy/modules/distributions.py:27— imaginairy/modules/distributions.py:27-43 | imaginairy/modules/sgm/distributions/distributions.py:46-62 — 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) imaginairy/modules/diffusion/util.py:168— imaginairy/modules/diffusion/util.py:168-184 | imaginairy/modules/sgm/diffusionmodules/util.py:181-197 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×2
Edited copy of a member (13 corresponding lines) imaginairy/samplers/ddim.py:224— imaginairy/samplers/ddim.py:224-236 | imaginairy/samplers/plms.py:233-245 — 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) imaginairy/modules/encoders.py:112— imaginairy/modules/encoders.py:112-124 | imaginairy/modules/sgm/encoders/modules.py:369-383 — 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 (12 corresponding lines) · ×2
Edited copy of a member (12 corresponding lines) imaginairy/modules/attention.py:43— imaginairy/modules/attention.py:43-54 | imaginairy/modules/sgm/attention.py:101-112 — 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) imaginairy/modules/autoencoder.py:90— imaginairy/modules/autoencoder.py:90-101 | imaginairy/modules/sgm/autoencoder.py:83-94 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×2
Edited copy of a member (14 corresponding lines) imaginairy/modules/attention.py:99— imaginairy/modules/attention.py:99-112 | imaginairy/utils/model_cache.py:95-112 — 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) imaginairy/modules/diffusion/util.py:139— imaginairy/modules/diffusion/util.py:139-152 | imaginairy/modules/sgm/diffusionmodules/util.py:148-161 — 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 (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) imaginairy/modules/midas/midas/backbones/beit.py:230— imaginairy/modules/midas/midas/backbones/beit.py:230-238 | REDACTED:127-132 — 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) imaginairy/modules/encoders.py:40— imaginairy/modules/encoders.py:40-45 | imaginairy/modules/sgm/encoders/modules.py:249-255 — 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 (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) imaginairy/modules/diffusion/model.py:67— imaginairy/modules/diffusion/model.py:67-70 | imaginairy/modules/sgm/diffusionmodules/model.py:70-73 — 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) imaginairy/modules/distributions.py:21— imaginairy/modules/distributions.py:21-24 | imaginairy/modules/sgm/distributions/distributions.py:40-43 — 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· Edited copy of a member (5 corresponding lines) · ×2
Edited copy of a member (5 corresponding lines) imaginairy/modules/encoders.py:245— imaginairy/modules/encoders.py:245-249 | imaginairy/modules/sgm/encoders/modules.py:764-769 — 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) imaginairy/modules/autoencoder.py:361— imaginairy/modules/autoencoder.py:361-366 | imaginairy/modules/sgm/autoencoder.py:312-316 — 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.
Duplicated block (21 lines × 2) imaginairy/modules/sgm/diffusionmodules/openaimodel.py:607— imaginairy/modules/sgm/diffusionmodules/openaimodel.py:607-627 | imaginairy/modules/sgm/diffusionmodules/video_model.py:182-202 — before extracting anything, compare `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/video_model.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. 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 (21 lines × 2) imaginairy/modules/sgm/diffusionmodules/openaimodel.py:662— imaginairy/modules/sgm/diffusionmodules/openaimodel.py:662-682 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:775-795 — 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) imaginairy/modules/diffusion/openaimodel.py:307— imaginairy/modules/diffusion/openaimodel.py:307-326 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:382-401 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/refiners_sd.py:194— imaginairy/modules/refiners_sd.py:194-213 | imaginairy/modules/refiners_sd.py:333-352 — 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–12 lines × 2) imaginairy/api/generate_compvis.py:167— imaginairy/api/generate_compvis.py:167-177 | imaginairy/api/generate_refiners.py:141-152 — before extracting anything, compare `imaginairy/api/generate_compvis.py` and `imaginairy/api/generate_refiners.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) imaginairy/modules/attention.py:416— imaginairy/modules/attention.py:416-426 | imaginairy/modules/sgm/attention.py:739-750 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/attention.py:416` 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) imaginairy/modules/diffusion/openaimodel.py:555— imaginairy/modules/diffusion/openaimodel.py:555-565 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:595-605 | imaginairy/modules/sgm/diffusionmodules/video_model.py:170-180 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/samplers/base.py:175— imaginairy/samplers/base.py:175-185 | imaginairy/samplers/ddim.py:226-236 | imaginairy/samplers/plms.py:235-245 — before extracting anything, compare `imaginairy/samplers/ddim.py` and `imaginairy/samplers/plms.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 (10 lines × 4) imaginairy/modules/diffusion/model.py:483— imaginairy/modules/diffusion/model.py:483-492 | imaginairy/modules/diffusion/model.py:748-757 | imaginairy/modules/sgm/diffusionmodules/model.py:428-437 | imaginairy/modules/sgm/diffusionmodules/model.py:697-706 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 4) REDACTED:168— REDACTED:168-177 | REDACTED:191-200 | REDACTED:214-223 | REDACTED:227-236 — 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 `REDACTED:168` 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) imaginairy/modules/diffusion/openaimodel.py:46— imaginairy/modules/diffusion/openaimodel.py:46-53 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:44-51 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/diffusion/openaimodel.py:270— imaginairy/modules/diffusion/openaimodel.py:270-277 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:339-346 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `imaginairy/modules/sgm/diffusionmodules/openaimodel.py:349` calls `zeros_like` and `imaginairy/modules/diffusion/openaimodel.py:278` 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) imaginairy/img_processors/openpose.py:792— imaginairy/img_processors/openpose.py:792-797 | imaginairy/img_processors/openpose.py:809-814 — 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) imaginairy/modules/diffusion/openaimodel.py:335— imaginairy/modules/diffusion/openaimodel.py:335-340 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:407-412 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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.
Outbound HTTP without resilience REDACTED:20— `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience imaginairy/utils/downloads.py:61— `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
No authorization imaginairy/http_app/app.py:44— This repository serves requests — a request handler (@app.post() (imaginairy/http_app/app.py:44) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected.
generate_compvis._generate_single_image (cyclomatic 55) imaginairy/api/generate_compvis.py:15— generate_compvis._generate_single_image has cyclomatic complexity 55 (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.
generate_refiners.generate_single_image (cyclomatic 50) imaginairy/api/generate_refiners.py:15— generate_refiners.generate_single_image has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UNetModel.__init__ (cyclomatic 45) imaginairy/modules/diffusion/openaimodel.py:459— UNetModel.__init__ has cyclomatic complexity 45 (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.
UNetModel.__init__ (cyclomatic 36) imaginairy/modules/sgm/diffusionmodules/openaimodel.py:512— UNetModel.__init__ 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.
interpolate.interpolate_video_file (cyclomatic 34) imaginairy/enhancers/video_interpolation/rife/interpolate.py:112— interpolate.interpolate_video_file has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openpose.create_body_pose (cyclomatic 29) imaginairy/img_processors/openpose.py:526— openpose.create_body_pose has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ControlNet.__init__ (cyclomatic 28) imaginairy/modules/cldm.py:68— ControlNet.__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.
video_sample.generate_video (cyclomatic 27) imaginairy/api/video_sample.py:38— video_sample.generate_video 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.
shared._imagine_cmd (cyclomatic 27) imaginairy/cli/shared.py:32— shared._imagine_cmd 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.
DDPM.init_from_state_dict (cyclomatic 24) imaginairy/modules/diffusion/ddpm.py:325— DDPM.init_from_state_dict has cyclomatic complexity 24 (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.
VideoUNet.__init__ (cyclomatic 24) imaginairy/modules/sgm/diffusionmodules/video_model.py:104— VideoUNet.__init__ has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
translation.translate_weights (cyclomatic 24) REDACTED:98— translation.translate_weights has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LatentDiffusion.log_images (cyclomatic 21) imaginairy/modules/diffusion/ddpm.py:1479— LatentDiffusion.log_images 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.
generate.imagine (cyclomatic 17) imaginairy/api/generate.py:202— generate.imagine 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.
LatentFinetuneDiffusion.log_images (cyclomatic 17) imaginairy/modules/diffusion/ddpm.py:1822— LatentFinetuneDiffusion.log_images 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.
HackComment imaginairy/cli/imagine.py:138— # hacky method of getting order of control images (mixing raw and normal images) — 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.
UNetModel.__init__ (cognitive 108) imaginairy/modules/diffusion/openaimodel.py:459— UNetModel.__init__ has cognitive complexity 108 (threshold 15). Drivers by points: if/else 34 (68 pts), ternaries 9 (31 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate_compvis._generate_single_image (cognitive 89) imaginairy/api/generate_compvis.py:15— generate_compvis._generate_single_image has cognitive complexity 89 (threshold 15). Drivers by points: if/else 42 (72 pts), boolean chains 11, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate_refiners.generate_single_image (cognitive 77) imaginairy/api/generate_refiners.py:15— generate_refiners.generate_single_image has cognitive complexity 77 (threshold 15). Drivers by points: if/else 35 (53 pts), ternaries 5 (10 pts), loops 6 (9 pts), boolean chains 5 (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.
UNetModel.__init__ (cognitive 73) imaginairy/modules/sgm/diffusionmodules/openaimodel.py:512— UNetModel.__init__ has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (55 pts), ternaries 3 (8 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openpose.create_body_pose (cognitive 69) imaginairy/img_processors/openpose.py:526— openpose.create_body_pose has cognitive complexity 69 (threshold 15). Drivers by points: if/else 12 (41 pts), loops 10 (22 pts), boolean chains 6 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
interpolate.interpolate_video_file (cognitive 65) imaginairy/enhancers/video_interpolation/rife/interpolate.py:112— interpolate.interpolate_video_file has cognitive complexity 65 (threshold 15). Drivers by points: if/else 31 (46 pts), loops 6 (13 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DDPM.init_from_state_dict (cognitive 65) imaginairy/modules/diffusion/ddpm.py:325— DDPM.init_from_state_dict has cognitive complexity 65 (threshold 15). Drivers by points: loops 10 (38 pts), if/else 10 (25 pts), boolean chains 1, ternaries 1 (nesting depth added 43). 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.
video_sample.generate_video (cognitive 63) imaginairy/api/video_sample.py:38— video_sample.generate_video has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (52 pts), loops 4 (9 pts), boolean chains 2 (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.
ControlNet.__init__ (cognitive 60) imaginairy/modules/cldm.py:68— ControlNet.__init__ has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (39 pts), ternaries 6 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
translation.translate_weights (cognitive 46) REDACTED:98— translation.translate_weights has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 8 (13 pts), error handling 4 (8 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.
VideoUNet.__init__ (cognitive 45) imaginairy/modules/sgm/diffusionmodules/video_model.py:104— VideoUNet.__init__ has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (31 pts), ternaries 2 (7 pts), loops 4 (6 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.
shared._imagine_cmd (cognitive 43) imaginairy/cli/shared.py:32— shared._imagine_cmd has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 5 (12 pts), ternaries 2, 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.
imagine.imagine_cmd (cognitive 29) imaginairy/cli/imagine.py:80— imagine.imagine_cmd has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 1 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LatentDiffusion.get_input (cognitive 28) imaginairy/modules/diffusion/ddpm.py:1061— LatentDiffusion.get_input has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (27 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.
generate.imagine (cognitive 27) imaginairy/api/generate.py:202— generate.imagine has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneralConditioner.forward (cognitive 26) imaginairy/modules/sgm/encoders/modules.py:140— GeneralConditioner.forward has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 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.
LatentDiffusion.log_images (cognitive 25) imaginairy/modules/diffusion/ddpm.py:1479— LatentDiffusion.log_images has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneralLPIPSWithDiscriminator.forward (cognitive 25) imaginairy/modules/sgm/autoencoding/losses/discriminator_loss.py:212— GeneralLPIPSWithDiscriminator.forward has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2, loops 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.
surprise_me.surprise_me_prompts (cognitive 23) imaginairy/utils/surprise_me.py:143— surprise_me.surprise_me_prompts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
upscale.upscale_cmd (cognitive 21) imaginairy/cli/upscale.py:53— upscale.upscale_cmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 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.
generate_flux.generate_single_image (cognitive 20) imaginairy/api/generate_flux.py:90— generate_flux.generate_single_image has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (6 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.
prompt_expansion.expand_prompts (cognitive 20) imaginairy/enhancers/prompt_expansion.py:72— prompt_expansion.expand_prompts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (7 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.
openpose.handDetect (cognitive 19) imaginairy/img_processors/openpose.py:183— openpose.handDetect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 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.
LatentFinetuneDiffusion.log_images (cognitive 19) imaginairy/modules/diffusion/ddpm.py:1822— LatentFinetuneDiffusion.log_images has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (2 pts), ternaries 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.
feather_tile.add_tiles (cognitive 19) imaginairy/utils/feather_tile.py:110— feather_tile.add_tiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pattern_collapse._collapse_patterns (cognitive 19) imaginairy/weight_management/pattern_collapse.py:53— pattern_collapse._collapse_patterns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LatentFinetuneDiffusion.init_from_state_dict (cognitive 18) imaginairy/modules/diffusion/ddpm.py:1783— LatentFinetuneDiffusion.init_from_state_dict has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 1, ternaries 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.
Resize.get_size (cognitive 18) imaginairy/modules/midas/midas/transforms.py:109— Resize.get_size has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 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.
SlicedEncoderMixin.decode (cognitive 18) imaginairy/modules/refiners_sd.py:713— SlicedEncoderMixin.decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (6 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoTransformerBlock.__init__ (cognitive 16) imaginairy/modules/sgm/video_attention.py:42— VideoTransformerBlock.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (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.
Change-coupling hub: generate.py → shared.py, clip_masking.py, ddpm.py, REDACTED, base.py, ddim.py, kdiff.py, plms.py, log_utils.py, safety.py imaginairy/api/generate.py— `imaginairy/api/generate.py` changes together with 10 other files — `imaginairy/cli/shared.py`, `imaginairy/enhancers/clip_masking.py`, `imaginairy/modules/diffusion/ddpm.py`, `imaginairy/modules/diffusion/util.py`, `imaginairy/samplers/base.py`, `imaginairy/samplers/ddim.py`, `imaginairy/samplers/kdiff.py`, `imaginairy/samplers/plms.py`, `imaginairy/utils/log_utils.py`, `imaginairy/utils/safety.py` — none of which declares a dependency on it: one file is the hub of 10 separate couplings, not 10 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 10.
D4 · Code Duplication· Near-duplicate member family (5 members, 28 shared lines) · ×1
Near-duplicate member family (5 members, 28 shared lines) imaginairy/modules/diffusion/model.py:392— imaginairy/modules/diffusion/model.py:392-495 | imaginairy/modules/diffusion/model.py:569-637 | imaginairy/modules/diffusion/model.py:687-762 | imaginairy/modules/sgm/diffusionmodules/model.py:337-440 | imaginairy/modules/sgm/diffusionmodules/model.py:514-582 — 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 (4 members, 22 shared lines) · ×1
Near-duplicate member family (4 members, 22 shared lines) imaginairy/modules/diffusion/model.py:392— imaginairy/modules/diffusion/model.py:392-495 | imaginairy/modules/diffusion/model.py:687-762 | imaginairy/modules/sgm/diffusionmodules/model.py:337-440 | imaginairy/modules/sgm/diffusionmodules/model.py:632-709 — 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 (3 members, 41 shared lines) · ×1
Near-duplicate member family (3 members, 41 shared lines) imaginairy/modules/cldm.py:98— imaginairy/modules/cldm.py:98-328 | imaginairy/modules/diffusion/openaimodel.py:490-794 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:540-820 — These 3 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 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) imaginairy/modules/attention.py:122— imaginairy/modules/attention.py:122-135 | imaginairy/modules/attention.py:259-277 | imaginairy/modules/sgm/attention.py:222-236 | imaginairy/modules/sgm/attention.py:297-311 | imaginairy/modules/sgm/attention.py:397-416 — 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 (74 corresponding lines) · ×1
Edited copy of a member (74 corresponding lines) imaginairy/enhancers/video_interpolation/rife/msssim.py:50— imaginairy/enhancers/video_interpolation/rife/msssim.py:50-123 | imaginairy/enhancers/video_interpolation/rife/msssim.py:136-211 — 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 (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) imaginairy/samplers/ddim.py:53— imaginairy/samplers/ddim.py:53-115 | imaginairy/samplers/plms.py:61-136 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) imaginairy/modules/diffusion/openaimodel.py:207— imaginairy/modules/diffusion/openaimodel.py:207-256 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:252-324 — 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 (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) imaginairy/modules/sgm/attention.py:246— imaginairy/modules/sgm/attention.py:246-284 | imaginairy/modules/sgm/attention.py:322-370 — 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 (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) imaginairy/modules/refiners_sd.py:472— imaginairy/modules/refiners_sd.py:472-506 | imaginairy/modules/refiners_sd.py:638-678 — 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 (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) imaginairy/modules/diffusion/model.py:766— imaginairy/modules/diffusion/model.py:766-818 | imaginairy/modules/sgm/diffusionmodules/model.py:725-756 — 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 copies of one member (3 members, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:87— imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:87-119 | imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:198-234 | imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:369-396 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 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 (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) imaginairy/modules/diffusion/openaimodel.py:813— imaginairy/modules/diffusion/openaimodel.py:813-847 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:830-859 — 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· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) imaginairy/modules/refiners_sd.py:124— imaginairy/modules/refiners_sd.py:124-160 | imaginairy/modules/refiners_sd.py:261-297 — 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 (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) imaginairy/modules/diffusion/util.py:188— imaginairy/modules/diffusion/util.py:188-212 | imaginairy/modules/sgm/diffusionmodules/util.py:201-224 — 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, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) imaginairy/modules/autoencoder.py:117— imaginairy/modules/autoencoder.py:117-143 | imaginairy/modules/autoencoder.py:215-241 | imaginairy/modules/refiners_sd.py:751-777 — 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 copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) imaginairy/modules/sgm/autoencoder.py:484— imaginairy/modules/sgm/autoencoder.py:484-501 | imaginairy/modules/sgm/autoencoder.py:504-518 — 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) · ×1
Edited copy of a member (8 corresponding lines) imaginairy/modules/diffusion/openaimodel.py:56— imaginairy/modules/diffusion/openaimodel.py:56-63 | imaginairy/modules/sgm/diffusionmodules/openaimodel.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.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) imaginairy/modules/encoders.py:178— imaginairy/modules/encoders.py:178-198 | imaginairy/modules/sgm/encoders/modules.py:438-461 | imaginairy/modules/sgm/encoders/modules.py:539-558 — 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 copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) imaginairy/modules/diffusion/openaimodel.py:116— imaginairy/modules/diffusion/openaimodel.py:116-125 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:150-167 — 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· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) imaginairy/weight_management/execution_trace.py:215— imaginairy/weight_management/execution_trace.py:215-241 | imaginairy/weight_management/execution_trace.py:245-271 — 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 copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) imaginairy/modules/diffusion/util.py:255— imaginairy/modules/diffusion/util.py:255-265 | imaginairy/modules/diffusion/util.py:276-284 | imaginairy/modules/sgm/diffusionmodules/util.py:273-283 | imaginairy/modules/sgm/diffusionmodules/util.py:294-304 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) imaginairy/modules/diffusion/util.py:133— imaginairy/modules/diffusion/util.py:133-135 | imaginairy/modules/sgm/diffusionmodules/util.py:37-39 — 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.
Duplicated block (91 lines × 2) imaginairy/modules/autoencoder.py:482— imaginairy/modules/autoencoder.py:482-572 | imaginairy/modules/diffusion/ddpm.py:968-1058 — 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 `imaginairy/modules/autoencoder.py:482` 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 (51 lines × 3) imaginairy/modules/cldm.py:202— imaginairy/modules/cldm.py:202-252 | imaginairy/modules/diffusion/openaimodel.py:584-634 | imaginairy/modules/diffusion/openaimodel.py:713-763 — before extracting anything, compare `imaginairy/modules/cldm.py` and `imaginairy/modules/diffusion/openaimodel.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `imaginairy/modules/cldm.py:254` calls `make_zero_conv` and `imaginairy/modules/diffusion/openaimodel.py:636` 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 (47 lines × 2) imaginairy/modules/cldm.py:280— imaginairy/modules/cldm.py:280-326 | imaginairy/modules/diffusion/openaimodel.py:660-706 — before extracting anything, compare `imaginairy/modules/cldm.py` and `imaginairy/modules/diffusion/openaimodel.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `imaginairy/modules/cldm.py:279` calls `make_zero_conv` and `imaginairy/modules/diffusion/openaimodel.py:659` 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 (39 lines × 3) imaginairy/modules/diffusion/ddpm.py:218— imaginairy/modules/diffusion/ddpm.py:218-256 | imaginairy/modules/diffusion/upscaling.py:27-65 | imaginairy/modules/sgm/encoders/modules.py:872-910 — 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 (36 lines × 4) imaginairy/modules/diffusion/model.py:420— imaginairy/modules/diffusion/model.py:420-455 | imaginairy/modules/diffusion/model.py:587-622 | imaginairy/modules/sgm/diffusionmodules/model.py:365-400 | imaginairy/modules/sgm/diffusionmodules/model.py:532-567 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/model.py:420` 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 (36 lines × 2) imaginairy/modules/diffusion/openaimodel.py:632— imaginairy/modules/diffusion/openaimodel.py:632-667 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:680-715 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/openaimodel.py:632` 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 (33–34 lines × 2) imaginairy/modules/diffusion/openaimodel.py:697— imaginairy/modules/diffusion/openaimodel.py:697-730 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:740-772 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/openaimodel.py:697` 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 (33 lines × 2) imaginairy/modules/sgm/diffusionmodules/video_model.py:277— imaginairy/modules/sgm/diffusionmodules/video_model.py:277-309 | imaginairy/modules/sgm/diffusionmodules/video_model.py:392-424 — 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 (31 lines × 2) imaginairy/utils/model_manager.py:268— imaginairy/utils/model_manager.py:268-298 | imaginairy/utils/model_manager.py:324-354 — 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 (29 lines × 2) imaginairy/modules/diffusion/model.py:457— imaginairy/modules/diffusion/model.py:457-485 | imaginairy/modules/sgm/diffusionmodules/model.py:402-430 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/model.py:457` 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 (27–28 lines × 2) imaginairy/modules/cldm.py:128— imaginairy/modules/cldm.py:128-154 | imaginairy/modules/diffusion/openaimodel.py:519-546 — before extracting anything, compare `imaginairy/modules/cldm.py` and `imaginairy/modules/diffusion/openaimodel.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/diffusion/openaimodel.py:761— imaginairy/modules/diffusion/openaimodel.py:761-788 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:793-820 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/openaimodel.py:761` 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–27 lines × 2) imaginairy/api/generate_compvis.py:507— imaginairy/api/generate_compvis.py:507-532 | imaginairy/api/generate_refiners.py:569-595 — before extracting anything, compare `imaginairy/api/generate_compvis.py` and `imaginairy/api/generate_refiners.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (27 lines × 2) imaginairy/modules/diffusion/model.py:308— imaginairy/modules/diffusion/model.py:308-334 | imaginairy/modules/sgm/diffusionmodules/model.py:234-260 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–26 lines × 3) imaginairy/modules/cldm.py:194— imaginairy/modules/cldm.py:194-219 | imaginairy/modules/diffusion/openaimodel.py:577-601 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:635-659 — before extracting anything, compare `imaginairy/modules/cldm.py` and `imaginairy/modules/diffusion/openaimodel.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/cldm.py:194` 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) imaginairy/modules/diffusion/model.py:103— imaginairy/modules/diffusion/model.py:103-128 | imaginairy/modules/sgm/diffusionmodules/model.py:106-131 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–24 lines × 2) imaginairy/modules/autoencoder.py:310— imaginairy/modules/autoencoder.py:310-332 | imaginairy/modules/autoencoder.py:334-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.
Duplicated block (18–22 lines × 2) imaginairy/modules/midas/api.py:125— imaginairy/modules/midas/api.py:125-142 | imaginairy/modules/midas/api.py:195-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 `imaginairy/modules/midas/api.py:195` 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 (21 lines × 3) imaginairy/modules/diffusion/model.py:475— imaginairy/modules/diffusion/model.py:475-495 | imaginairy/modules/diffusion/model.py:740-760 | imaginairy/modules/sgm/diffusionmodules/model.py:420-440 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/model.py:475` 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–19 lines × 3) imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:100— imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:100-116 | imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:210-228 | imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:377-393 — 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 `imaginairy/modules/sgm/autoencoding/regularizers/quantize.py:100` 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 (34 lines × 2) imaginairy/modules/diffusion/model.py:508— imaginairy/modules/diffusion/model.py:508-541 | imaginairy/modules/sgm/diffusionmodules/model.py:453-486 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–17 lines × 5) imaginairy/modules/diffusion/model.py:447— imaginairy/modules/diffusion/model.py:447-460 | imaginairy/modules/diffusion/model.py:614-627 | imaginairy/modules/diffusion/model.py:712-728 | imaginairy/modules/sgm/diffusionmodules/model.py:392-405 | imaginairy/modules/sgm/diffusionmodules/model.py:559-572 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/model.py:712` 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) imaginairy/modules/diffusion/model.py:167— imaginairy/modules/diffusion/model.py:167-182 | imaginairy/modules/diffusion/model.py:288-303 | imaginairy/modules/sgm/diffusionmodules/model.py:165-180 | imaginairy/modules/sgm/diffusionmodules/model.py:215-230 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) imaginairy/modules/cldm.py:128— imaginairy/modules/cldm.py:128-143 | imaginairy/modules/diffusion/openaimodel.py:519-534 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:562-577 — before extracting anything, compare `imaginairy/modules/cldm.py` and `imaginairy/modules/diffusion/openaimodel.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `imaginairy/modules/sgm/diffusionmodules/openaimodel.py:558` calls `isinstance` and `imaginairy/modules/cldm.py:127` 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 (22 lines × 2) imaginairy/modules/diffusion/util.py:188— imaginairy/modules/diffusion/util.py:188-209 | imaginairy/modules/sgm/diffusionmodules/util.py:201-222 — 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 (15 lines × 3) imaginairy/cli/edit.py:136— imaginairy/cli/edit.py:136-150 | imaginairy/cli/imagine.py:221-235 | REDACTED:430-444 — 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 `imaginairy/cli/edit.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 (14 lines × 5) imaginairy/modules/diffusion/model.py:427— imaginairy/modules/diffusion/model.py:427-440 | imaginairy/modules/diffusion/model.py:594-607 | imaginairy/modules/diffusion/model.py:737-750 | imaginairy/modules/sgm/diffusionmodules/model.py:372-385 | imaginairy/modules/sgm/diffusionmodules/model.py:539-552 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–14 lines × 3) imaginairy/modules/sgm/attention.py:248— imaginairy/modules/sgm/attention.py:248-261 | imaginairy/modules/sgm/attention.py:324-337 | imaginairy/modules/sgm/attention.py:426-438 — 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–13 lines × 5) imaginairy/img_processors/hed_boundary.py:17— imaginairy/img_processors/hed_boundary.py:17-25 | imaginairy/img_processors/hed_boundary.py:29-37 | imaginairy/img_processors/hed_boundary.py:41-53 | imaginairy/img_processors/hed_boundary.py:57-69 | imaginairy/img_processors/hed_boundary.py:73-85 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `imaginairy/img_processors/hed_boundary.py:17` 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) imaginairy/modules/diffusion/model.py:725— imaginairy/modules/diffusion/model.py:725-737 | imaginairy/modules/sgm/diffusionmodules/model.py:674-686 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/model.py:725` 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–13 lines × 2) imaginairy/modules/sgm/attention.py:272— imaginairy/modules/sgm/attention.py:272-284 | imaginairy/modules/sgm/attention.py:360-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) imaginairy/modules/diffusion/model.py:456— imaginairy/modules/diffusion/model.py:456-467 | imaginairy/modules/diffusion/model.py:724-735 | imaginairy/modules/sgm/diffusionmodules/model.py:401-412 | imaginairy/modules/sgm/diffusionmodules/model.py:673-684 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/model.py:456` 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 × 3) imaginairy/modules/sgm/autoencoding/temporal_ae.py:50— imaginairy/modules/sgm/autoencoding/temporal_ae.py:50-61 | imaginairy/modules/sgm/autoencoding/temporal_ae.py:137-148 | imaginairy/modules/sgm/autoencoding/temporal_ae.py:209-220 — 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 `imaginairy/modules/sgm/autoencoding/temporal_ae.py:50` 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–12 lines × 2) imaginairy/modules/sgm/diffusionmodules/openaimodel.py:842— imaginairy/modules/sgm/diffusionmodules/openaimodel.py:842-850 | imaginairy/modules/sgm/diffusionmodules/video_model.py:475-486 — before extracting anything, compare `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/video_model.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. 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 `imaginairy/modules/sgm/diffusionmodules/video_model.py:475` 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 × 2) imaginairy/modules/attention.py:285— imaginairy/modules/attention.py:285-293 | imaginairy/modules/sgm/attention.py:449-459 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/sgm/attention.py:449` 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–10 lines × 3) imaginairy/modules/diffusion/openaimodel.py:823— imaginairy/modules/diffusion/openaimodel.py:823-830 | imaginairy/modules/sgm/diffusionmodules/openaimodel.py:840-849 | imaginairy/modules/sgm/diffusionmodules/video_model.py:473-482 — before extracting anything, compare `imaginairy/modules/diffusion/openaimodel.py` and `imaginairy/modules/sgm/diffusionmodules/openaimodel.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/diffusion/openaimodel.py:823` 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 × 4) imaginairy/modules/diffusion/model.py:510— imaginairy/modules/diffusion/model.py:510-526 | imaginairy/modules/diffusion/model.py:641-657 | imaginairy/modules/sgm/diffusionmodules/model.py:455-471 | imaginairy/modules/sgm/diffusionmodules/model.py:586-602 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–9 lines × 2) imaginairy/modules/sgm/autoencoder.py:420— imaginairy/modules/sgm/autoencoder.py:420-428 | imaginairy/modules/sgm/autoencoder.py:433-439 — 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 × 3) imaginairy/modules/attention.py:126— imaginairy/modules/attention.py:126-133 | imaginairy/modules/sgm/attention.py:226-233 | imaginairy/modules/sgm/attention.py:301-308 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `imaginairy/modules/attention.py:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) imaginairy/modules/attention.py:129— imaginairy/modules/attention.py:129-135 | imaginairy/modules/attention.py:270-276 | imaginairy/modules/sgm/attention.py:229-235 | imaginairy/modules/sgm/attention.py:304-310 | imaginairy/modules/sgm/attention.py:409-415 — before extracting anything, compare `imaginairy/modules/attention.py` and `imaginairy/modules/sgm/attention.py` as WHOLE FILES: this scan already matched 9 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) imaginairy/modules/diffusion/model.py:59— imaginairy/modules/diffusion/model.py:59-64 | imaginairy/modules/diffusion/model.py:75-81 | imaginairy/modules/sgm/diffusionmodules/model.py:62-67 | imaginairy/modules/sgm/diffusionmodules/model.py:78-84 — before extracting anything, compare `imaginairy/modules/diffusion/model.py` and `imaginairy/modules/sgm/diffusionmodules/model.py` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 305 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Swallowed exception (empty catch) imaginairy/cli/unslow_the_cli.py:79— 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.
Orphaned file imaginairy/modules/refiners_sd.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 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 imaginairy/modules/diffusion/openaimodel.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 imaginairy/modules/sgm/diffusionmodules/openaimodel.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 imaginairy/img_processors/openpose.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 imaginairy/utils/model_manager.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 imaginairy/modules/sgm/attention.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 imaginairy/modules/sgm/diffusionmodules/model.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 imaginairy/api/generate_refiners.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 imaginairy/modules/autoencoder.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 imaginairy/modules/sgm/autoencoder.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 imaginairy/img_processors/densepose.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 imaginairy/api/generate_compvis.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 imaginairy/config.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 imaginairy/api/video_sample.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 imaginairy/modules/sgm/diffusionmodules/video_model.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 imaginairy/modules/sgm/autoencoding/regularizers/quantize.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 imaginairy/cli/shared.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 imaginairy/utils/log_utils.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file imaginairy/modules/cldm.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 imaginairy/modules/attention.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 imaginairy/enhancers/video_interpolation/rife/interpolate.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 imaginairy/modules/midas/midas/blocks.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 imaginairy/utils/model_cache.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 imaginairy/modules/midas/api.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.
Interpolated log message defeats structured logging REDACTED:125— `debug` at line 125 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 REDACTED:137— `debug` at line 137 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 REDACTED:81— `debug` at line 81 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 REDACTED:195— `debug` at line 195 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 REDACTED:345— `info` at line 345 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 imaginairy/utils/animations.py:61— `info` at line 61 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 imaginairy/utils/downloads.py:110— `info` at line 110 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 imaginairy/utils/downloads.py:214— `debug` at line 214 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 imaginairy/utils/model_manager.py:64— `info` at line 64 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 imaginairy/utils/model_manager.py:74— `error` at line 74 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging imaginairy/utils/model_manager.py:138— `warning` at line 138 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging imaginairy/utils/model_manager.py:299— `debug` at line 299 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 imaginairy/utils/model_manager.py:313— `debug` at line 313 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 imaginairy/utils/model_manager.py:373— `debug` at line 373 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 imaginairy/utils/model_manager.py:378— `debug` at line 378 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 imaginairy/utils/model_manager.py:564— `debug` at line 564 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 imaginairy/utils/model_manager.py:577— `debug` at line 577 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 imaginairy/utils/model_manager.py:595— `debug` at line 595 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 imaginairy/utils/model_manager.py:596— `debug` at line 596 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 imaginairy/utils/model_manager.py:661— `info` at line 661 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 imaginairy/utils/model_manager.py:725— `info` at line 725 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 imaginairy/utils/model_manager.py:815— `warning` 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.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging imaginairy/utils/safety.py:34— `debug` at line 34 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 imaginairy/utils/safety.py:51— `debug` at line 51 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 imaginairy/utils/safety.py:165— `info` at line 165 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.
Duplicated predicate imaginairy/api/generate_compvis.py:299— `control_input.mode != "inpaint" and control_image_t.min() < 0 or control_image_t.max() > 1` appears character-identically in 2 files — imaginairy/api/generate_compvis.py, imaginairy/api/generate_refiners.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 imaginairy/modules/diffusion/openaimodel.py:764— `level and i == self.num_res_blocks[level]` appears character-identically in 2 files — imaginairy/modules/diffusion/openaimodel.py, imaginairy/modules/sgm/diffusionmodules/openaimodel.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 imaginairy/modules/sgm/autoencoding/temporal_ae.py:273— `not XFORMERS_IS_AVAILABLE and attn_type == "vanilla-xformers"` appears character-identically in 2 files — imaginairy/modules/sgm/autoencoding/temporal_ae.py, imaginairy/modules/sgm/diffusionmodules/model.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate imaginairy/modules/cldm.py:232— `num_attention_blocks is None or nr < num_attention_blocks[level]` appears character-identically in 2 files — imaginairy/modules/cldm.py, imaginairy/modules/diffusion/openaimodel.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 imaginairy/samplers/ddim.py:71— `orig_latent is not None and t_start is not None` appears character-identically in 3 files — imaginairy/samplers/ddim.py, imaginairy/samplers/kdiff.py, imaginairy/samplers/plms.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 imaginairy/api/generate_compvis.py:455— `prompt.mask_modify_original and mask_image_orig and starting_image` appears character-identically in 2 files — imaginairy/api/generate_compvis.py, imaginairy/api/generate_refiners.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 imaginairy/api/generate_compvis.py:508— `prompt.width <= cutoff[0] and prompt.height <= cutoff[1]` appears character-identically in 2 files — imaginairy/api/generate_compvis.py, imaginairy/api/generate_refiners.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 imaginairy/modules/encoders.py:224— `self.model.transformer.grad_checkpointing and not torch.jit.is_scripting()` appears character-identically in 2 files — imaginairy/modules/encoders.py, imaginairy/modules/sgm/encoders/modules.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.
D34 · Knowledge Freshness· Most significant orphaned file · ×3
Most significant orphaned file imaginairy/modules/diffusion/ddpm.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 imaginairy/modules/sgm/encoders/modules.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 imaginairy/modules/diffusion/model.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.
No ADRs found setup.py:12— 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 `setup.py` makes this repository a deployable product (line 12).
Scattered collaborators — 87 % of calls cross a namespace and only 46 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
Dormant codebase — 106 of 106 significant files have no living knowledge — the codebase as a whole is dormant, not 106 separate risks. Counted over 106 of the 174 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.
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.
No SAST REDACTED:3— 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.
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.
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.
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.
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.
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.
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.
Run 01a1eb75-72b1-7acc-9ee9-c4377048f289 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 51 · Warnings: 283 · Recommendations: 160 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 21:41 UTC.
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.