Public report of HaishinKit/HaishinKit.swift, published 14 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, 14 November 2026, 22:41 UTC · Survey ID cd_2d7a79d227b844ec8051b8639219d9c9
HaishinKit/HaishinKit.swift
Measured 14 November 2026, 22:40 UTC, at code version 765a6ec
CAI scoreStrong
CriticalWeakAdequateStrongExemplary
Down 5 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 26,346 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Code Health, 64
Findings by how serious they are
4 critical192 serious11 minor
17 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 22:40 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 ▸
36of 36 dimensions measured by tools.
200of 207 findings point to an exact file and line, so you can open each one in the code. The other 7 concern the repository as a whole, such as missing documentation.
36dimensions across 6 lenses, read from 26,346 lines of product code in 5 projects.
HaishinKit/HaishinKit.swift meets our standard for a template or a sample. It scores 70 out of 100 and is rated Strong, and all four of its critical findings are security problems.
Every lens scores high enough to be rated Strong, so no single lens holds the score back. The best first step is adopting a type checker, worth about 5 points. Adding automated security scanning comes next, worth about 2 points.
Two weaknesses in the code could be used by an attacker. One automatic update takes new releases before a bad one can be spotted, and one known security hole in a package the code depends on can be used by attackers. Fixing the weaknesses the scanner points to, setting a waiting period for automatic updates and updating the vulnerable packages would close these risks.
The product code is 26,346 lines, about €39,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.
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 28 findings
These 28 critical or serious findings were in the previous survey, on 28 October 2026, and are gone from this one.
Supply-chain Provenance & Signing · Workflow holding a long-lived secret is unscoped .github/workflows/release.yml
Supply-chain Provenance & Signing · PR-triggered workflow without a permissions block .github/workflows/review.yml
Rebuild cost: about €39,000 · Estimate
Cost to rebuild
€13,000 to €64,000, for 214 to 678 hours of work, about 0.3 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
×1.0 at a score of 70. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 26,346 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
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`.
Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Bring the 29 bodies over 15 down to 15 or less in Cognitive Complexity — start with MoQTConnection.receiveStream (cognitive 51), StreamRecorder.makeWriterInput (cognitive 48), RTMPConnection.connect (cognitive 44).
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 €39,000 to build again, about 0.3 person-years of work. Its weakest lens is Code Health, at 64 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 7,735 lines over the last 90 days, which is about 31,370 lines a year. At that pace, the extra work comes to an estimated 1.6 to 10.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
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.
31 modules, with 87 dependencies between them. 2 loops run through 13 of the modules, marked above the diagonal.
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.
HaishinKit~ISO uses HaishinKit~Extension, so a change to HaishinKit~Extension can break HaishinKit~ISO, while a change to HaishinKit~ISO can't break HaishinKit~Extension.
Position
Below the diagonal: HaishinKit~ISO uses a module listed above it, which is the healthy direction.
11→17 HaishinKit~ISO uses SRTHaishinKit~TSpart of a loop✕
Connections
1 pair of types, where a type in HaishinKit~ISO uses a type in SRTHaishinKit~TS.
HaishinKit~ISO uses SRTHaishinKit~TS, so a change to SRTHaishinKit~TS can break HaishinKit~ISO, while a change to HaishinKit~ISO can't break SRTHaishinKit~TS.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→19 HaishinKit~ISO uses SRTHaishinKit~Extensionpart of a loop✕
Connections
4 pairs of types, where a type in HaishinKit~ISO uses a type in SRTHaishinKit~Extension.
HaishinKit~ISO uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break HaishinKit~ISO, while a change to HaishinKit~ISO can't break SRTHaishinKit~Extension.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
HaishinKit~Session uses HaishinKit~Network, so a change to HaishinKit~Network can break HaishinKit~Session, while a change to HaishinKit~Session can't break HaishinKit~Network.
Position
Below the diagonal: HaishinKit~Session uses a module listed above it, which is the healthy direction.
HaishinKit~Session uses RTMPHaishinKit~Extension, so a change to RTMPHaishinKit~Extension can break HaishinKit~Session, while a change to HaishinKit~Session can't break RTMPHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Session uses a module listed above it, which is the healthy direction.
12→24 HaishinKit~Session uses HaishinKit~Streampart of a loop✕
Connections
1 pair of types, where a type in HaishinKit~Session uses a type in HaishinKit~Stream.
HaishinKit~Session uses HaishinKit~Stream, so a change to HaishinKit~Stream can break HaishinKit~Session, while a change to HaishinKit~Session can't break HaishinKit~Stream.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
MoQTHaishinKit~ControlMessage uses HaishinKit~Extension, so a change to HaishinKit~Extension can break MoQTHaishinKit~ControlMessage, while a change to MoQTHaishinKit~ControlMessage can't break HaishinKit~Extension.
Position
Below the diagonal: MoQTHaishinKit~ControlMessage uses a module listed above it, which is the healthy direction.
13→18 MoQTHaishinKit~ControlMessage uses MoQTHaishinKitpart of a loop✕
Connections
18 pairs of types, where a type in MoQTHaishinKit~ControlMessage uses a type in MoQTHaishinKit.
MoQTHaishinKit~ControlMessage uses MoQTHaishinKit, so a change to MoQTHaishinKit can break MoQTHaishinKit~ControlMessage, while a change to MoQTHaishinKit~ControlMessage can't break MoQTHaishinKit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
RTMPHaishinKit~AMF uses HaishinKit~Extension, so a change to HaishinKit~Extension can break RTMPHaishinKit~AMF, while a change to RTMPHaishinKit~AMF can't break HaishinKit~Extension.
Position
Below the diagonal: RTMPHaishinKit~AMF uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~Util uses HaishinKit~Extension, so a change to HaishinKit~Extension can break RTMPHaishinKit~Util, while a change to RTMPHaishinKit~Util can't break HaishinKit~Extension.
Position
Below the diagonal: RTMPHaishinKit~Util uses a module listed above it, which is the healthy direction.
MoQTHaishinKit~DataStream uses HaishinKit~Extension, so a change to HaishinKit~Extension can break MoQTHaishinKit~DataStream, while a change to MoQTHaishinKit~DataStream can't break HaishinKit~Extension.
Position
Below the diagonal: MoQTHaishinKit~DataStream uses a module listed above it, which is the healthy direction.
MoQTHaishinKit~DataStream uses MoQTHaishinKit~ControlMessage, so a change to MoQTHaishinKit~ControlMessage can break MoQTHaishinKit~DataStream, while a change to MoQTHaishinKit~DataStream can't break MoQTHaishinKit~ControlMessage.
Position
Below the diagonal: MoQTHaishinKit~DataStream uses a module listed above it, which is the healthy direction.
16→18 MoQTHaishinKit~DataStream uses MoQTHaishinKitpart of a loop✕
Connections
3 pairs of types, where a type in MoQTHaishinKit~DataStream uses a type in MoQTHaishinKit.
MoQTHaishinKit~DataStream uses MoQTHaishinKit, so a change to MoQTHaishinKit can break MoQTHaishinKit~DataStream, while a change to MoQTHaishinKit~DataStream can't break MoQTHaishinKit.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
31 pairs of types, where a type in SRTHaishinKit~TS uses a type in HaishinKit~Extension. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SRTHaishinKit~TS uses HaishinKit~Extension, so a change to HaishinKit~Extension can break SRTHaishinKit~TS, while a change to SRTHaishinKit~TS can't break HaishinKit~Extension.
Position
Below the diagonal: SRTHaishinKit~TS uses a module listed above it, which is the healthy direction.
SRTHaishinKit~TS uses HaishinKit~ISO, so a change to HaishinKit~ISO can break SRTHaishinKit~TS, while a change to SRTHaishinKit~TS can't break HaishinKit~ISO.
Position
Below the diagonal: SRTHaishinKit~TS uses a module listed above it, which is the healthy direction.
17→19 SRTHaishinKit~TS uses SRTHaishinKit~Extensionpart of a loop✕
Connections
3 pairs of types, where a type in SRTHaishinKit~TS uses a type in SRTHaishinKit~Extension.
SRTHaishinKit~TS uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break SRTHaishinKit~TS, while a change to SRTHaishinKit~TS can't break SRTHaishinKit~Extension.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→27 SRTHaishinKit~TS uses HaishinKit~Codecpart of a loop✕
Connections
1 pair of types, where a type in SRTHaishinKit~TS uses a type in HaishinKit~Codec.
SRTHaishinKit~TS uses HaishinKit~Codec, so a change to HaishinKit~Codec can break SRTHaishinKit~TS, while a change to SRTHaishinKit~TS can't break HaishinKit~Codec.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
MoQTHaishinKit uses HaishinKit~Extension, so a change to HaishinKit~Extension can break MoQTHaishinKit, while a change to MoQTHaishinKit can't break HaishinKit~Extension.
Position
Below the diagonal: MoQTHaishinKit uses a module listed above it, which is the healthy direction.
MoQTHaishinKit uses MoQTHaishinKit~ControlMessage, so a change to MoQTHaishinKit~ControlMessage can break MoQTHaishinKit, while a change to MoQTHaishinKit can't break MoQTHaishinKit~ControlMessage.
Position
Below the diagonal: MoQTHaishinKit uses a module listed above it, which is the healthy direction.
MoQTHaishinKit uses MoQTHaishinKit~DataStream, so a change to MoQTHaishinKit~DataStream can break MoQTHaishinKit, while a change to MoQTHaishinKit can't break MoQTHaishinKit~DataStream.
Position
Below the diagonal: MoQTHaishinKit uses a module listed above it, which is the healthy direction.
SRTHaishinKit~Extension uses SRTHaishinKit~TS, so a change to SRTHaishinKit~TS can break SRTHaishinKit~Extension, while a change to SRTHaishinKit~Extension can't break SRTHaishinKit~TS.
Position
Below the diagonal: SRTHaishinKit~Extension uses a module listed above it, which is the healthy direction.
HaishinKit~Util uses HaishinKit~Extension, so a change to HaishinKit~Extension can break HaishinKit~Util, while a change to HaishinKit~Util can't break HaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Util uses a module listed above it, which is the healthy direction.
HaishinKit~Util uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break HaishinKit~Util, while a change to HaishinKit~Util can't break SRTHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Util uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTP uses HaishinKit~Extension, so a change to HaishinKit~Extension can break RTCHaishinKit~RTP, while a change to RTCHaishinKit~RTP can't break HaishinKit~Extension.
Position
Below the diagonal: RTCHaishinKit~RTP uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTP uses HaishinKit~ISO, so a change to HaishinKit~ISO can break RTCHaishinKit~RTP, while a change to RTCHaishinKit~RTP can't break HaishinKit~ISO.
Position
Below the diagonal: RTCHaishinKit~RTP uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTP uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break RTCHaishinKit~RTP, while a change to RTCHaishinKit~RTP can't break SRTHaishinKit~Extension.
Position
Below the diagonal: RTCHaishinKit~RTP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~Codec uses HaishinKit~Extension, so a change to HaishinKit~Extension can break RTMPHaishinKit~Codec, while a change to RTMPHaishinKit~Codec can't break HaishinKit~Extension.
Position
Below the diagonal: RTMPHaishinKit~Codec uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~Codec uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break RTMPHaishinKit~Codec, while a change to RTMPHaishinKit~Codec can't break SRTHaishinKit~Extension.
Position
Below the diagonal: RTMPHaishinKit~Codec uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in RTMPHaishinKit~RTMP uses a type in HaishinKit~Extension. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
RTMPHaishinKit~RTMP uses HaishinKit~Extension, so a change to HaishinKit~Extension can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break HaishinKit~Extension.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~RTMP uses HaishinKit~Network, so a change to HaishinKit~Network can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break HaishinKit~Network.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~RTMP uses RTMPHaishinKit~Extension, so a change to RTMPHaishinKit~Extension can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break RTMPHaishinKit~Extension.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~RTMP uses HaishinKit~Session, so a change to HaishinKit~Session can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break HaishinKit~Session.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~RTMP uses RTMPHaishinKit~AMF, so a change to RTMPHaishinKit~AMF can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break RTMPHaishinKit~AMF.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~RTMP uses RTMPHaishinKit~Util, so a change to RTMPHaishinKit~Util can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break RTMPHaishinKit~Util.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~RTMP uses MoQTHaishinKit, so a change to MoQTHaishinKit can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break MoQTHaishinKit.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
RTMPHaishinKit~RTMP uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break SRTHaishinKit~Extension.
Position
Below the diagonal: RTMPHaishinKit~RTMP uses a module listed above it, which is the healthy direction.
23→24 RTMPHaishinKit~RTMP uses HaishinKit~Streampart of a loop✕
Connections
5 pairs of types, where a type in RTMPHaishinKit~RTMP uses a type in HaishinKit~Stream.
RTMPHaishinKit~RTMP uses HaishinKit~Stream, so a change to HaishinKit~Stream can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break HaishinKit~Stream.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→26 RTMPHaishinKit~RTMP uses HaishinKit~Mixerpart of a loop✕
Connections
1 pair of types, where a type in RTMPHaishinKit~RTMP uses a type in HaishinKit~Mixer.
RTMPHaishinKit~RTMP uses HaishinKit~Mixer, so a change to HaishinKit~Mixer can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break HaishinKit~Mixer.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→27 RTMPHaishinKit~RTMP uses HaishinKit~Codecpart of a loop✕
Connections
2 pairs of types, where a type in RTMPHaishinKit~RTMP uses a type in HaishinKit~Codec.
RTMPHaishinKit~RTMP uses HaishinKit~Codec, so a change to HaishinKit~Codec can break RTMPHaishinKit~RTMP, while a change to RTMPHaishinKit~RTMP can't break HaishinKit~Codec.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26 pairs of types, where a type in HaishinKit~Stream uses a type in HaishinKit~Extension. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
HaishinKit~Stream uses HaishinKit~Extension, so a change to HaishinKit~Extension can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break HaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Stream uses a module listed above it, which is the healthy direction.
HaishinKit~Stream uses HaishinKit~Network, so a change to HaishinKit~Network can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break HaishinKit~Network.
Position
Below the diagonal: HaishinKit~Stream uses a module listed above it, which is the healthy direction.
HaishinKit~Stream uses RTMPHaishinKit~Extension, so a change to RTMPHaishinKit~Extension can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break RTMPHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Stream uses a module listed above it, which is the healthy direction.
HaishinKit~Stream uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break SRTHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Stream uses a module listed above it, which is the healthy direction.
HaishinKit~Stream uses HaishinKit~Util, so a change to HaishinKit~Util can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break HaishinKit~Util.
Position
Below the diagonal: HaishinKit~Stream uses a module listed above it, which is the healthy direction.
HaishinKit~Stream uses RTMPHaishinKit~RTMP, so a change to RTMPHaishinKit~RTMP can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break RTMPHaishinKit~RTMP.
Position
Below the diagonal: HaishinKit~Stream uses a module listed above it, which is the healthy direction.
24→25 HaishinKit~Stream uses HaishinKit~Screenpart of a loop✕
Connections
1 pair of types, where a type in HaishinKit~Stream uses a type in HaishinKit~Screen.
HaishinKit~Stream uses HaishinKit~Screen, so a change to HaishinKit~Screen can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break HaishinKit~Screen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→26 HaishinKit~Stream uses HaishinKit~Mixerpart of a loop✕
Connections
2 pairs of types, where a type in HaishinKit~Stream uses a type in HaishinKit~Mixer.
HaishinKit~Stream uses HaishinKit~Mixer, so a change to HaishinKit~Mixer can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break HaishinKit~Mixer.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→27 HaishinKit~Stream uses HaishinKit~Codecpart of a loop✕
Connections
10 pairs of types, where a type in HaishinKit~Stream uses a type in HaishinKit~Codec.
HaishinKit~Stream uses HaishinKit~Codec, so a change to HaishinKit~Codec can break HaishinKit~Stream, while a change to HaishinKit~Stream can't break HaishinKit~Codec.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
HaishinKit~Screen uses HaishinKit~Extension, so a change to HaishinKit~Extension can break HaishinKit~Screen, while a change to HaishinKit~Screen can't break HaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Screen uses a module listed above it, which is the healthy direction.
HaishinKit~Screen uses RTMPHaishinKit~Extension, so a change to RTMPHaishinKit~Extension can break HaishinKit~Screen, while a change to HaishinKit~Screen can't break RTMPHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Screen uses a module listed above it, which is the healthy direction.
HaishinKit~Screen uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break HaishinKit~Screen, while a change to HaishinKit~Screen can't break SRTHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Screen uses a module listed above it, which is the healthy direction.
HaishinKit~Screen uses HaishinKit~Util, so a change to HaishinKit~Util can break HaishinKit~Screen, while a change to HaishinKit~Screen can't break HaishinKit~Util.
Position
Below the diagonal: HaishinKit~Screen uses a module listed above it, which is the healthy direction.
HaishinKit~Screen uses HaishinKit~Stream, so a change to HaishinKit~Stream can break HaishinKit~Screen, while a change to HaishinKit~Screen can't break HaishinKit~Stream.
Position
Below the diagonal: HaishinKit~Screen uses a module listed above it, which is the healthy direction.
25→26 HaishinKit~Screen uses HaishinKit~Mixerpart of a loop✕
Connections
3 pairs of types, where a type in HaishinKit~Screen uses a type in HaishinKit~Mixer.
HaishinKit~Screen uses HaishinKit~Mixer, so a change to HaishinKit~Mixer can break HaishinKit~Screen, while a change to HaishinKit~Screen can't break HaishinKit~Mixer.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
50 pairs of types, where a type in HaishinKit~Mixer uses a type in HaishinKit~Extension. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
HaishinKit~Mixer uses HaishinKit~Extension, so a change to HaishinKit~Extension can break HaishinKit~Mixer, while a change to HaishinKit~Mixer can't break HaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Mixer uses a module listed above it, which is the healthy direction.
HaishinKit~Mixer uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break HaishinKit~Mixer, while a change to HaishinKit~Mixer can't break SRTHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Mixer uses a module listed above it, which is the healthy direction.
HaishinKit~Mixer uses HaishinKit~Util, so a change to HaishinKit~Util can break HaishinKit~Mixer, while a change to HaishinKit~Mixer can't break HaishinKit~Util.
Position
Below the diagonal: HaishinKit~Mixer uses a module listed above it, which is the healthy direction.
HaishinKit~Mixer uses HaishinKit~Screen, so a change to HaishinKit~Screen can break HaishinKit~Mixer, while a change to HaishinKit~Mixer can't break HaishinKit~Screen.
Position
Below the diagonal: HaishinKit~Mixer uses a module listed above it, which is the healthy direction.
HaishinKit~Codec uses HaishinKit~Extension, so a change to HaishinKit~Extension can break HaishinKit~Codec, while a change to HaishinKit~Codec can't break HaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Codec uses a module listed above it, which is the healthy direction.
HaishinKit~Codec uses SRTHaishinKit~Extension, so a change to SRTHaishinKit~Extension can break HaishinKit~Codec, while a change to HaishinKit~Codec can't break SRTHaishinKit~Extension.
Position
Below the diagonal: HaishinKit~Codec uses a module listed above it, which is the healthy direction.
HaishinKit~Codec uses HaishinKit~Util, so a change to HaishinKit~Util can break HaishinKit~Codec, while a change to HaishinKit~Codec can't break HaishinKit~Util.
Position
Below the diagonal: HaishinKit~Codec uses a module listed above it, which is the healthy direction.
HaishinKit~Codec uses HaishinKit~Mixer, so a change to HaishinKit~Mixer can break HaishinKit~Codec, while a change to HaishinKit~Codec can't break HaishinKit~Mixer.
Position
Below the diagonal: HaishinKit~Codec uses a module listed above it, which is the healthy direction.
HaishinKit~View uses HaishinKit~Extension, so a change to HaishinKit~Extension can break HaishinKit~View, while a change to HaishinKit~View can't break HaishinKit~Extension.
Position
Below the diagonal: HaishinKit~View uses a module listed above it, which is the healthy direction.
HaishinKit~View uses RTMPHaishinKit~Util, so a change to RTMPHaishinKit~Util can break HaishinKit~View, while a change to HaishinKit~View can't break RTMPHaishinKit~Util.
Position
Below the diagonal: HaishinKit~View uses a module listed above it, which is the healthy direction.
HaishinKit~View uses HaishinKit~Stream, so a change to HaishinKit~Stream can break HaishinKit~View, while a change to HaishinKit~View can't break HaishinKit~Stream.
Position
Below the diagonal: HaishinKit~View uses a module listed above it, which is the healthy direction.
HaishinKit~View uses HaishinKit~Screen, so a change to HaishinKit~Screen can break HaishinKit~View, while a change to HaishinKit~View can't break HaishinKit~Screen.
Position
Below the diagonal: HaishinKit~View uses a module listed above it, which is the healthy direction.
HaishinKit~View uses HaishinKit~Mixer, so a change to HaishinKit~Mixer can break HaishinKit~View, while a change to HaishinKit~View can't break HaishinKit~Mixer.
Position
Below the diagonal: HaishinKit~View uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTC uses HaishinKit~Extension, so a change to HaishinKit~Extension can break RTCHaishinKit~RTC, while a change to RTCHaishinKit~RTC can't break HaishinKit~Extension.
Position
Below the diagonal: RTCHaishinKit~RTC uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTC uses HaishinKit~Network, so a change to HaishinKit~Network can break RTCHaishinKit~RTC, while a change to RTCHaishinKit~RTC can't break HaishinKit~Network.
Position
Below the diagonal: RTCHaishinKit~RTC uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTC uses RTCHaishinKit~SDP, so a change to RTCHaishinKit~SDP can break RTCHaishinKit~RTC, while a change to RTCHaishinKit~RTC can't break RTCHaishinKit~SDP.
Position
Below the diagonal: RTCHaishinKit~RTC uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTC uses RTCHaishinKit~RTP, so a change to RTCHaishinKit~RTP can break RTCHaishinKit~RTC, while a change to RTCHaishinKit~RTC can't break RTCHaishinKit~RTP.
Position
Below the diagonal: RTCHaishinKit~RTC uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTC uses HaishinKit~Stream, so a change to HaishinKit~Stream can break RTCHaishinKit~RTC, while a change to RTCHaishinKit~RTC can't break HaishinKit~Stream.
Position
Below the diagonal: RTCHaishinKit~RTC uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTC uses HaishinKit~Mixer, so a change to HaishinKit~Mixer can break RTCHaishinKit~RTC, while a change to RTCHaishinKit~RTC can't break HaishinKit~Mixer.
Position
Below the diagonal: RTCHaishinKit~RTC uses a module listed above it, which is the healthy direction.
RTCHaishinKit~RTC uses HaishinKit~Codec, so a change to HaishinKit~Codec can break RTCHaishinKit~RTC, while a change to RTCHaishinKit~RTC can't break HaishinKit~Codec.
Position
Below the diagonal: RTCHaishinKit~RTC uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses HaishinKit~Extension, so a change to HaishinKit~Extension can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break HaishinKit~Extension.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses HaishinKit~Network, so a change to HaishinKit~Network can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break HaishinKit~Network.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses RTMPHaishinKit~Extension, so a change to RTMPHaishinKit~Extension can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break RTMPHaishinKit~Extension.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses SRTHaishinKit~Util, so a change to SRTHaishinKit~Util can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break SRTHaishinKit~Util.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses HaishinKit~Session, so a change to HaishinKit~Session can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break HaishinKit~Session.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses SRTHaishinKit~TS, so a change to SRTHaishinKit~TS can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break SRTHaishinKit~TS.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses HaishinKit~Stream, so a change to HaishinKit~Stream can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break HaishinKit~Stream.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses HaishinKit~Mixer, so a change to HaishinKit~Mixer can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break HaishinKit~Mixer.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
SRTHaishinKit~SRT uses HaishinKit~Codec, so a change to HaishinKit~Codec can break SRTHaishinKit~SRT, while a change to SRTHaishinKit~SRT can't break HaishinKit~Codec.
Position
Below the diagonal: SRTHaishinKit~SRT uses a module listed above it, which is the healthy direction.
RTCHaishinKit~HTTP uses RTMPHaishinKit~Extension, so a change to RTMPHaishinKit~Extension can break RTCHaishinKit~HTTP, while a change to RTCHaishinKit~HTTP can't break RTMPHaishinKit~Extension.
Position
Below the diagonal: RTCHaishinKit~HTTP uses a module listed above it, which is the healthy direction.
RTCHaishinKit~HTTP uses HaishinKit~Session, so a change to HaishinKit~Session can break RTCHaishinKit~HTTP, while a change to RTCHaishinKit~HTTP can't break HaishinKit~Session.
Position
Below the diagonal: RTCHaishinKit~HTTP uses a module listed above it, which is the healthy direction.
RTCHaishinKit~HTTP uses HaishinKit~Stream, so a change to HaishinKit~Stream can break RTCHaishinKit~HTTP, while a change to RTCHaishinKit~HTTP can't break HaishinKit~Stream.
Position
Below the diagonal: RTCHaishinKit~HTTP uses a module listed above it, which is the healthy direction.
RTCHaishinKit~HTTP uses RTCHaishinKit~RTC, so a change to RTCHaishinKit~RTC can break RTCHaishinKit~HTTP, while a change to RTCHaishinKit~HTTP can't break RTCHaishinKit~RTC.
Position
Below the diagonal: RTCHaishinKit~HTTP uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 64% · Adequate · gated by X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
7
High / Critical
A03:2025 — Software Supply Chain Failures
5
High / Critical
Roadmap
Top priorities: Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive; Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing; Bring the 29 bodies over 15 down to 15 or less in Cognitive Complexity — start with MoQTConnection.receiveStream (cognitive 51), StreamRecorder.makeWriterInput (cognitive 48), RTMPConnection.connect (cognitive 44).
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Bring the 29 bodies over 15 down to 15 or less in Cognitive Complexity — start with MoQTConnection.receiveStream (cognitive 51), StreamRecorder.makeWriterInput (cognitive 48), RTMPConnection.connect (cognitive 44).
Bring the 15 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with RTMPConnection.connect (cyclomatic 27), MoQTConnection.receiveStream (cyclomatic 25), MoQTConnection.drainRequest (cyclomatic 25).
Resolve the 14 No assertions finding(s) in Test Quality — start with AudioRingBufferTests.swift (4), AudioCodecTests.swift (2), AudioMixerTrackTests.swift (2).
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 — 4
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 — 192
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 — 11
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 17
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 36 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 — 36 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, 200 of 207 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.swift) and this repository declares a SwiftPM test suite (HaishinKit), 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.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (91 contributor(s) across 3114 commit(s) sampled, automation and bot accounts excluded). One of them holds 91% of the history; the other 90 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): 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.
D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (23140 LoC, 406 module-visible types across 30 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
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. `Examples/iOS/PlaybackView.swift`, `Examples/iOS/PlaybackViewModel.swift`, `Examples/iOS/PreferenceView.swift`, `Examples/iOS/PublishView.swift`, `Examples/iOS/PublishViewModel.swift`, … (+54 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.
AX1 Captive dependencies — 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in HaishinKit/Sources/Session/StreamSessionBuilderFactory.swift, whose lifetimes are not modelled 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.
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 and Scala source only, and this repository's Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
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.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
15 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was RTMPConnection.connect at 27. A further 10 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being Name.init at 53 — they are counted neither in the figure above nor in this dimension's score. 8 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: SRTHaishinKit/Sources/SRT/SRTSocketOption.Name.swift (Name.init at 53), DebugDescription/AVAudioFormat+DebugExtension.swift (AudioFormatID.debugDescription at 40), RTMPHaishinKit/Sources/RTMP/RTMPStream.swift (Code.level at 40), DebugDescription/AudioStreamBasicDescription+DebugExtension.swift (AudioStreamBasicDescription.readableFormatID at 38), DebugDescription/AudioNode+DebugExtension.swift (AudioUnitParameter.unitName at 29), and 3 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 15 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with RTMPConnection.connect (cyclomatic 27), MoQTConnection.receiveStream (cyclomatic 25), MoQTConnection.drainRequest (cyclomatic 25). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 15 together lifts Cyclomatic Complexity from 8.2 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.
+ 24 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 29 bodies over 15 down to 15 or less in Cognitive Complexity — start with MoQTConnection.receiveStream (cognitive 51), StreamRecorder.makeWriterInput (cognitive 48), RTMPConnection.connect (cognitive 44). — 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 29 together lifts Cognitive Complexity from 6.7 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.9 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 4 TooManyMethods finding(s) in God Classes — start with ByteArray.swift (3), MoQTConnection.swift. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 2 FileTooLong finding(s) in God Classes — start with MoQTConnection.swift, RTMPStream.swift. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 MethodTooLong finding(s) in God Classes — start with SRTSocketOption.Name.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.
60 duplicated block group(s) detected. 8.9 % of the production lines (2,350 of 26,346) are in a reported copy. A further 44 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 21 of the 104 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
Edited copy of a member (10 corresponding lines) · ×4REDACTED:90
+ 51 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 Duplicated block (7 lines × 3) finding(s) in Code Duplication — start with ByteArray.swift (10), MoQTFetch.swift. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 5 Edited copy of a member (12 corresponding lines) finding(s) in Code Duplication — start with AudioNode.swift (3), RTCStream.swift, SRTSocketOption.swift. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 5 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with AudioCaptureUnit.swift (2), HEVCDecoderConfigurationRecord.swift, MTHKView.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 · Coupling8.4 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
5 production modules (SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.
Off the main sequence: HaishinKit
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 13 Low cohesion finding(s) in Cohesion (LCOM4) — start with CaptureSession.swift (2), HTTPSession.swift, MTHKView.swift. — One of this dimension's main actionable groups (13 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality8.9 / 10Strong✓ 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.
0 skipped, 17 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 185 tests (1 harness-style project(s) excluded from the assertion penalty).
No assertions: aac_44100hz_step_1224 · ×14HaishinKit/Tests/Codec/AudioCodecTests.swift:74
No direct assertions: rejectsInvalidURL · ×3HaishinKit/Tests/Session/StreamSessionBuilderFactoryTests.swift:31
What to do
Resolve the 14 No assertions finding(s) in Test Quality — start with AudioRingBufferTests.swift (4), AudioCodecTests.swift (2), AudioMixerTrackTests.swift (2). — One of this dimension's main actionable groups (14 warning-level).
Resolve the 3 No direct assertions finding(s) in Test Quality — start with StreamSessionBuilderFactoryTests.swift (3). — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
1 outdated direct SwiftPM dependencies, 0 pinning defect(s). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
Outdated: swift-docc-plugin
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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 154 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 154 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed REDACTED. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. 2 of them publish no licence on rubygems.org; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 1 Hotspot finding(s) in Churn × Complexity Hotspots — start with RTMPConnection.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
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 26346 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: 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.
25 % of calls cross a namespace and 5 % 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).
7 finding(s): 0 critical, 3 high, 4 medium, 0 low. semgrep hit a parse error in 5 file(s) — `Examples/iOS/PublishViewModel.swift`, `HaishinKit/Tests/Asset/SampleVideo_360x240_5mb/001.ts` (line 1), `HaishinKit/Tests/Asset/SampleVideo_360x240_5mb/003.ts` (line 1), `HaishinKit/Tests/Asset/SampleVideo_360x240_5mb/004.ts` (line 1), `HaishinKit/Tests/Asset/SampleVideo_360x240_5mb_2ch.ts` (line 1) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no REDACTED is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 107 of the 245 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 3 Change coupling finding(s) in Change Coupling — start with VTSessionMode.swift, MTHKView.swift, DeviceUnit.swift. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 7 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. 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.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
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) as a CI step. What was searched, so you can tell an absence from a miss: the 5 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. — .github/workflows/merged-pr-milestone.yml:3
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Other · Code Health — Whether 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.
Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
What to do
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
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 — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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
Not included — 77 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 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
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state between request threads. 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 class or module declares an abstract method
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — 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
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — D19 withholds "Documentation: empty section": 1 candidate(s) were measured and not published.
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 — D21 withholds its case and prefix conventions rows: 1 candidate(s) found and not reported.
D22 Internal API Consistency — API consistency is measured on C# 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 .rb, .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
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
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) — 59 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — Swift suite
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 and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P2 Observability — This repository's Ruby, Swift source (2 module(s), 245 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 Ruby, 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 not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — X12 reached only 1% of this repository's production lines — swift (26,102 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 1% of this repository's production lines — swift (26,102 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
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 Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
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.
No assertions: aac_44100hz_step_1224 HaishinKit/Tests/Codec/AudioCodecTests.swift:74— 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.
No assertions: test3Channel_withoutCrash HaishinKit/Tests/Codec/AudioCodecTests.swift:108— 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.
No assertions: bytes HaishinKit/Tests/ISO/ADTSHeaderTests.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.
No assertions: keep48000 HaishinKit/Tests/Mixer/AudioMixerTrackTests.swift:32— 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.
No assertions: passthrough48000_44100 HaishinKit/Tests/Mixer/AudioMixerTrackTests.swift:40— 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.
No assertions: monoAppendSampleBuffer_920 HaishinKit/Tests/Mixer/AudioRingBufferTests.swift:8— 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.
No assertions: monoAppendSampleBuffer_1024 HaishinKit/Tests/Mixer/AudioRingBufferTests.swift:12— 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.
No assertions: stereoAppendSampleBuffer_920 HaishinKit/Tests/Mixer/AudioRingBufferTests.swift:49— 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.
No assertions: stereoAppendSampleBuffer_1024 HaishinKit/Tests/Mixer/AudioRingBufferTests.swift:53— 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.
No assertions: startRunning_fileAlreadyExists HaishinKit/Tests/Stream/StreamRecorderTests.swift:39— 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.
No assertions: chunkSize RTMPHaishinKit/Tests/RTMP/RTMPChunkBufferTests.swift:92— 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.
No assertions: streamid_success SRTHaishinKit/Tests/SRT/SRTConnectionTests.swift:24— 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.
No assertions: multipleH264SlicesPreserveOrder SRTHaishinKit/Tests/TS/TSReaderTests.swift:9— 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.
No assertions: singleH264SliceIsPreserved SRTHaishinKit/Tests/TS/TSReaderTests.swift:14— 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.
Low cohesion: HTTPSession (LCOM4 7) RTCHaishinKit/Sources/HTTP/HTTPSession.swift:4— HTTPSession's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MTHKView (LCOM4 6) HaishinKit/Sources/View/MTHKView.swift:7— MTHKView's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AMFReference (LCOM4 6) RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:3— AMFReference's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AudioCaptureUnit (LCOM4 5) HaishinKit/Sources/Mixer/AudioCaptureUnit.swift:3— AudioCaptureUnit's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MixerNode (LCOM4 5) HaishinKit/Sources/Mixer/AudioNode.swift:129— MixerNode's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: NullCaptureSession (LCOM4 5) HaishinKit/Sources/Mixer/CaptureSession.swift:308— NullCaptureSession's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ScreenObject (LCOM4 5) HaishinKit/Sources/Screen/ScreenObject.swift:26— ScreenObject's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CaptureSession (LCOM4 4) HaishinKit/Sources/Mixer/CaptureSession.swift:29— CaptureSession's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VideoCaptureUnit (LCOM4 4) HaishinKit/Sources/Mixer/VideoCaptureUnit.swift:4— VideoCaptureUnit's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VideoDeviceUnit (LCOM4 4) HaishinKit/Sources/Mixer/VideoDeviceUnit.swift:9— VideoDeviceUnit's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PiPHKView (LCOM4 4) HaishinKit/Sources/View/PiPHKView.swift:7— PiPHKView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RTCStream (LCOM4 4) RTCHaishinKit/Sources/RTC/RTCStream.swift:9— RTCStream's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RTCTrack (LCOM4 4) RTCHaishinKit/Sources/RTC/RTCTrack.swift:12— RTCTrack's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplicated block (7 lines × 3) MoQTHaishinKit/Sources/ControlMessage/MoQTFetch.swift:9— MoQTHaishinKit/Sources/ControlMessage/MoQTFetch.swift:9-15 | MoQTHaishinKit/Sources/ControlMessage/MoQTPublish.swift:11-17 | MoQTHaishinKit/Sources/ControlMessage/MoQTTrackStatus.swift:9-15 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `MoQTHaishinKit/Sources/ControlMessage/MoQTFetch.swift:9` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:176— HaishinKit/Sources/Util/ByteArray.swift:176-182 | RTMPHaishinKit/Sources/Util/ByteArray.swift:176-182 | SRTHaishinKit/Sources/TS/ByteArray.swift:176-182 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:191— HaishinKit/Sources/Util/ByteArray.swift:191-197 | RTMPHaishinKit/Sources/Util/ByteArray.swift:191-197 | SRTHaishinKit/Sources/TS/ByteArray.swift:191-197 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:206— HaishinKit/Sources/Util/ByteArray.swift:206-212 | RTMPHaishinKit/Sources/Util/ByteArray.swift:206-212 | SRTHaishinKit/Sources/TS/ByteArray.swift:206-212 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:221— HaishinKit/Sources/Util/ByteArray.swift:221-227 | RTMPHaishinKit/Sources/Util/ByteArray.swift:221-227 | SRTHaishinKit/Sources/TS/ByteArray.swift:221-227 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:236— HaishinKit/Sources/Util/ByteArray.swift:236-242 | RTMPHaishinKit/Sources/Util/ByteArray.swift:236-242 | SRTHaishinKit/Sources/TS/ByteArray.swift:236-242 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:257— HaishinKit/Sources/Util/ByteArray.swift:257-263 | RTMPHaishinKit/Sources/Util/ByteArray.swift:257-263 | SRTHaishinKit/Sources/TS/ByteArray.swift:257-263 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:271— HaishinKit/Sources/Util/ByteArray.swift:271-277 | RTMPHaishinKit/Sources/Util/ByteArray.swift:271-277 | SRTHaishinKit/Sources/TS/ByteArray.swift:271-277 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:280— HaishinKit/Sources/Util/ByteArray.swift:280-286 | RTMPHaishinKit/Sources/Util/ByteArray.swift:280-286 | SRTHaishinKit/Sources/TS/ByteArray.swift:280-286 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:295— HaishinKit/Sources/Util/ByteArray.swift:295-301 | RTMPHaishinKit/Sources/Util/ByteArray.swift:295-301 | SRTHaishinKit/Sources/TS/ByteArray.swift:295-301 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:346— HaishinKit/Sources/Util/ByteArray.swift:346-352 | RTMPHaishinKit/Sources/Util/ByteArray.swift:346-352 | SRTHaishinKit/Sources/TS/ByteArray.swift:346-352 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×5
Edited copy of a member (12 corresponding lines) RTCHaishinKit/Sources/RTC/RTCStream.swift:184— RTCHaishinKit/Sources/RTC/RTCStream.swift:184-198 | SRTHaishinKit/Sources/SRT/SRTStream.swift:213-224 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) SRTHaishinKit/Sources/SRT/SRTSocketOption.swift:134— SRTHaishinKit/Sources/SRT/SRTSocketOption.swift:134-145 | SRTHaishinKit/Sources/SRT/SRTSocketOption.swift:150-161 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) HaishinKit/Sources/Mixer/AudioNode.swift:162— HaishinKit/Sources/Mixer/AudioNode.swift:162-173 | HaishinKit/Sources/Mixer/AudioNode.swift:188-199 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) HaishinKit/Sources/Mixer/AudioNode.swift:175— HaishinKit/Sources/Mixer/AudioNode.swift:175-186 | HaishinKit/Sources/Mixer/AudioNode.swift:201-212 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) HaishinKit/Sources/Mixer/AudioNode.swift:71— HaishinKit/Sources/Mixer/AudioNode.swift:71-82 | HaishinKit/Sources/Mixer/AudioNode.swift:100-111 — 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.
Duplicated block (10 lines × 2) RTMPHaishinKit/Sources/Codec/HEVCDecoderConfigurationRecord.swift:47— RTMPHaishinKit/Sources/Codec/HEVCDecoderConfigurationRecord.swift:47-56 | SRTHaishinKit/Sources/Extension/HEVCNALUnit+Extension.swift:21-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) HaishinKit/Sources/Mixer/AudioCaptureUnit.swift:103— HaishinKit/Sources/Mixer/AudioCaptureUnit.swift:103-112 | HaishinKit/Sources/Mixer/VideoCaptureUnit.swift:145-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) HaishinKit/Sources/Mixer/AudioCaptureUnit.swift:114— HaishinKit/Sources/Mixer/AudioCaptureUnit.swift:114-123 | HaishinKit/Sources/Mixer/VideoCaptureUnit.swift:156-165 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) HaishinKit/Sources/View/MTHKView.swift:131— HaishinKit/Sources/View/MTHKView.swift:131-140 | HaishinKit/Sources/View/PiPHKView.swift:100-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Examples/macOS/HaishinApp.swift:20— Examples/macOS/HaishinApp.swift:20-29 | Examples/tvOS/HaishinApp.swift:20-29 — `Examples/macOS/HaishinApp.swift` and `Examples/tvOS/HaishinApp.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 10 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/macOS/HaishinApp.swift:20` 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) HaishinKit/Sources/Screen/TextScreenObject.swift:36— HaishinKit/Sources/Screen/TextScreenObject.swift:36-41 | HaishinKit/Sources/Screen/TextScreenObject.swift:79-84 — both copies are in the same file, so extract the 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 `HaishinKit/Sources/Screen/TextScreenObject.swift:36` 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, `HaishinKit/Sources/Screen/TextScreenObject.swift:33` calls `getRed` and `HaishinKit/Sources/Screen/TextScreenObject.swift:76` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) RTMPHaishinKit/Sources/RTMP/RTMPChunk.swift:303— RTMPHaishinKit/Sources/RTMP/RTMPChunk.swift:303-308 | RTMPHaishinKit/Sources/RTMP/RTMPChunk.swift:312-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) HaishinKit/Sources/View/MTHKViewRepresentable.swift:28— HaishinKit/Sources/View/MTHKViewRepresentable.swift:28-33 | HaishinKit/Sources/View/PiPHKViewRepresentable.swift:28-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) HaishinKit/Sources/Mixer/MediaMixer.swift:358— HaishinKit/Sources/Mixer/MediaMixer.swift:358-363 | HaishinKit/Sources/Stream/StreamConvertible.swift:104-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Examples/Preference.swift:11— Examples/Preference.swift:11-16 | Examples/iOS/PreferenceViewModel.swift:157-162 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
TooManyMethods: ByteArray HaishinKit/Sources/Util/ByteArray.swift:75— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ByteArray RTMPHaishinKit/Sources/Util/ByteArray.swift:75— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ByteArray SRTHaishinKit/Sources/TS/ByteArray.swift:75— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MoQTConnection MoQTHaishinKit/Sources/MoQTConnection.swift:5— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×4
Edited copy of a member (10 corresponding lines) REDACTED:90— REDACTED:90-99 | REDACTED:141-150 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:252— RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:252-261 | RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:363-372 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) RTCHaishinKit/Sources/RTC/RTCTrackConfiguration.swift:29— RTCHaishinKit/Sources/RTC/RTCTrackConfiguration.swift:29-38 | RTCHaishinKit/Sources/RTC/RTCTrackConfiguration.swift:40-49 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) HaishinKit/Sources/Stream/IncomingStream.swift:30— HaishinKit/Sources/Stream/IncomingStream.swift:30-39 | HaishinKit/Sources/Stream/OutgoingStream.swift:73-84 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (7 lines × 2) RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:255— RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:255-261 | RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:366-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. Read the line range as the matched WINDOW rather than a finished unit: at `RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:255` 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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) HaishinKit/Sources/Screen/VideoScreenObject.swift:74— HaishinKit/Sources/Screen/VideoScreenObject.swift:74-80 | HaishinKit/Sources/View/MTHKView.swift:111-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) HaishinKit/Sources/Screen/VideoScreenObject.swift:83— HaishinKit/Sources/Screen/VideoScreenObject.swift:83-89 | HaishinKit/Sources/View/MTHKView.swift:120-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Examples/iOS/PublishViewModel.swift:299— Examples/iOS/PublishViewModel.swift:299-305 | Examples/iOS/PublishViewModel.swift:426-432 — both copies are in the same file, so extract the 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 `Examples/iOS/PublishViewModel.swift:299` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Change coupling: VTSessionMode.swift ↔ VideoCodecSettings.swift HaishinKit/Sources/Codec/VTSessionMode.swift:1— `HaishinKit/Sources/Codec/VTSessionMode.swift` and `HaishinKit/Sources/Codec/VideoCodecSettings.swift` change together 71% of the time (10 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `b718080c` Made expectedFrameRate optional. (#1841); `bc887590` Refactor VideoCodecSettings.; `f6fc447a` Add LowLatencyRateControlEnabled option. — run `git show` on any of them.
Change coupling: MTHKView.swift ↔ PiPHKView.swift HaishinKit/Sources/View/MTHKView.swift:1— `HaishinKit/Sources/View/MTHKView.swift` and `HaishinKit/Sources/View/PiPHKView.swift` change together 69% of the time (18 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `13847ffe` refs 0b7c9982 (at that commit the files were still `Sources/View/MTHKView.swift` and `Sources/View/PiPHKView.swift`); `0b7c9982` Advanced protocol MediaMixerOutput. (at that commit the files were still `Sources/View/MTHKView.swift` and `Sources/View/PiPHKView.swift`); `8d4c669a` Integration into DisplayLinkChoreographer. (at that commit the files were still `Sources/View/MTHKView.swift` and `Sources/View/PiPHKView.swift`) — run `git show` on any of them.
Change coupling: DeviceUnit.swift ↔ MediaMixer.swift HaishinKit/Sources/Mixer/DeviceUnit.swift:1— `HaishinKit/Sources/Mixer/DeviceUnit.swift` and `HaishinKit/Sources/Mixer/MediaMixer.swift` change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `6b24a7be` Support attachVideo() for visionOS. (at that commit the files were still `Sources/IO/IOCaptureUnit.swift` and `Sources/IO/IOMixer.swift`); `21a55384` tvOS 17.0 for AVCaptureSession. (at that commit the files were still `Sources/Media/IOCaptureUnit.swift` and `Sources/Media/IOMixer.swift`); `8ef80f98` fixed #1157 Support 60/fps. (at that commit the files were still `Sources/Media/IOCaptureUnit.swift` and `Sources/Media/IOMixer.swift`) — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) HaishinKit/Sources/Screen/TextScreenObject.swift:24— HaishinKit/Sources/Screen/TextScreenObject.swift:24-41 | HaishinKit/Sources/Screen/TextScreenObject.swift:68-84 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) RTMPHaishinKit/Sources/RTMP/RTMPMessage.swift:210— RTMPHaishinKit/Sources/RTMP/RTMPMessage.swift:210-230 | RTMPHaishinKit/Sources/RTMP/RTMPMessage.swift:269-285 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Examples/macOS/PublishViewModel.swift:20— Examples/macOS/PublishViewModel.swift:20-37 | Examples/iOS/UVCViewModel.swift:54-70 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) HaishinKit/Sources/Codec/AudioCodecSettings.swift:240— HaishinKit/Sources/Codec/AudioCodecSettings.swift:240-248 | HaishinKit/Sources/Mixer/AudioMixerTrackSettings.swift:47-55 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) RTMPHaishinKit/Sources/RTMP/RTMPSession.swift:102— RTMPHaishinKit/Sources/RTMP/RTMPSession.swift:102-111 | SRTHaishinKit/Sources/SRT/SRTSession.swift:93-101 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) Examples/iOS/VisualEffect.swift:8— Examples/iOS/VisualEffect.swift:8-16 | Examples/iOS/VisualEffect.swift:22-30 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) HaishinKit/Sources/Mixer/AudioMixerByMultiTrack.swift:146— HaishinKit/Sources/Mixer/AudioMixerByMultiTrack.swift:146-158 | HaishinKit/Sources/Mixer/AudioMonitor.swift:53-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `HaishinKit/Sources/Mixer/AudioMixerByMultiTrack.swift:146` 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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Examples/iOS/PublishView.swift:310— Examples/iOS/PublishView.swift:310-322 | Examples/iOS/PublishView.swift:337-349 — both copies are in the same file, so extract the 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 `Examples/iOS/PublishView.swift:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `16` in one and `10` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) Examples/iOS/UVCViewModel.swift:136— Examples/iOS/UVCViewModel.swift:136-148 | Examples/macOS/PublishViewModel.swift:49-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/iOS/UVCViewModel.swift:136` 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 × 3) HaishinKit/Sources/Util/ByteArray.swift:373— HaishinKit/Sources/Util/ByteArray.swift:373-378 | RTMPHaishinKit/Sources/Util/ByteArray.swift:373-378 | SRTHaishinKit/Sources/TS/ByteArray.swift:373-378 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `HaishinKit/Sources/Util/ByteArray.swift:373` 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 × 3) RTCHaishinKit/Sources/RTC/RTCStream.swift:127— RTCHaishinKit/Sources/RTC/RTCStream.swift:127-132 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:716-721 | SRTHaishinKit/Sources/SRT/SRTStream.swift:166-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) RTCHaishinKit/Sources/RTC/RTCStream.swift:138— RTCHaishinKit/Sources/RTC/RTCStream.swift:138-143 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:723-728 | SRTHaishinKit/Sources/SRT/SRTStream.swift:177-182 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:142— HaishinKit/Sources/Util/ByteArray.swift:142-150 | RTMPHaishinKit/Sources/Util/ByteArray.swift:142-150 | SRTHaishinKit/Sources/TS/ByteArray.swift:142-150 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (9 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:159— HaishinKit/Sources/Util/ByteArray.swift:159-167 | RTMPHaishinKit/Sources/Util/ByteArray.swift:159-167 | SRTHaishinKit/Sources/TS/ByteArray.swift:159-167 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (9 lines × 3) Examples/iOS/PublishViewModel.swift:138— Examples/iOS/PublishViewModel.swift:138-146 | Examples/iOS/PublishViewModel.swift:167-175 | Examples/iOS/UVCViewModel.swift:85-94 — before extracting anything, compare `Examples/iOS/PublishViewModel.swift` and `Examples/iOS/UVCViewModel.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/iOS/PublishViewModel.swift:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
FileTooLong: Sources/MoQTConnection.swift MoQTHaishinKit/Sources/MoQTConnection.swift— FileTooLong — 626 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 126 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: RTMP/RTMPStream.swift RTMPHaishinKit/Sources/RTMP/RTMPStream.swift— FileTooLong — 592 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 92 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) HaishinKit/Sources/Util/ByteArray.swift:370— HaishinKit/Sources/Util/ByteArray.swift:370-378 | RTMPHaishinKit/Sources/Util/ByteArray.swift:370-378 | SRTHaishinKit/Sources/TS/ByteArray.swift:370-378 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) MoQTHaishinKit/Sources/ControlMessage/MoQTFetch.swift:20— MoQTHaishinKit/Sources/ControlMessage/MoQTFetch.swift:20-28 | MoQTHaishinKit/Sources/ControlMessage/MoQTPublish.swift:23-33 | MoQTHaishinKit/Sources/ControlMessage/MoQTTrackStatus.swift:20-28 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×2
Edited copy of a member (11 corresponding lines) HaishinKit/Sources/Mixer/MediaMixer.swift:154— HaishinKit/Sources/Mixer/MediaMixer.swift:154-164 | HaishinKit/Sources/Mixer/MediaMixer.swift:191-201 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) HaishinKit/Sources/View/PiPHKView.swift:114— HaishinKit/Sources/View/PiPHKView.swift:114-124 | HaishinKit/Sources/View/PiPHKView.swift:132-142 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×2
Edited copies of one member (3 members, 3+ corresponding lines) RTCHaishinKit/Sources/HTTP/HTTPSessionFactory.swift:24— RTCHaishinKit/Sources/HTTP/HTTPSessionFactory.swift:24-26 | RTMPHaishinKit/Sources/RTMP/RTMPSessionFactory.swift:10-12 | SRTHaishinKit/Sources/SRT/SRTSessionFactory.swift:24-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) RTCHaishinKit/Sources/RTC/RTCStream.swift:248— RTCHaishinKit/Sources/RTC/RTCStream.swift:248-250 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:816-818 | SRTHaishinKit/Sources/SRT/SRTStream.swift:256-258 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 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 (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) HaishinKit/Sources/Mixer/AudioDeviceUnit.swift:41— HaishinKit/Sources/Mixer/AudioDeviceUnit.swift:41-44 | HaishinKit/Sources/Mixer/VideoDeviceUnit.swift:170-173 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) RTMPHaishinKit/Sources/RTMP/RTMPSession.swift:44— RTMPHaishinKit/Sources/RTMP/RTMPSession.swift:44-47 | SRTHaishinKit/Sources/SRT/SRTSession.swift:34-37 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (14 lines × 2) HaishinKit/Sources/Screen/ScreenObjectSnapshotFactory.swift:9— HaishinKit/Sources/Screen/ScreenObjectSnapshotFactory.swift:9-22 | HaishinKit/Sources/Screen/ScreenObjectSnapshotFactory.swift:26-39 — both copies are in the same file, so extract the 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 `HaishinKit/Sources/Screen/ScreenObjectSnapshotFactory.swift:9` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:371— RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:371-384 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:526-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:371` 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 × 3) HaishinKit/Sources/Util/ByteArray.swift:329— HaishinKit/Sources/Util/ByteArray.swift:329-339 | RTMPHaishinKit/Sources/Util/ByteArray.swift:329-339 | SRTHaishinKit/Sources/TS/ByteArray.swift:329-339 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:380— HaishinKit/Sources/Util/ByteArray.swift:380-390 | RTMPHaishinKit/Sources/Util/ByteArray.swift:380-390 | SRTHaishinKit/Sources/TS/ByteArray.swift:380-390 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:82— RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:82-86 | RTCHaishinKit/Sources/RTC/RTCTrack.swift:90-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:89` calls `fromOpaque`, `takeUnretainedValue`, `didReceiveMessage` and `RTCHaishinKit/Sources/RTC/RTCTrack.swift:96` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) HaishinKit/Sources/Mixer/MediaMixer.swift:366— HaishinKit/Sources/Mixer/MediaMixer.swift:366-370 | HaishinKit/Sources/Stream/StreamConvertible.swift:111-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) HaishinKit/Sources/Screen/AssetScreenObject.swift:93— HaishinKit/Sources/Screen/AssetScreenObject.swift:93-101 | HaishinKit/Sources/Screen/StreamScreenObject.swift:74-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Examples/iOS/UVCView.swift:54— Examples/iOS/UVCView.swift:54-62 | Examples/iOS/UVCView.swift:68-76 — both copies are in the same file, so extract the 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 `Examples/iOS/UVCView.swift:54` 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 × 3) HaishinKit/Sources/Util/ByteArray.swift:112— HaishinKit/Sources/Util/ByteArray.swift:112-121 | RTMPHaishinKit/Sources/Util/ByteArray.swift:112-121 | SRTHaishinKit/Sources/TS/ByteArray.swift:112-121 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:46— RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:46-55 | RTCHaishinKit/Sources/RTC/RTCTrack.swift:23-32 | RTCHaishinKit/Sources/RTC/RTCTrack.swift:34-43 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×2
Edited copy of a member (8 corresponding lines) Examples/iOS/HaishinApp.swift:30— Examples/iOS/HaishinApp.swift:30-37 | Examples/iOS/Screencast/SampleHandler.swift:18-27 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Examples/iOS/PublishViewModel.swift:630— Examples/iOS/PublishViewModel.swift:630-640 | Examples/iOS/PlaybackViewModel.swift:107-114 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
RTMPConnection.connect (cyclomatic 27) RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift:327— RTMPConnection.connect has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
MoQTConnection.receiveStream (cyclomatic 25) MoQTHaishinKit/Sources/MoQTConnection.swift:700— MoQTConnection.receiveStream has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MoQTConnection.drainRequest (cyclomatic 25) MoQTHaishinKit/Sources/MoQTConnection.swift:782— MoQTConnection.drainRequest has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AudioRingBuffer.render (cyclomatic 24) HaishinKit/Sources/Mixer/AudioRingBuffer.swift:106— AudioRingBuffer.render has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MoQTConnection.request (cyclomatic 23) MoQTHaishinKit/Sources/MoQTConnection.swift:611— MoQTConnection.request has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RTCPeerConnection.init (cyclomatic 20) RTCHaishinKit/Sources/RTC/RTCPeerConnection.swift:162— RTCPeerConnection.init has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SDPMediaDescription.init (cyclomatic 20) RTCHaishinKit/Sources/SDP/SDPMediaDescription.swift:30— SDPMediaDescription.init has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamRecorder.makeWriterInput (cyclomatic 19) HaishinKit/Sources/Stream/StreamRecorder.swift:304— StreamRecorder.makeWriterInput 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.
MoQTMessageParameters.init (cyclomatic 19) MoQTHaishinKit/Sources/ControlMessage/MoQTMessageParameters.swift:12— MoQTMessageParameters.init has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
MoQTFetchDecoder.decode (cyclomatic 18) MoQTHaishinKit/Sources/DataStream/MoQTFetchDecoder.swift:9— MoQTFetchDecoder.decode has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RTMPConnection.dispatch (cyclomatic 18) RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift:536— RTMPConnection.dispatch has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MediaMixer.startRunning (cyclomatic 17) HaishinKit/Sources/Mixer/MediaMixer.swift:480— MediaMixer.startRunning has cyclomatic complexity 17 (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.
MoQTConnection.connect (cyclomatic 17) MoQTHaishinKit/Sources/MoQTConnection.swift:83— MoQTConnection.connect 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.
StreamRecorder.append (cyclomatic 16) HaishinKit/Sources/Stream/StreamRecorder.swift:257— StreamRecorder.append 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.
SRTSocket.open (cyclomatic 16) SRTHaishinKit/Sources/SRT/SRTSocket.swift:122— SRTSocket.open 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.
Hotspot: RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift:327— RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in RTMPConnection.connect at line 327. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 17:42:27 +09:00' --until='2026-11-14 17:42:27 +09:00' --full-history --no-merges -- RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
MoQTConnection.receiveStream (cognitive 51) MoQTHaishinKit/Sources/MoQTConnection.swift:700— MoQTConnection.receiveStream has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 2 (6 pts), boolean chains 5, match/switch 1 (2 pts), error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamRecorder.makeWriterInput (cognitive 48) HaishinKit/Sources/Stream/StreamRecorder.swift:304— StreamRecorder.makeWriterInput has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 4 (20 pts), if/else 8 (11 pts), match/switch 3 (10 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RTMPConnection.connect (cognitive 44) RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift:327— RTMPConnection.connect has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3 (8 pts), error handling 5 (7 pts), loops 3 (7 pts), boolean chains 6, ternaries 2 (4 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.
MoQTConnection.drainRequest (cognitive 41) MoQTHaishinKit/Sources/MoQTConnection.swift:782— MoQTConnection.drainRequest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 8, match/switch 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SDPMediaDescription.init (cognitive 38) RTCHaishinKit/Sources/SDP/SDPMediaDescription.swift:30— SDPMediaDescription.init has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), ternaries 1 (4 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RTMPConnection.dispatch (cognitive 38) RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift:536— RTMPConnection.dispatch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 4 (12 pts), loops 2 (6 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioRingBuffer.render (cognitive 36) HaishinKit/Sources/Mixer/AudioRingBuffer.swift:106— AudioRingBuffer.render has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 4 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 15). 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.
RTCPeerConnection.init (cognitive 35) RTCHaishinKit/Sources/RTC/RTCPeerConnection.swift:162— RTCPeerConnection.init has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 2, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RTMPStream.append (cognitive 35) RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:730— RTMPStream.append has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (5 pts), ternaries 1 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MoQTConnection.request (cognitive 31) MoQTHaishinKit/Sources/MoQTConnection.swift:611— MoQTConnection.request has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 7 (12 pts), boolean chains 3, error handling 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.
RTMPConnection.listen (cognitive 31) RTMPHaishinKit/Sources/RTMP/RTMPConnection.swift:465— RTMPConnection.listen has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 2 (4 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StreamRecorder.append (cognitive 27) HaishinKit/Sources/Stream/StreamRecorder.swift:257— StreamRecorder.append has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, match/switch 2 (3 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioCodec.append (cognitive 24) HaishinKit/Sources/Codec/AudioCodec.swift:83— AudioCodec.append has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioNode.description (cognitive 24) DebugDescription/AudioNode+DebugExtension.swift:5— AudioNode.description has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts), boolean chains 3 (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.
SRTSocket.open (cognitive 24) SRTHaishinKit/Sources/SRT/SRTSocket.swift:122— SRTSocket.open has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaMixer.startRunning (cognitive 22) HaishinKit/Sources/Mixer/MediaMixer.swift:480— MediaMixer.startRunning has cognitive complexity 22 (threshold 15). Drivers by points: loops 9 (13 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MoQTMessageParameters.init (cognitive 21) MoQTHaishinKit/Sources/ControlMessage/MoQTMessageParameters.swift:12— MoQTMessageParameters.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MoQTFetchDecoder.decode (cognitive 21) MoQTHaishinKit/Sources/DataStream/MoQTFetchDecoder.swift:9— MoQTFetchDecoder.decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MoQTConnection.connect (cognitive 20) MoQTHaishinKit/Sources/MoQTConnection.swift:83— MoQTConnection.connect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RTMPStream.dispatch (cognitive 20) RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:559— RTMPStream.dispatch has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 6 (9 pts), boolean chains 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CVPixelBuffer.copy (cognitive 18) HaishinKit/Sources/Extension/CVPixelBuffer+Extension.swift:60— CVPixelBuffer.copy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MoQTConnection.runPublication (cognitive 18) MoQTHaishinKit/Sources/MoQTConnection.swift:460— MoQTConnection.runPublication has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SRTConnection.connect (cognitive 18) SRTHaishinKit/Sources/SRT/SRTConnection.swift:92— SRTConnection.connect has cognitive complexity 18 (threshold 15). Drivers by points: loops 2 (5 pts), match/switch 2 (5 pts), error handling 3 (4 pts), if/else 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoCodec.append (cognitive 17) HaishinKit/Sources/Codec/VideoCodec.swift:50— VideoCodec.append has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaLink.startRunning (cognitive 17) HaishinKit/Sources/Stream/MediaLink.swift:61— MediaLink.startRunning has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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.
MoQTStreamReader.read (cognitive 17) MoQTHaishinKit/Sources/MoQTSocket.swift:126— MoQTStreamReader.read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioRingBuffer.append (cognitive 16) HaishinKit/Sources/Mixer/AudioRingBuffer.swift:44— AudioRingBuffer.append has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RTPH264Packetizer.append (cognitive 16) RTCHaishinKit/Sources/RTP/RTPH264Packetizer.swift:42— RTPH264Packetizer.append has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 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.
SRTSession.connect (cognitive 16) SRTHaishinKit/Sources/SRT/SRTSession.swift:43— SRTSession.connect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (4 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MethodTooLong: Name.init SRTHaishinKit/Sources/SRT/SRTSocketOption.Name.swift:10— MethodTooLong — init runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:290— RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:290-336 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:354-415 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:418-451 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:520-545 — 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 (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) RTMPHaishinKit/Sources/AMF/AMF0Serializer.swift:82— RTMPHaishinKit/Sources/AMF/AMF0Serializer.swift:82-125 | RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:93-134 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:71— RTCHaishinKit/Sources/RTC/RTCDataChannel.swift:71-101 | RTCHaishinKit/Sources/RTC/RTCTrack.swift:78-106 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) RTMPHaishinKit/Sources/Codec/HEVCDecoderConfigurationRecord.swift:34— RTMPHaishinKit/Sources/Codec/HEVCDecoderConfigurationRecord.swift:34-71 | SRTHaishinKit/Sources/Extension/HEVCNALUnit+Extension.swift:5-44 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) RTCHaishinKit/Sources/RTP/RTPH264Packetizer.swift:239— RTCHaishinKit/Sources/RTP/RTPH264Packetizer.swift:239-271 | RTMPHaishinKit/Sources/Codec/AVCDecoderConfigurationRecord.swift:45-72 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) HaishinKit/Sources/Screen/AssetScreenObject.swift:76— HaishinKit/Sources/Screen/AssetScreenObject.swift:76-91 | HaishinKit/Sources/Screen/StreamScreenObject.swift:57-72 | HaishinKit/Sources/Screen/VideoScreenObject.swift:113-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) RTMPHaishinKit/Sources/RTMP/RTMPMessage.swift:189— RTMPHaishinKit/Sources/RTMP/RTMPMessage.swift:189-208 | RTMPHaishinKit/Sources/RTMP/RTMPMessage.swift:250-267 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) HaishinKit/Sources/Mixer/AudioMixerByMultiTrack.swift:144— HaishinKit/Sources/Mixer/AudioMixerByMultiTrack.swift:144-158 | HaishinKit/Sources/Mixer/AudioMonitor.swift:51-65 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) MoQTHaishinKit/Sources/MoQTConnection.swift:152— MoQTHaishinKit/Sources/MoQTConnection.swift:152-164 | MoQTHaishinKit/Sources/MoQTConnection.swift:686-698 — 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 copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) MoQTHaishinKit/Sources/ControlMessage/MoQTFetch.swift:9— MoQTHaishinKit/Sources/ControlMessage/MoQTFetch.swift:9-18 | MoQTHaishinKit/Sources/ControlMessage/MoQTPublish.swift:11-21 | MoQTHaishinKit/Sources/ControlMessage/MoQTTrackStatus.swift:9-18 — 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 (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:406— RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:406-418 | RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:430-442 | RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:454-466 | RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:478-490 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) MoQTHaishinKit/Sources/ControlMessage/MoQTRequestUpdate.swift:7— MoQTHaishinKit/Sources/ControlMessage/MoQTRequestUpdate.swift:7-11 | MoQTHaishinKit/Sources/ControlMessage/MoQTSubscribeTracks.swift:8-13 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) RTMPHaishinKit/Sources/Util/MD5.swift:38— RTMPHaishinKit/Sources/Util/MD5.swift:38-45 | RTMPHaishinKit/Sources/Util/MD5.swift:47-54 | RTMPHaishinKit/Sources/Util/MD5.swift:56-63 | RTMPHaishinKit/Sources/Util/MD5.swift:65-72 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) HaishinKit/Sources/Util/ByteArray.swift:215— HaishinKit/Sources/Util/ByteArray.swift:215-218 | RTMPHaishinKit/Sources/Util/ByteArray.swift:215-218 | SRTHaishinKit/Sources/TS/ByteArray.swift:215-218 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (29 lines × 2) RTMPHaishinKit/Sources/AMF/AMF0Serializer.swift:87— RTMPHaishinKit/Sources/AMF/AMF0Serializer.swift:87-115 | RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:98-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `RTMPHaishinKit/Sources/AMF/AMF0Serializer.swift:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `RTMPHaishinKit/Sources/AMF/AMF0Serializer.swift:117` calls `serialize` and `RTMPHaishinKit/Sources/AMF/AMF3Serializer.swift:127` 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 (22 lines × 2) RTCHaishinKit/Sources/RTP/RTPH264Packetizer.swift:250— RTCHaishinKit/Sources/RTP/RTPH264Packetizer.swift:250-271 | RTMPHaishinKit/Sources/Codec/AVCDecoderConfigurationRecord.swift:51-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `RTCHaishinKit/Sources/RTP/RTPH264Packetizer.swift:250` 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 (18 lines × 2) HaishinKit/Sources/Screen/TextScreenObject.swift:5— HaishinKit/Sources/Screen/TextScreenObject.swift:5-22 | HaishinKit/Sources/Screen/TextScreenObject.swift:49-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:354— HaishinKit/Sources/Util/ByteArray.swift:354-368 | RTMPHaishinKit/Sources/Util/ByteArray.swift:354-368 | SRTHaishinKit/Sources/TS/ByteArray.swift:354-368 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) HaishinKit/Sources/Screen/AssetScreenObject.swift:78— HaishinKit/Sources/Screen/AssetScreenObject.swift:78-91 | HaishinKit/Sources/Screen/StreamScreenObject.swift:59-72 | HaishinKit/Sources/Screen/VideoScreenObject.swift:115-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `HaishinKit/Sources/Screen/AssetScreenObject.swift:78` 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 (12 lines × 4) RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:311— RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:311-322 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:373-384 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:435-446 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:528-539 — 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 `RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:311` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:310` calls `startRunning` and `RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:372` 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 (12 lines × 3) RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:340— RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:340-351 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:491-502 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:506-517 — 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. 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 (11–12 lines × 2) HaishinKit/Sources/Extension/CVPixelBuffer+Extension.swift:69— HaishinKit/Sources/Extension/CVPixelBuffer+Extension.swift:69-79 | HaishinKit/Sources/Extension/CVPixelBuffer+Extension.swift:87-98 — both copies are in the same file, so extract the 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 `HaishinKit/Sources/Extension/CVPixelBuffer+Extension.swift:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) HaishinKit/Sources/Stream/StreamRecorder.swift:233— HaishinKit/Sources/Stream/StreamRecorder.swift:233-242 | RTCHaishinKit/Sources/RTC/RTCStream.swift:231-240 | RTMPHaishinKit/Sources/RTMP/RTMPStream.swift:801-810 | SRTHaishinKit/Sources/SRT/SRTStream.swift:239-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (5 lines × 3) HaishinKit/Sources/Util/ByteArray.swift:315— HaishinKit/Sources/Util/ByteArray.swift:315-319 | RTMPHaishinKit/Sources/Util/ByteArray.swift:315-319 | SRTHaishinKit/Sources/TS/ByteArray.swift:315-319 — before extracting anything, compare `HaishinKit/Sources/Util/ByteArray.swift` and `RTMPHaishinKit/Sources/Util/ByteArray.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) REDACTED:92— REDACTED:92-99 | REDACTED:143-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) Examples/iOS/PublishViewModel.swift:164— Examples/iOS/PublishViewModel.swift:164-214 | Examples/iOS/UVCViewModel.swift:82-134 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) Examples/iOS/UVCViewModel.swift:136— Examples/iOS/UVCViewModel.swift:136-174 | Examples/macOS/PublishViewModel.swift:49-84 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) Examples/iOS/PublishViewModel.swift:510— Examples/iOS/PublishViewModel.swift:510-536 | Examples/macOS/PublishViewModel.swift:149-173 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) Examples/macOS/HaishinApp.swift:20— Examples/macOS/HaishinApp.swift:20-33 | Examples/tvOS/HaishinApp.swift:20-33 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) Examples/iOS/PlaybackViewModel.swift:67— Examples/iOS/PlaybackViewModel.swift:67-94 | Examples/macOS/PlaybackViewModel.swift:44-64 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (24–25 lines × 2) Examples/iOS/PublishViewModel.swift:164— Examples/iOS/PublishViewModel.swift:164-187 | Examples/iOS/UVCViewModel.swift:82-106 — before extracting anything, compare `Examples/iOS/PublishViewModel.swift` and `Examples/iOS/UVCViewModel.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/iOS/PublishViewModel.swift:164` 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–20 lines × 2) Examples/iOS/PublishViewModel.swift:510— Examples/iOS/PublishViewModel.swift:510-527 | Examples/macOS/PublishViewModel.swift:149-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/iOS/PublishViewModel.swift:510` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) Examples/iOS/PublishViewModel.swift:271— Examples/iOS/PublishViewModel.swift:271-289 | Examples/iOS/UVCViewModel.swift:156-174 — before extracting anything, compare `Examples/iOS/PublishViewModel.swift` and `Examples/iOS/UVCViewModel.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/iOS/PublishViewModel.swift:271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Examples/iOS/UVCViewModel.swift:205— Examples/iOS/UVCViewModel.swift:205-216 | Examples/macOS/PublishViewModel.swift:124-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) Examples/iOS/PublishViewModel.swift:466— Examples/iOS/PublishViewModel.swift:466-476 | Examples/macOS/PublishViewModel.swift:137-147 — 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.
Off the main sequence: HaishinKit — HaishinKit: abstractness 0.30, instability 0.00, distance 0.70 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
No direct assertions: rejectsInvalidURL HaishinKit/Tests/Session/StreamSessionBuilderFactoryTests.swift:31— No conventional assertion call was detected, and 3 of 4 tests in `Session` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: unsupportedScheme HaishinKit/Tests/Session/StreamSessionBuilderFactoryTests.swift:44— No conventional assertion call was detected, and 3 of 4 tests in `Session` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: acceptsValidAuthority HaishinKit/Tests/Session/StreamSessionBuilderFactoryTests.swift:56— No conventional assertion call was detected, and 3 of 4 tests in `Session` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No SAST .github/workflows/merged-pr-milestone.yml:3— 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) as a CI step. What was searched, so you can tell an absence from a miss: the 5 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.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Duplicated predicate HaishinKit/Sources/Screen/StreamScreenObject.swift:51— `0.0 < cornerRadius || chromaKeyColor != nil` appears character-identically in 2 files — HaishinKit/Sources/Screen/StreamScreenObject.swift, HaishinKit/Sources/Screen/VideoScreenObject.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.
X5 · Nullable reference types· Ruby's type checker does not check nil everywhere · ×1
Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
Outdated: swift-docc-plugin — `swift-docc-plugin` is resolved at 1.4.5, but 1.5.0 is the newest release tagged on https://github.com/swiftlang/swift-docc-plugin within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-docc-plugin` reaches this one with no change to Package.swift.
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.
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 59 file(s) — `Examples/iOS/PlaybackView.swift`, `Examples/iOS/PlaybackViewModel.swift`, `Examples/iOS/PreferenceView.swift`, `Examples/iOS/PublishView.swift`, `Examples/iOS/PublishViewModel.swift`, … (+54 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1dc38-4854-7472-8386-d738b810b863 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 4 · Warnings: 192 · Recommendations: 10 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 22:40 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.