Public report of kishikawakatsumi/webp-exercises, 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, 15:09 UTC · Survey ID cd_ef08a40a9d9a4698a21a1564165fcd16
kishikawakatsumi/webp-exercises
Measured 17 November 2026, 15:09 UTC, at code version 799b7bf
First survey, so nothing to compare with yet
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A small codebase: 15,355 lines of product code in 9 projects, tests not counted · Estimated rebuild effort: about 0.1 person-years · Weakest lens: Production Readiness, 34.9
Findings by how serious they are
0 critical232 serious9 minor
28 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, 15:09 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
28of 28 dimensions measured by tools.
239of 241 findings point to an exact file and line, so you can open each one in the code. The other 2 concern the repository as a whole, such as missing documentation.
28dimensions across 5 lenses, read from 15,355 lines of product code in 9 projects.
kishikawakatsumi/webp-exercises falls short of our standard for a template or a sample because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 54.5 out of 100 and is rated Adequate, and it has no critical findings.
Production Readiness, at 34.9, is the weakest lens and counts most in the score. The best first step for the work it takes is improving the documentation, worth about 9.1 points. Adding an automated build and test pipeline would lift Production Readiness itself, worth about 10.1 points. Raising Production Readiness to 52 would lift the score to about 62.6.
Most of the 232 serious findings are in Code Health.
The product code is 15,355 lines, about €16,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 Production Readiness rose from 34.9 to 52, the lowest score rated Strong, the score would rise from 54.5 to about 62.6.
Code composition: what the lines of code are
Product code 94%Tests 6%
Rebuild cost: about €16,000 · Estimate
Cost to rebuild
€5,400 to €27,000, for 89 to 283 hours of work, about 0.1 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.8 at a score of 55. 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
Small: 15,355 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
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md.
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 €16,000 to build again, about 0.1 person-years of work. Its weakest lens is Production Readiness, at 34.9 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Documentation finding(s) in Documentation Quality. Of all the actions in this report, it raises the score most for the work it takes: about 9.1 points for low effort, because it clears the 1 Documentation Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 16% on every change.
How this is estimated: It rests on an assumption of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4)
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
9 modules, with 8 dependencies between them. Every module uses only modules listed above it, so there are no loops.
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.
2. Subtract Green~TinyWebP uses 1. Prefix Coding~TinyWebP, so a change to 1. Prefix Coding~TinyWebP can break 2. Subtract Green~TinyWebP, while a change to 2. Subtract Green~TinyWebP can't break 1. Prefix Coding~TinyWebP.
Position
Below the diagonal: 2. Subtract Green~TinyWebP uses a module listed above it, which is the healthy direction.
3. LZ77~TinyWebP uses 1. Prefix Coding~TinyWebP, so a change to 1. Prefix Coding~TinyWebP can break 3. LZ77~TinyWebP, while a change to 3. LZ77~TinyWebP can't break 1. Prefix Coding~TinyWebP.
Position
Below the diagonal: 3. LZ77~TinyWebP uses a module listed above it, which is the healthy direction.
4. Predictor~TinyWebP uses 1. Prefix Coding~TinyWebP, so a change to 1. Prefix Coding~TinyWebP can break 4. Predictor~TinyWebP, while a change to 4. Predictor~TinyWebP can't break 1. Prefix Coding~TinyWebP.
Position
Below the diagonal: 4. Predictor~TinyWebP uses a module listed above it, which is the healthy direction.
5. Cross Color~TinyWebP uses 1. Prefix Coding~TinyWebP, so a change to 1. Prefix Coding~TinyWebP can break 5. Cross Color~TinyWebP, while a change to 5. Cross Color~TinyWebP can't break 1. Prefix Coding~TinyWebP.
Position
Below the diagonal: 5. Cross Color~TinyWebP uses a module listed above it, which is the healthy direction.
6→1 6. Color Indexing~TinyWebP uses 1. Prefix Coding~TinyWebP✕
Connections
6 pairs of types, where a type in 6. Color Indexing~TinyWebP uses a type in 1. Prefix Coding~TinyWebP.
The types involved
6. Color Indexing~TinyWebP.ByteReader → 1. Prefix Coding~TinyWebP.Data
6. Color Indexing~TinyWebP.RIFFReader → 1. Prefix Coding~TinyWebP.Data
6. Color Indexing~TinyWebP.RIFFReader.swift → 1. Prefix Coding~TinyWebP.Data
6. Color Indexing~TinyWebP.VP8LDecoder → 1. Prefix Coding~TinyWebP.Data
6. Color Indexing~TinyWebP.WebPDecoder → 1. Prefix Coding~TinyWebP.Data
6. Color Indexing~TinyWebP.WebPEncoder → 1. Prefix Coding~TinyWebP.Data
Direction
6. Color Indexing~TinyWebP uses 1. Prefix Coding~TinyWebP, so a change to 1. Prefix Coding~TinyWebP can break 6. Color Indexing~TinyWebP, while a change to 6. Color Indexing~TinyWebP can't break 1. Prefix Coding~TinyWebP.
Position
Below the diagonal: 6. Color Indexing~TinyWebP uses a module listed above it, which is the healthy direction.
7→1 7. Color Cache~TinyWebP uses 1. Prefix Coding~TinyWebP✕
Connections
6 pairs of types, where a type in 7. Color Cache~TinyWebP uses a type in 1. Prefix Coding~TinyWebP.
The types involved
7. Color Cache~TinyWebP.ByteReader → 1. Prefix Coding~TinyWebP.Data
7. Color Cache~TinyWebP.RIFFReader → 1. Prefix Coding~TinyWebP.Data
7. Color Cache~TinyWebP.RIFFReader.swift → 1. Prefix Coding~TinyWebP.Data
7. Color Cache~TinyWebP.VP8LDecoder → 1. Prefix Coding~TinyWebP.Data
7. Color Cache~TinyWebP.WebPDecoder → 1. Prefix Coding~TinyWebP.Data
7. Color Cache~TinyWebP.WebPEncoder → 1. Prefix Coding~TinyWebP.Data
Direction
7. Color Cache~TinyWebP uses 1. Prefix Coding~TinyWebP, so a change to 1. Prefix Coding~TinyWebP can break 7. Color Cache~TinyWebP, while a change to 7. Color Cache~TinyWebP can't break 1. Prefix Coding~TinyWebP.
Position
Below the diagonal: 7. Color Cache~TinyWebP uses a module listed above it, which is the healthy direction.
8. Complete~WebP uses 1. Prefix Coding~TinyWebP, so a change to 1. Prefix Coding~TinyWebP can break 8. Complete~WebP, while a change to 8. Complete~WebP can't break 1. Prefix Coding~TinyWebP.
Position
Below the diagonal: 8. Complete~WebP uses a module listed above it, which is the healthy direction.
Top priorities: Add a CI workflow that builds and runs the test suite on every push/PR; Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md; Expand the README with getting-started, architecture overview and a project map.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md.
Bring the 22 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with WebPDecoder.decode (cyclomatic 30), Transform.swift.inversePredictor (cyclomatic 30), VP8LDecoder.decodePixels (cyclomatic 21).
Bring the 17 bodies over 30 down to 30 or less in Cognitive Complexity — start with Writer.swift.encodeImageData (cognitive 51), VP8Decoder.computeFilterParams (cognitive 50), Transform.swift.inversePredictor (cognitive 50).
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 — 0
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 — 232
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 — 9
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 28
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 28 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 — 28 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, 239 of 241 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.
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 (.swift) and this repository declares a SwiftPM test suite (9 packages), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D15 Churn × Complexity Hotspots — 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-commit history — no usable git history window to measure hotspots: a single-commit clone exposes no history window, so the churn × complexity hotspot signal is unavailable — not scored for this run.
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-contributor repository — bus factor is not applicable (1 contributor(s) across 1 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift`, `2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift`, `3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift`, `4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift`, `5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift`, … (+6 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D34 Knowledge Freshness — 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. Too few commits to judge knowledge freshness (1 commit(s) sampled).
D35 Change Coupling — measured, with a gap in what it reached — 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. Git history depth insufficient — this repository has 1 commit(s), too few for a reliable change-coupling signal. The clone is complete, so there is no deeper history to fetch: the signal returns as the project accumulates history.
D44 Platform End-of-Life — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — 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 authorization 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 authorization controls.
C3 Audit Trail — 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 audit 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 audit 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 Swift 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 Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — not measured this run — 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.
X1 Async 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, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust 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.
X12 Unreachable branch — 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, Python, Dart, Ruby, Scala, Kotlin, Java and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Java 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.
X13 Undrained process stream — 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, Python, Dart, Ruby, Scala, Kotlin, Rust and Java source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust or Java 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.
X15 Unvalidated length from an untrusted reader — 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, Scala, PHP, Ruby, Python, Go, Rust, Dart, F# and Elixir source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust, Dart, F# 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.
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.
X17 Uncapped recursion over a caller-supplied document — 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, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Python, 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.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python 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.
X22 Contradicted release guard — 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# and Visual Basic syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin, PHP, F#, Rust and Visual Basic source only, and no C# was loaded, and this repository's Swift 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.
X23 Unguarded diagnostic materialisation — 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, F#, Python, Dart, Ruby, Scala, Kotlin, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin, PHP 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.
X24 Document value interpolated into markup unescaped — 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, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python 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.
X25 Inert configuration knob — 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, Scala, PHP, Erlang, Python, Dart, Ruby and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart, Ruby 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.
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.
X30 Support guard that admits what it rejects — 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 Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart, Ruby and Erlang source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart, Ruby or Erlang was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
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.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
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").
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.
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.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 22 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with WebPDecoder.decode (cyclomatic 30), Transform.swift.inversePredictor (cyclomatic 30), VP8LDecoder.decodePixels (cyclomatic 21). — 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 22 together lifts Cyclomatic Complexity from 7.1 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.
+ 19 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 17 bodies over 30 down to 30 or less in Cognitive Complexity — start with Writer.swift.encodeImageData (cognitive 51), VP8Decoder.computeFilterParams (cognitive 50), Transform.swift.inversePredictor (cognitive 50). — 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 17 together lifts Cognitive Complexity from 3.7 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.7 / 10Stronggated by 1 serious finding✓ 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 1 MethodTooLong finding(s) in God Classes — start with WebPDecoder.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
94 duplicated block group(s) detected. 55.2 % of the production lines (8,476 of 15,355) are in a reported copy. A further 50 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
Members sharing a duplicated core (8 members, 50+ identical tokens) · ×191. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:22
Members sharing a duplicated core (7 members, 50+ identical tokens) · ×131. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:22
+ 79 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 19 Members sharing a duplicated core (8 members, 50+ identical tokens) finding(s) in Code Duplication — start with HuffmanCode.swift (7), Writer.swift (4), VP8LDecoder.swift (3). — One of this dimension's main actionable groups (19 warning-level).
Resolve the 13 Members sharing a duplicated core (7 members, 50+ identical tokens) finding(s) in Code Duplication — start with Debug.swift (5), VP8LDecoder.swift (4), RIFFReader.swift (2). — One of this dimension's main actionable groups (13 warning-level).
Resolve the 5 Duplicated block (11 lines × 8) finding(s) in Code Duplication — start with HuffmanCode.swift (3), VP8LDecoder.swift, Writer.swift. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
8 production modules (SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence.
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: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 87.0%. Measured from the Swift suite (1. Prefix Coding: no coverage export; 2. Subtract Green: no coverage export; 3. LZ77: no coverage export; 4. Predictor: no coverage export; 5. Cross Color: no coverage export; 6. Color Indexing: no coverage export; 7. Color Cache: no coverage export; 8. Complete: no coverage export; RIFF Header Reader: `swift test --enable-code-coverage` over 1 production file(s)).
✓ On the Gold path — maintain.
Detailed fixes: d8_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.5 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
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 0 third-party package(s) use a banned license. This repository's 9 SwiftPM file(s) declare no third-party dependencies and no committed resolution pins any, so there is no third-party package licence to grade — a complete answer, not a gap in coverage. It also commits no CocoaPods or Carthage manifest, so SwiftPM is the only package manager it takes dependencies through. This repository's OWN licence is its own choice and is not judged here.
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.
0 deducted task-comment markers across 15355 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
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.
0 of 1 documentation facets pass in full; short on: F2 example. 2 document(s) read across 10 unit(s).
Documentation: no build, run or usage example8. Complete/README.md:1
What to do
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
0 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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).
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.
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 read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
The root README is 2 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers. — README.md:1
What to do
Expand the README with getting-started, architecture overview and a project map.
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR.
Do you agree with this assessment?
P10 · Library API & versioning6.0 / 10Strong✓ Tool-verified
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.
No explicit version was found for the SwiftPM library declared by `Package.swift`. This check read nothing in Package.swift, which has no version field, and a CHANGELOG/CHANGES/HISTORY/NEWS/RELEASES file with a semver heading, or release tooling (changesets, release-please, semantic-release, goreleaser, cargo-release, bump2version, standard-version, git-cliff) in the library's directory or at the repository root, or a semver release tag (or a Drupal `8.x-1.2` release tag) in the repository. A version computed where none of those can see is invisible here. A published library needs explicit semantic versioning so consumers can reason about breaking changes. (×3) — 1. Prefix Coding/Package.swift, 2. Subtract Green/Package.swift, 3. LZ77/Package.swift
What to do
Declare the version where the ecosystem expects it, or keep a CHANGELOG with semver release headings, and follow semver for breaking changes.
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 CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Run what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 1 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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.
C3 Audit Trail — Not assessed: these audit 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 audit 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.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 83 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 Swift 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 Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — no interface, protocol or abstract type declares an operation an implementer must write
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization 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 authorization 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.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) 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 property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D12 Dependency Hygiene — Not applicable — this repository's 9 dependency manifest(s) (a Swift Package.swift/Package.resolved) were read and declare no dependency, so there is no dependency whose hygiene could be assessed. This is a statement about what the repository declares, not an all-clear for dependencies it does not declare.
D15 Churn × Complexity Hotspots — single-commit history — no usable git history window to measure hotspots
D16 Bus Factor — single-contributor 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.
D20 ADR Quality — N/A — this repo declares itself a template / kata / sample / demo; a formal ADR log is deferred to a real application built from it.
D21 Naming Consistency — N/A — too few peers to establish a naming convention (1727 declarations, no unit with a dominant convention).
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .swift, 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
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 11 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D34 Knowledge Freshness — too few commits to judge knowledge freshness
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
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
M2 Architecture documentation — This repo declares itself a template / kata / sample / demo — formal architecture documentation (ADRs, C4 diagrams) is deferred to a real application built from it, so its absence is not a defect here.
M4 Documentation accuracy — Not applicable: the 2 current-state document(s) make no claim of a kind M4 checks.
P12 CI test-gate honesty — no CI workflow found
P2 Observability — This repository's Swift source (9 module(s), 148 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 1 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not 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
X12 Unreachable branch — 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
X13 Undrained process stream — 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
X15 Unvalidated length from an untrusted reader — 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
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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — 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: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — 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
X23 Unguarded diagnostic materialisation — 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
X24 Document value interpolated into markup unescaped — 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
X25 Inert configuration knob — 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
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
X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. Swift's `Array`, `Dictionary` and `Set` are values: `for x in items` walks the copy taken when the loop starts, so a body that adds to or removes from `items` changes a different value, nothing is invalidated, and every original element is still visited. This repository's Swift names no Foundation mutable collection (`NSMutableArray` and kin), the one kind a Swift loop can walk by reference. Not a gap in the analyzer and not a finding about your code.
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
X30 Support guard that admits what it rejects — 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.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Swift was read, and it logs through none: `print` and `NSLog` take one finished line, and os's `Logger` keeps each interpolated value as its own argument, so an assembled message there loses nothing the API could have kept (as with log4net in C#). Calls through swift-log (`import Logging`) and `os_log` calls would be judged.
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.
Serious — 232 finding(s)
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×19
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:22— 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 2. Subtract Green/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 3. LZ77/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 4. Predictor/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 5. Cross Color/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 6. Color Indexing/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 7. Color Cache/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 8. Complete/Sources/WebP/Decoder/ByteReader.swift:22-31 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:93— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:93-123 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:93-123 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:93-123 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:93-123 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:93-123 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:93-123 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:93-123 | 8. Complete/Sources/WebP/Decoder/RIFFReader.swift:87-117 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:132— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 8. Complete/Sources/WebP/Decoder/RIFFReader.swift:126-132 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:61-78 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:61-78 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:61-78 | 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:106-123 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:80-142 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:80-142 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:80-142 | 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:344-479 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:356-373 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:356-373 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:356-373 | 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:494-511 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:6— 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 3. LZ77/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 4. Predictor/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 5. Cross Color/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 6. Color Indexing/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 7. Color Cache/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 8. Complete/Sources/WebP/Encoder/BitWriter.swift:6-13 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:21— 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:21-33 | 2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift:21-33 | 3. LZ77/Sources/TinyWebP/Encoder/BitWriter.swift:21-33 | 4. Predictor/Sources/TinyWebP/Encoder/BitWriter.swift:21-33 | 5. Cross Color/Sources/TinyWebP/Encoder/BitWriter.swift:21-33 | 6. Color Indexing/Sources/TinyWebP/Encoder/BitWriter.swift:21-33 | 7. Color Cache/Sources/TinyWebP/Encoder/BitWriter.swift:21-33 | 8. Complete/Sources/WebP/Encoder/BitWriter.swift:21-30 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:57— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:57-67 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:57-67 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:57-67 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:58-68 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:69— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:69-87 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:69-87 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:69-87 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:70-88 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:90— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:90-118 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:90-118 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:90-118 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:91-119 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:120— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:120-158 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:120-158 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:120-158 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:121-159 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:121-159 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:121-159 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:121-159 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:121-156 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:160— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:160-170 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:160-170 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:160-170 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:158-168 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:172— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:172-207 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:172-207 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:172-207 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:170-201 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:209— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:209-240 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:209-240 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:209-240 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-241 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-245 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-241 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-241 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:203-237 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:5— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:5-21 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:5-21 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:5-21 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:5-21 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:5-21 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:5-21 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:5-21 | 8. Complete/Sources/WebP/Encoder/Writer.swift:35-55 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:41— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:41-69 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:41-69 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:41-69 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:41-69 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:41-69 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:41-69 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:41-69 | 8. Complete/Sources/WebP/Encoder/Writer.swift:182-219 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:71— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 8. Complete/Sources/WebP/Encoder/Writer.swift:221-229 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:150— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:150-173 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:155-178 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:274-304 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:161-184 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:165-188 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:171-196 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:190-224 | 8. Complete/Sources/WebP/Encoder/Writer.swift:495-534 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×13
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:22— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:22-46 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:22-46 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:22-46 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:22-46 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:22-46 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:22-46 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:22-46 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:48— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:34-59 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:34-59 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:34-59 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:144-173 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:144-173 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:144-173 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175-256 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175-256 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175-256 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:336-354 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:336-354 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:336-354 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/WebPDecoder.swift:11— 1. Prefix Coding/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 2. Subtract Green/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 3. LZ77/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 4. Predictor/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 5. Cross Color/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 6. Color Indexing/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 7. Color Cache/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:4— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:4-61 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:63— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:63-74 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:76— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:76-83 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:85— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:85-125 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:127— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:127-141 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:91— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:91-129 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:96-134 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:91-140 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:101-140 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:101-144 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:106-143 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:95-142 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:172— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:172— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:172— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:173— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:173— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:173— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:173— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuffmanCode.swift.writeHuffmanCodes (cognitive 18) 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:170— HuffmanCode.swift.writeHuffmanCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.printHuffmanTree (cyclomatic 18) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cyclomatic 18) 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cyclomatic 18) 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cyclomatic 18) 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cyclomatic 18) 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cyclomatic 18) 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cyclomatic 18) 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
VP8LDecoder.buildDecodingTree (cyclomatic 17) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree 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.
VP8LDecoder.buildDecodingTree (cyclomatic 17) 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree 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.
VP8LDecoder.buildDecodingTree (cyclomatic 17) 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree 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.
VP8LDecoder.buildDecodingTree (cyclomatic 17) 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree 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.
VP8LDecoder.buildDecodingTree (cyclomatic 17) 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258— VP8LDecoder.buildDecodingTree 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.
VP8LDecoder.buildDecodingTree (cyclomatic 17) 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258— VP8LDecoder.buildDecodingTree 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.
VP8LDecoder.buildDecodingTree (cyclomatic 17) 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258— VP8LDecoder.buildDecodingTree 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.
VP8LDecoder.buildDecodingTree (cognitive 31) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.buildDecodingTree (cognitive 31) 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.buildDecodingTree (cognitive 31) 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.buildDecodingTree (cognitive 31) 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— VP8LDecoder.buildDecodingTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.buildDecodingTree (cognitive 31) 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258— VP8LDecoder.buildDecodingTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.buildDecodingTree (cognitive 31) 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258— VP8LDecoder.buildDecodingTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.buildDecodingTree (cognitive 31) 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258— VP8LDecoder.buildDecodingTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.debugDumpHistogramsGRBAD (cognitive 29) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:85— Debug.swift.debugDumpHistogramsGRBAD has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.debugDumpHistogramsGRBAD (cognitive 29) 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:85— Debug.swift.debugDumpHistogramsGRBAD has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.debugDumpHistogramsGRBAD (cognitive 29) 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:85— Debug.swift.debugDumpHistogramsGRBAD has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.debugDumpHistogramsGRBAD (cognitive 29) 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:85— Debug.swift.debugDumpHistogramsGRBAD has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.debugDumpHistogramsGRBAD (cognitive 29) 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:85— Debug.swift.debugDumpHistogramsGRBAD has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.debugDumpHistogramsGRBAD (cognitive 29) 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:85— Debug.swift.debugDumpHistogramsGRBAD has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.debugDumpHistogramsGRBAD (cognitive 29) 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:85— Debug.swift.debugDumpHistogramsGRBAD has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixCode.swift.buildCLDecodingTree (cognitive 25) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7— PrefixCode.swift.buildCLDecodingTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (9 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixCode.swift.buildCLDecodingTree (cognitive 25) 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7— PrefixCode.swift.buildCLDecodingTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (9 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixCode.swift.buildCLDecodingTree (cognitive 25) 3. LZ77/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7— PrefixCode.swift.buildCLDecodingTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (9 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixCode.swift.buildCLDecodingTree (cognitive 25) 4. Predictor/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14— PrefixCode.swift.buildCLDecodingTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (9 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixCode.swift.buildCLDecodingTree (cognitive 25) 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14— PrefixCode.swift.buildCLDecodingTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (9 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixCode.swift.buildCLDecodingTree (cognitive 25) 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14— PrefixCode.swift.buildCLDecodingTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (9 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixCode.swift.buildCLDecodingTree (cognitive 25) 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14— PrefixCode.swift.buildCLDecodingTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (9 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debug.swift.printHuffmanTree (cognitive 22) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cognitive 22) 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cognitive 22) 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cognitive 22) 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cognitive 22) 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cognitive 22) 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Debug.swift.printHuffmanTree (cognitive 22) 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:4— Debug.swift.printHuffmanTree has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, label). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
VP8LDecoder.decodePrefixCode (cognitive 21) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169— VP8LDecoder.decodePrefixCode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodePrefixCode (cognitive 21) 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169— VP8LDecoder.decodePrefixCode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodePrefixCode (cognitive 21) 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169— VP8LDecoder.decodePrefixCode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodePrefixCode (cognitive 21) 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169— VP8LDecoder.decodePrefixCode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodePrefixCode (cognitive 21) 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175— VP8LDecoder.decodePrefixCode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodePrefixCode (cognitive 21) 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175— VP8LDecoder.decodePrefixCode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodePrefixCode (cognitive 21) 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175— VP8LDecoder.decodePrefixCode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (11 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:116— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:116-126 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:116-126 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:116-126 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:116-126 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:122-132 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:122-132 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:122-132 | 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:413-423 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:57— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:57-67 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:57-67 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:57-67 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:58-68 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:58-68 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:160— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:160-170 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:160-170 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:160-170 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:161-171 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:158-168 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:155` calls `dumpCanonicalTable` and `8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:153` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:41— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:41-51 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:41-51 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:41-51 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:41-51 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:41-51 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:41-51 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:41-51 | 8. Complete/Sources/WebP/Encoder/Writer.swift:182-192 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:45— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:45-55 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:45-55 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:45-55 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:46-56 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:46-56 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:46-56 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:46-56 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:46-56 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:219— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:219-228 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:219-228 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:219-228 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:220-229 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:220-229 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:220-229 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:220-229 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:217-226 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:153— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:153-162 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:158-167 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:277-286 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:164-173 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:168-177 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:174-183 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:200-209 | 8. Complete/Sources/WebP/Encoder/Writer.swift:505-514 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:153` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:22— 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 2. Subtract Green/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 3. LZ77/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 4. Predictor/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 5. Cross Color/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 6. Color Indexing/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 7. Color Cache/Sources/TinyWebP/Decoder/ByteReader.swift:22-31 | 8. Complete/Sources/WebP/Decoder/ByteReader.swift:22-31 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/ByteReader.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 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 × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:11— 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:11-20 | 2. Subtract Green/Sources/TinyWebP/Decoder/ByteReader.swift:11-20 | 3. LZ77/Sources/TinyWebP/Decoder/ByteReader.swift:11-20 | 4. Predictor/Sources/TinyWebP/Decoder/ByteReader.swift:11-20 | 5. Cross Color/Sources/TinyWebP/Decoder/ByteReader.swift:11-20 | 6. Color Indexing/Sources/TinyWebP/Decoder/ByteReader.swift:11-20 | 7. Color Cache/Sources/TinyWebP/Decoder/ByteReader.swift:11-20 | 8. Complete/Sources/WebP/Decoder/ByteReader.swift:11-20 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/ByteReader.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (6 lines × 2) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:205— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:205-210 | 8. Complete/Sources/WebP/Encoder/Writer.swift:413-418 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:87— 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:87-92 | 8. Complete/Sources/WebP/Encoder/Writer.swift:271-276 — before extracting anything, compare `4. Predictor/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:87— 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:87-92 | 8. Complete/Sources/WebP/Encoder/Writer.swift:261-266 — before extracting anything, compare `5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:456— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:456-461 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:532-537 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (4 members, 50+ identical tokens) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:91— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:91-140 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:106-143 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:95-142 | 8. Complete/Sources/WebP/Encoder/Writer.swift:285-340 — 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) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:267— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:267-272 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:164-169 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:183-188 | 8. Complete/Sources/WebP/Encoder/Writer.swift:488-493 — 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) 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:1— 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:1-104 | 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:1-59 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:1-104 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:180-239 — 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 (6 corresponding lines) · ×3
Edited copy of a member (6 corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8/IDCT.swift:59— 8. Complete/Sources/WebP/Decoder/VP8/IDCT.swift:59-64 | 8. Complete/Sources/WebP/Decoder/VP8/IDCT.swift:66-71 — 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) 2. Subtract Green/Sources/TinyWebP/Encoder/EncodeTransform.swift:1— 2. Subtract Green/Sources/TinyWebP/Encoder/EncodeTransform.swift:1-6 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:241-246 — 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) 8. Complete/Sources/WebP/Decoder/VP8/Filter.swift:23— 8. Complete/Sources/WebP/Decoder/VP8/Filter.swift:23-28 | 8. Complete/Sources/WebP/Decoder/VP8/IDCT.swift:3-12 — 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.
Duplicated block (12 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:22— 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:22-33 | 2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift:22-33 | 3. LZ77/Sources/TinyWebP/Encoder/BitWriter.swift:22-33 | 4. Predictor/Sources/TinyWebP/Encoder/BitWriter.swift:22-33 | 5. Cross Color/Sources/TinyWebP/Encoder/BitWriter.swift:22-33 | 6. Color Indexing/Sources/TinyWebP/Encoder/BitWriter.swift:22-33 | 7. Color Cache/Sources/TinyWebP/Encoder/BitWriter.swift:22-33 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:63— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:63-74 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:63-74 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFF.swift:5— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFF.swift:5-16 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFF.swift:5-16 | 3. LZ77/Sources/TinyWebP/Decoder/RIFF.swift:5-16 | 4. Predictor/Sources/TinyWebP/Decoder/RIFF.swift:5-16 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFF.swift:5-16 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFF.swift:5-16 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFF.swift:5-16 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFF.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/RIFF.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:81— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:81-89 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:81-89 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:127— 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:127-135 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:122-130 — before extracting anything, compare `6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift` and `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:127` 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) 8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:293— 8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:293-301 | 8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:313-321 — 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 `8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:293` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:309` calls `Int` and `8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:292` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:132— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:132-138 | 8. Complete/Sources/WebP/Decoder/RIFFReader.swift:126-132 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:33— 1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift:33-39 | 2. Subtract Green/Sources/TinyWebP/Decoder/ByteReader.swift:33-39 | 3. LZ77/Sources/TinyWebP/Decoder/ByteReader.swift:33-39 | 4. Predictor/Sources/TinyWebP/Decoder/ByteReader.swift:33-39 | 5. Cross Color/Sources/TinyWebP/Decoder/ByteReader.swift:33-39 | 6. Color Indexing/Sources/TinyWebP/Decoder/ByteReader.swift:33-39 | 7. Color Cache/Sources/TinyWebP/Decoder/ByteReader.swift:33-39 | 8. Complete/Sources/WebP/Decoder/ByteReader.swift:33-39 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/ByteReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/ByteReader.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 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 (7 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:40— 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:40-46 | 2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift:40-46 | 3. LZ77/Sources/TinyWebP/Encoder/BitWriter.swift:40-46 | 4. Predictor/Sources/TinyWebP/Encoder/BitWriter.swift:40-46 | 5. Cross Color/Sources/TinyWebP/Encoder/BitWriter.swift:40-46 | 6. Color Indexing/Sources/TinyWebP/Encoder/BitWriter.swift:40-46 | 7. Color Cache/Sources/TinyWebP/Encoder/BitWriter.swift:40-46 | 8. Complete/Sources/WebP/Encoder/BitWriter.swift:37-43 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
EncodeTransform.swift.applyPredictTransform (cognitive 45) 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:1— EncodeTransform.swift.applyPredictTransform has cognitive complexity 45 (threshold 15). Drivers by points: loops 10 (35 pts), if/else 2 (9 pts), boolean chains 1 (nesting depth added 32). 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.
EncodeTransform.swift.applyPredictTransform (cognitive 45) 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:1— EncodeTransform.swift.applyPredictTransform has cognitive complexity 45 (threshold 15). Drivers by points: loops 10 (35 pts), if/else 2 (9 pts), boolean chains 1 (nesting depth added 32). 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.
EncodeTransform.swift.applyPaletteTransform (cognitive 25) 6. Color Indexing/Sources/TinyWebP/Encoder/EncodeTransform.swift:5— EncodeTransform.swift.applyPaletteTransform has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (9 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.
EncodeTransform.swift.applyPaletteTransform (cognitive 25) 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:252— EncodeTransform.swift.applyPaletteTransform has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (9 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.
Duplicated block (21 lines × 2) 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:95— 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:95-115 | 8. Complete/Sources/WebP/Encoder/Writer.swift:285-305 — before extracting anything, compare `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:116` calls `debugDumpHistogramsGRBAD` and `8. Complete/Sources/WebP/Encoder/Writer.swift:307` 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 (21 lines × 2) 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:158— 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:158-178 | 8. Complete/Sources/WebP/Encoder/Writer.swift:438-458 — before extracting anything, compare `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:330-348 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:336-354 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:336-354 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:336-354 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:209— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:209-227 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:209-227 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:209-227 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-228 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-228 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-228 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:210-228 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:59-76 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:61-78 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:61-78 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:61-78 | 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:106-123 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:350-367 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:356-373 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:356-373 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:356-373 | 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:494-511 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:190— 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:190-207 | 8. Complete/Sources/WebP/Encoder/Writer.swift:495-512 — before extracting anything, compare `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:311— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:311-328 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:355-372 — 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 × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:10— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:10-21 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:10-21 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:10-21 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:10-21 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:10-21 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:10-21 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:10-21 | 8. Complete/Sources/WebP/Encoder/Writer.swift:44-55 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:10` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `8. Complete/Sources/WebP/Encoder/Writer.swift:41` calls `writeChunkVP8X` and `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:8` 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 (12 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:20— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:20-31 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:20-31 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:20-31 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:20-32 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:20-32 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:20-32 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:20-32 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:20-32 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:81— 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:81-88 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:81-88 — before extracting anything, compare `4. Predictor/Sources/TinyWebP/Encoder/Writer.swift` and `5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:81` 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) 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:92— 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:92-99 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:92-99 — before extracting anything, compare `4. Predictor/Sources/TinyWebP/Encoder/Writer.swift` and `5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:92` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:90— 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:90-96 | 8. Complete/Sources/WebP/Encoder/Writer.swift:242-248 — before extracting anything, compare `6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:259— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:259-265 | 8. Complete/Sources/WebP/Encoder/Writer.swift:480-486 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:37— 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:37-42 | 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:74-79 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:37-42 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:74-79 — before extracting anything, compare `4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:267— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:267-272 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:164-169 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:183-188 | 8. Complete/Sources/WebP/Encoder/Writer.swift:488-493 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) 2. Subtract Green/Sources/TinyWebP/Encoder/EncodeTransform.swift:1— 2. Subtract Green/Sources/TinyWebP/Encoder/EncodeTransform.swift:1-6 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:242-246 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:464— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:464-468 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:540-546 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:125— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:125-129 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:125-129 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:125-129 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:125-129 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:125-129 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:125-129 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:125-129 | 8. Complete/Sources/WebP/Decoder/RIFFReader.swift:119-123 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:6— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:6-10 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:6-10 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:6-10 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:6-10 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:6-10 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:6-10 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:6-10 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:6-10 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
WebPDecoder.decode (cyclomatic 30) 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:6— WebPDecoder.decode has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
Transform.swift.inversePredictor (cyclomatic 30) 8. Complete/Sources/WebP/Decoder/VP8L/Transform.swift:66— Transform.swift.inversePredictor has cyclomatic complexity 30 (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.
VP8LDecoder.decodePixels (cyclomatic 21) 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:344— VP8LDecoder.decodePixels 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.
Writer.swift.encodeImageData (cyclomatic 21) 8. Complete/Sources/WebP/Encoder/Writer.swift:342— Writer.swift.encodeImageData 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.
VP8Decoder.computeFilterParams (cyclomatic 19) 8. Complete/Sources/WebP/Decoder/VP8/Filter.swift:317— VP8Decoder.computeFilterParams has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Writer.swift.encodeImageData (cyclomatic 16) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:142— Writer.swift.encodeImageData has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VP8Decoder.prepareYBR (cyclomatic 16) 8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:13— VP8Decoder.prepareYBR has cyclomatic complexity 16 (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.
WebPDecoder.swift.unfilterAlpha (cyclomatic 16) 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:502— WebPDecoder.swift.unfilterAlpha has cyclomatic complexity 16 (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.
No assertions: example RIFF Header Reader/Tests/Tests.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Writer.swift.encodeImageData (cognitive 51) 8. Complete/Sources/WebP/Encoder/Writer.swift:342— Writer.swift.encodeImageData has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 4 (13 pts), boolean chains 6 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8Decoder.computeFilterParams (cognitive 50) 8. Complete/Sources/WebP/Decoder/VP8/Filter.swift:317— VP8Decoder.computeFilterParams has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (39 pts), match/switch 2 (8 pts), loops 2 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Transform.swift.inversePredictor (cognitive 50) 8. Complete/Sources/WebP/Decoder/VP8L/Transform.swift:66— Transform.swift.inversePredictor has cognitive complexity 50 (threshold 15). Drivers by points: loops 11 (36 pts), if/else 5 (10 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 32). 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.
WebPDecoder.decode (cognitive 43) 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:6— WebPDecoder.decode has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (29 pts), match/switch 3 (10 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 25). Of this number, 41 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodePixels (cognitive 38) 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:344— VP8LDecoder.decodePixels has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (10 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Writer.swift.encodeImageData (cognitive 36) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:142— Writer.swift.encodeImageData has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 3 (8 pts), boolean chains 5 (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.
VP8Decoder.parseResiduals4 (cognitive 33) 8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:105— VP8Decoder.parseResiduals4 has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 3 (7 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8Decoder.prepareYBR (cognitive 32) 8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:13— VP8Decoder.prepareYBR has cognitive complexity 32 (threshold 15). Drivers by points: loops 12 (25 pts), if/else 6 (7 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
WebPDecoder.swift.unfilterAlpha (cognitive 30) 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:502— WebPDecoder.swift.unfilterAlpha has cognitive complexity 30 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 4 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
VP8Decoder.reconstructMacroblock (cognitive 26) 8. Complete/Sources/WebP/Decoder/VP8/Residuals.swift:283— VP8Decoder.reconstructMacroblock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (10 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.
VP8Decoder.parsePredModeY4 (cognitive 21) 8. Complete/Sources/WebP/Decoder/VP8/PredictorProbabilities.swift:32— VP8Decoder.parsePredModeY4 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (8 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8Decoder.simpleFilter (cognitive 18) 8. Complete/Sources/WebP/Decoder/VP8/Filter.swift:134— VP8Decoder.simpleFilter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 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. This shape REPEATS in the file: one other method here (VP8Decoder.normalFilter) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
VP8Decoder.normalFilter (cognitive 18) 8. Complete/Sources/WebP/Decoder/VP8/Filter.swift:202— VP8Decoder.normalFilter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 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. This shape REPEATS in the file: one other method here (VP8Decoder.simpleFilter) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HTree.insert (cognitive 17) 8. Complete/Sources/WebP/Decoder/VP8L/Huffman.swift:35— HTree.insert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
VP8LDecoder.decodeCodeLengths (cognitive 17) 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:189— VP8LDecoder.decodeCodeLengths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VP8LDecoder.decodeHuffmanGroups (cognitive 17) 8. Complete/Sources/WebP/Decoder/VP8L/VP8LDecoder.swift:287— VP8LDecoder.decodeHuffmanGroups has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MethodTooLong: WebPDecoder.decode 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:6— MethodTooLong — decode runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Near-duplicate member family (8 members, 40 shared lines) · ×1
Near-duplicate member family (8 members, 40 shared lines) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:175— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:175-227 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:180-232 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:306-358 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:186-238 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:190-242 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:198-250 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:226-278 | 8. Complete/Sources/WebP/Encoder/Writer.swift:536-588 — These 8 members are variants of one another: a block of 40 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7-67 | 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7-67 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7-67 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258-334 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258-334 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258-334 — These 14 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 14 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 14 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) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:131— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:131-148 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:136-153 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:142-159 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:146-163 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:145-162 — 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 (99 corresponding lines) · ×1
Edited copy of a member (99 corresponding lines) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:142— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:142-240 | 8. Complete/Sources/WebP/Encoder/Writer.swift:342-461 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 38+ corresponding lines) · ×1
Edited copies of one member (5 members, 38+ corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:161— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:161-204 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:206-248 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:255-292 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:304-345 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:347-389 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:120— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:120-139 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:141-159 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:428— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:428-442 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift: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 copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:107— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:107-118 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:444-453 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:520-529 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:82— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:82-98 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:470-481 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:548-559 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:81— 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:81-94 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:81-93 — 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) · ×1
Edited copy of a member (12 corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8L/Transform.swift:40— 8. Complete/Sources/WebP/Decoder/VP8L/Transform.swift:40-51 | 8. Complete/Sources/WebP/Decoder/VP8L/Transform.swift:53-64 — 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 copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:455— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:455-461 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:463-468 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:531-537 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:539-546 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (82 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:169-250 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175-256 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175-256 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:175-256 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (77 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:252-328 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258-334 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258-334 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:258-334 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (61–68 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7-67 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7-67 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:7-67 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:14-81 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift` as WHOLE FILES: 97% 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 (59–63 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:78-136 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:80-142 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:80-142 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:80-142 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (56 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/WebPDecoder.swift:11— 1. Prefix Coding/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 2. Subtract Green/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 3. LZ77/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 4. Predictor/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 5. Cross Color/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 6. Color Indexing/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 | 7. Color Cache/Sources/TinyWebP/Decoder/WebPDecoder.swift:11-66 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/WebPDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/WebPDecoder.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (102–103 lines × 2) 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:2— 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:2-104 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:3-104 — before extracting anything, compare `4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:3` 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 (54–59 lines × 2) 6. Color Indexing/Sources/TinyWebP/Encoder/EncodeTransform.swift:6— 6. Color Indexing/Sources/TinyWebP/Encoder/EncodeTransform.swift:6-64 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:254-307 — before extracting anything, compare `6. Color Indexing/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:254` 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 (44 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:48— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:48-91 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (55 lines × 2) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:150— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:150-204 | 8. Complete/Sources/WebP/Encoder/Writer.swift:348-402 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `8. Complete/Sources/WebP/Encoder/Writer.swift:346` calls `Array`, `NRGBA` and `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:148` 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 (32–36 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:172— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:172-207 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:172-207 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:172-207 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:173-208 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:170-201 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (58 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:4— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:4-61 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:4-61 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (30 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:138-167 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:144-173 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:144-173 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:144-173 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:90— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:90-118 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:90-118 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:90-118 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:91-119 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:91-119 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:126— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:126-153 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:126-153 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:126-153 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:127-154 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:127-154 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:127-154 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:127-154 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:126-153 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:98— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:98-123 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:98-123 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:98-123 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:98-123 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:98-123 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:98-123 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:98-123 | 8. Complete/Sources/WebP/Decoder/RIFFReader.swift:92-117 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:32-57 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:34-59 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:34-59 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:34-59 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:34— 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:34-59 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:214-239 — before extracting anything, compare `5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (24 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:23— 1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift:23-46 | 2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift:23-46 | 3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift:23-46 | 4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift:23-46 | 5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift:23-46 | 6. Color Indexing/Sources/TinyWebP/Decoder/RIFFReader.swift:23-46 | 7. Color Cache/Sources/TinyWebP/Decoder/RIFFReader.swift:23-46 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (41 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:85— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:85-125 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:85-125 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:186— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:186-207 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:191-212 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:317-338 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:197-218 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:201-222 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:209-230 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:237-258 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:69— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:69-87 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:69-87 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:69-87 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:70-88 | 8. Complete/Sources/WebP/Encoder/HuffmanCode.swift:70-88 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:175— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:175-193 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:180-198 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:306-324 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:186-204 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:190-208 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:198-216 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:226-244 | 8. Complete/Sources/WebP/Encoder/Writer.swift:537-554 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–19 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:91— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:91-109 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:96-114 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:91-109 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:101-119 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:101-119 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:106-124 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:118-121 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:91` 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 (19 lines × 4) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:155— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:155-173 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:160-178 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:166-184 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:170-188 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:155` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:63— 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:63-81 | 8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:98-116 — 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 `8. Complete/Sources/WebP/Decoder/WebPDecoder.swift:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:42— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:42-59 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:42-59 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:42-59 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:42-59 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:42-59 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:42-59 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:42-59 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 5) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:131— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:131-148 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:136-153 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:142-159 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:146-163 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:145-162 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18–23 lines × 4) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:112— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:112-129 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:116-134 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:122-140 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:122-144 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:112` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 4) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:279— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:279-294 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:176-192 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:202-217 | 8. Complete/Sources/WebP/Encoder/Writer.swift:507-522 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:279` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:242— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:242-257 | 8. Complete/Sources/WebP/Encoder/Writer.swift:463-478 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–16 lines × 2) 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:17— 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:17-30 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:196-211 — before extracting anything, compare `5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:123— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:123-138 | 8. Complete/Sources/WebP/Encoder/Writer.swift:321-335 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:215— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:215-229 | 8. Complete/Sources/WebP/Encoder/Writer.swift:424-438 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `8. Complete/Sources/WebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:215` 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 (73 lines × 2) 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:106— 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:106-178 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:106-178 — before extracting anything, compare `4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 14) 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:51— 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:51-63 | 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:305-317 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:51-63 | 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:305-317 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:51-63 | 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:305-317 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:65-77 | 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:305-317 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:65-77 | 5. Cross Color/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:311-323 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:65-77 | 6. Color Indexing/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:311-323 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:65-77 | 7. Color Cache/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:311-323 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift` and `2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/PrefixCode.swift:51` 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 × 3) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:111— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:111-126 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:122-137 | 8. Complete/Sources/WebP/Encoder/Writer.swift:309-324 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:2— 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:2-13 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:182-192 — before extracting anything, compare `5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:2` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:21— 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:21-31 | 2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift:21-31 | 3. LZ77/Sources/TinyWebP/Encoder/BitWriter.swift:21-31 | 4. Predictor/Sources/TinyWebP/Encoder/BitWriter.swift:21-31 | 5. Cross Color/Sources/TinyWebP/Encoder/BitWriter.swift:21-31 | 6. Color Indexing/Sources/TinyWebP/Encoder/BitWriter.swift:21-31 | 7. Color Cache/Sources/TinyWebP/Encoder/BitWriter.swift:21-31 | 8. Complete/Sources/WebP/Encoder/BitWriter.swift:21-29 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:32` calls `bitString` and `8. Complete/Sources/WebP/Encoder/BitWriter.swift:30` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 4) 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:3— 4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:3-13 | 5. Cross Color/Sources/TinyWebP/Encoder/EncodeTransform.swift:3-13 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:3-13 | 8. Complete/Sources/WebP/Encoder/EncodeTransform.swift:182-192 — before extracting anything, compare `4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift` and `8. Complete/Sources/WebP/Encoder/EncodeTransform.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `4. Predictor/Sources/TinyWebP/Encoder/EncodeTransform.swift:3` 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) 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:230— 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:230-240 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:171-181 | 8. Complete/Sources/WebP/Encoder/Writer.swift:451-461 — before extracting anything, compare `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift` and `7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:230` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:484— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:484-494 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:562-572 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:231— 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:231-240 | 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift:231-240 | 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift:231-240 | 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift:232-241 | 5. Cross Color/Sources/TinyWebP/Encoder/HuffmanCode.swift:236-245 | 6. Color Indexing/Sources/TinyWebP/Encoder/HuffmanCode.swift:232-241 | 7. Color Cache/Sources/TinyWebP/Encoder/HuffmanCode.swift:232-241 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:231` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:433— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:433-442 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:472-481 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:509-518 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:550-559 — 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 `8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:433` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:71— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:71-79 | 8. Complete/Sources/WebP/Encoder/Writer.swift:221-229 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:206— 1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:206-227 | 2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift:211-232 | 3. LZ77/Sources/TinyWebP/Encoder/Writer.swift:337-358 | 4. Predictor/Sources/TinyWebP/Encoder/Writer.swift:217-238 | 5. Cross Color/Sources/TinyWebP/Encoder/Writer.swift:221-242 | 6. Color Indexing/Sources/TinyWebP/Encoder/Writer.swift:229-250 | 7. Color Cache/Sources/TinyWebP/Encoder/Writer.swift:257-278 | 8. Complete/Sources/WebP/Encoder/Writer.swift:567-588 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Writer.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Writer.swift:206` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (2–9 lines × 14) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:40— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:40-41 | 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:42-50 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:40-41 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:42-50 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:40-41 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:42-50 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:40-41 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:42-50 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:40-41 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:42-50 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:40-41 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:42-50 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:40-41 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:42-50 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:42` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 8) 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:6— 1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 3. LZ77/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 4. Predictor/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 5. Cross Color/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 6. Color Indexing/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 7. Color Cache/Sources/TinyWebP/Encoder/BitWriter.swift:6-13 | 8. Complete/Sources/WebP/Encoder/BitWriter.swift:6-13 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/BitWriter.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/BitWriter.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:127— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:127-141 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:127-141 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:76— 1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 3. LZ77/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 4. Predictor/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 5. Cross Color/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 6. Color Indexing/Sources/TinyWebP/Encoder/Debug.swift:76-83 | 7. Color Cache/Sources/TinyWebP/Encoder/Debug.swift:76-83 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/Debug.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/Debug.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:83— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:83-89 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:429-435 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:505-511 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:113— 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:113-118 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:448-453 | 8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:524-529 — 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 `8. Complete/Sources/WebP/Decoder/VP8/PredictorModes.swift:113` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 7) 1. Prefix Coding/Sources/TinyWebP/Encoder/NRGBA.swift:7— 1. Prefix Coding/Sources/TinyWebP/Encoder/NRGBA.swift:7-12 | 2. Subtract Green/Sources/TinyWebP/Encoder/NRGBA.swift:7-12 | 3. LZ77/Sources/TinyWebP/Encoder/NRGBA.swift:7-12 | 4. Predictor/Sources/TinyWebP/Encoder/NRGBA.swift:7-12 | 5. Cross Color/Sources/TinyWebP/Encoder/NRGBA.swift:7-12 | 6. Color Indexing/Sources/TinyWebP/Encoder/NRGBA.swift:7-12 | 7. Color Cache/Sources/TinyWebP/Encoder/NRGBA.swift:7-12 — before extracting anything, compare `1. Prefix Coding/Sources/TinyWebP/Encoder/NRGBA.swift` and `2. Subtract Green/Sources/TinyWebP/Encoder/NRGBA.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
Minor — 9 finding(s)
P10 · Library API & versioning· No explicit versioning · ×3
No explicit versioning 1. Prefix Coding/Package.swift— No explicit version was found for the SwiftPM library declared by `Package.swift`. This check read nothing in Package.swift, which has no version field, and a CHANGELOG/CHANGES/HISTORY/NEWS/RELEASES file with a semver heading, or release tooling (changesets, release-please, semantic-release, goreleaser, cargo-release, bump2version, standard-version, git-cliff) in the library's directory or at the repository root, or a semver release tag (or a Drupal `8.x-1.2` release tag) in the repository. A version computed where none of those can see is invisible here. A published library needs explicit semantic versioning so consumers can reason about breaking changes.
No explicit versioning 2. Subtract Green/Package.swift— No explicit version was found for the SwiftPM library declared by `Package.swift`. This check read nothing in Package.swift, which has no version field, and a CHANGELOG/CHANGES/HISTORY/NEWS/RELEASES file with a semver heading, or release tooling (changesets, release-please, semantic-release, goreleaser, cargo-release, bump2version, standard-version, git-cliff) in the library's directory or at the repository root, or a semver release tag (or a Drupal `8.x-1.2` release tag) in the repository. A version computed where none of those can see is invisible here. A published library needs explicit semantic versioning so consumers can reason about breaking changes.
No explicit versioning 3. LZ77/Package.swift— No explicit version was found for the SwiftPM library declared by `Package.swift`. This check read nothing in Package.swift, which has no version field, and a CHANGELOG/CHANGES/HISTORY/NEWS/RELEASES file with a semver heading, or release tooling (changesets, release-please, semantic-release, goreleaser, cargo-release, bump2version, standard-version, git-cliff) in the library's directory or at the repository root, or a semver release tag (or a Drupal `8.x-1.2` release tag) in the repository. A version computed where none of those can see is invisible here. A published library needs explicit semantic versioning so consumers can reason about breaking changes.
Duplicated predicate 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:75— `l < a.count && a[l].weight < a[m].weight` appears character-identically in 8 files — 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift, 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift, 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift, 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift. 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 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift:318— `nodes[idx].left != nil || nodes[idx].right != nil` appears character-identically in 7 files — 1. Prefix Coding/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift, 2. Subtract Green/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift, 3. LZ77/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift, 4. Predictor/Sources/TinyWebP/Decoder/VP8L/VP8LDecoder.swift. 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 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift:78— `r < a.count && a[r].weight < a[m].weight` appears character-identically in 8 files — 1. Prefix Coding/Sources/TinyWebP/Encoder/HuffmanCode.swift, 2. Subtract Green/Sources/TinyWebP/Encoder/HuffmanCode.swift, 3. LZ77/Sources/TinyWebP/Encoder/HuffmanCode.swift, 4. Predictor/Sources/TinyWebP/Encoder/HuffmanCode.swift. 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.
Documentation: no build, run or usage example 8. Complete/README.md:1— `8. Complete` is a published Swift package (a `.library` product) and neither `8. Complete/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Thin README README.md:1— The root README is 2 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 11 file(s) — `1. Prefix Coding/Sources/TinyWebP/Decoder/RIFFReader.swift`, `2. Subtract Green/Sources/TinyWebP/Decoder/RIFFReader.swift`, `3. LZ77/Sources/TinyWebP/Decoder/RIFFReader.swift`, `4. Predictor/Sources/TinyWebP/Decoder/RIFFReader.swift`, `5. Cross Color/Sources/TinyWebP/Decoder/RIFFReader.swift`, … (+6 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
0
—
Run 01a1ea0e-238c-7a10-a59e-7d19e3ee3a68 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Warnings: 232 · Recommendations: 9 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 15:09 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.