Public report of swiftlang/swift-format, 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 report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 14 November 2026, 22:45 UTC · Survey ID cd_b8670d03edab4d9bbc624e3e7cd41ad4

swiftlang/swift-format

Measured 14 November 2026, 22:44 UTC, at code version 48dd21a

Dependency hygiene is not measured: SwiftPM pinning read, dependency currency NOT established (SwiftPM has no central registry to ask).

Knowledge freshness is not measured: Freshness signal contradicted by repo activity.

CAI score 53out of 100 Adequate
CriticalWeakAdequateStrongExemplary
No change 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: 22,211 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 0.4 person-years · Weakest lens: Production Readiness, 40

Findings by how serious they are

14 critical 239 serious 13 minor

21 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 22:44 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 ▸

33of 33 dimensions measured by tools.
253of 266 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
33dimensions across 5 lenses, read from 22,211 lines of product code in 8 projects.
Chapters

Executive summary

swiftlang/swift-format falls short of our standard for production, in part because we found no logging, tracing or health checks in the code. It scores 53 out of 100 and is rated Adequate, and all 14 of its critical findings are security problems in the build pipeline and in its automatic dependency updates.

Production Readiness, at 40, is the weakest lens and counts most in the score. The best first step is making the 35 tests that check nothing check their results, worth about 11 points. Adding a diagnostic log would lift Production Readiness itself, worth about 8 points. Raising Production Readiness to 70 would lift the score to about 63.

Thirteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. One automatic update takes new releases before a bad one can be spotted. Pinning each tool to an exact version and setting a waiting period for automatic updates would close both risks.

The product code is 22,211 lines, about €54,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 40 · counts for 47%Security and Compliance 57 · counts for 26%Maturity 59 · counts for 14%Code Health 82 · counts for 8%Architecture 96 · counts for 4%

If Production Readiness rose from 40 to 70, the lowest score rated Strong, the score would rise from 53 to about 63.

Code composition: what the lines of code are
Product code 39%Tests 61%
New since the last survey: 127 findings

These 127 critical or serious findings weren't in the previous survey, on 28 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · Comment.printReflowedBlockComment (cyclomatic 58) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · InlineWordCollector.collectInline (cyclomatic 50) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · MarkdownReflower.visitParagraph (cyclomatic 47) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · MarkdownReflower.visitBlockChildren (cyclomatic 39) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · InlineWordCollector.collectBracketedInline (cyclomatic 31) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · OrderedImports.orderImportsInSlice (cyclomatic 28) Sources/SwiftFormat/Rules/OrderedImports.swift
  • Cyclomatic Complexity · MarkdownReflower.extractListMarker (cyclomatic 23) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · Selection.collectEdits (cyclomatic 20) Sources/SwiftFormat/API/Selection.swift
  • Cyclomatic Complexity · Comment.exceedsMaxLineLength (cyclomatic 20) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · Comment.printReflowedLineComment (cyclomatic 19) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · OverlongLineReflower.reflow (cyclomatic 19) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · InlineWordCollector.appendBreakableText (cyclomatic 19) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · TokenStreamCreator.appendAfterTokensAndTrailingComments (cyclomatic 17) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Cyclomatic Complexity · Comment.reflowBlockBodyLines (cyclomatic 16) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cyclomatic Complexity · MarkdownReflower.visitBlock (cyclomatic 16) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · Comment.printReflowedBlockComment (cognitive 93) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · MarkdownReflower.visitParagraph (cognitive 77) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · InlineWordCollector.collectInline (cognitive 67) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · InlineWordCollector.collectBracketedInline (cognitive 50) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · Comment.exceedsMaxLineLength (cognitive 40) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · Selection.collectEdits (cognitive 38) Sources/SwiftFormat/API/Selection.swift
  • Cognitive Complexity · OrderedImports.orderImportsInSlice (cognitive 37) Sources/SwiftFormat/Rules/OrderedImports.swift
  • Cognitive Complexity · OverlongLineReflower.reflow (cognitive 35) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · MarkdownReflower.extractListMarker (cognitive 35) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · MarkdownReflower.visitBlockChildren (cognitive 33) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · InlineWordCollector.appendBreakableText (cognitive 33) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · Comment.printReflowedLineComment (cognitive 27) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · Comment.pragmaLineIndices (cognitive 25) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · OverlongLineReflower.splitAtLastWhitespace (cognitive 25) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · MarkdownReflower.visitListItems (cognitive 24) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · MarkdownReflower.visitBlock (cognitive 23) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · UseShorthandTypeNames.visit (cognitive 22) Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift
  • Cognitive Complexity · Comment.reflowBlockBodyLines (cognitive 20) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · UseShorthandTypeNames.visit (cognitive 19) Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift
  • Cognitive Complexity · Selection.resolved (cognitive 18) Sources/SwiftFormat/API/Selection.swift
  • Cognitive Complexity · MarkdownReflower.visitBlockChildren::emitUnvisitedGap (cognitive 18) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Cognitive Complexity · OmitExplicitReturns.transformAccessorBlock (cognitive 17) Sources/SwiftFormat/Rules/OmitExplicitReturns.swift
  • Cognitive Complexity · UseTripleSlashForDocumentationComments.rewrittenDocCommentLeadingTrivia (cognitive 17) Sources/SwiftFormat/Rules/UseTripleSlashForDocumentationComments.swift
  • God Classes · MethodTooLong: OverlongLineReflower.mayReflowIntoPreviousLine Sources/SwiftFormat/PrettyPrint/Comment.swift
  • God Classes · MethodTooLong: MarkdownReflower.visitParagraph Sources/SwiftFormat/PrettyPrint/Comment.swift
  • God Classes · FileTooLong: PrettyPrint/Comment.swift Sources/SwiftFormat/PrettyPrint/Comment.swift
  • God Classes · ClassTooLong: OverlongLineReflower Sources/SwiftFormat/PrettyPrint/Comment.swift
  • God Classes · MethodTooLong: Comment.printReflowedBlockComment Sources/SwiftFormat/PrettyPrint/Comment.swift
  • God Classes · ClassTooLong: Comment Sources/SwiftFormat/PrettyPrint/Comment.swift
  • God Classes · MethodTooLong: OrderedImports.orderImportsInSlice Sources/SwiftFormat/Rules/OrderedImports.swift
  • God Classes · FileTooLong: Rules/OrderedImports.swift Sources/SwiftFormat/Rules/OrderedImports.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (89 corresponding lines) Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift
  • Code Duplication · Edited copy of a member (29 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (32 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (28 corresponding lines) Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift
  • Code Duplication · Edited copy of a member (16 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (19 corresponding lines) Sources/SwiftFormat/API/SwiftFormatter.swift
  • Code Duplication · Edited copy of a member (24 corresponding lines) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift
  • Code Duplication · Edited copy of a member (27 corresponding lines) Sources/SwiftFormat/API/SwiftFormatter.swift
  • Code Duplication · Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/Core/LintPipeline.swift
  • Code Duplication · Edited copy of a member (14 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (11 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift
  • Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (17 corresponding lines) Sources/SwiftFormat/Rules/OmitExplicitReturns.swift
  • Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (11 corresponding lines) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift
  • Code Duplication · Edited copy of a member (7 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (9 corresponding lines) Sources/SwiftFormat/Core/RuleMask.swift
  • Code Duplication · Edited copy of a member (6 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) Sources/SwiftFormat/Rules/UseLetInEveryBoundCaseVariable.swift
  • Code Duplication · Edited copy of a member (8 corresponding lines) Sources/swift-format/Subcommands/LintFormatOptions.swift
  • Code Duplication · Edited copy of a member (13 corresponding lines) Sources/SwiftFormat/Rules/NoParensAroundConditions.swift
  • Code Duplication · Edited copies of one member (6 members, 14+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) Sources/SwiftFormat/Rules/NoParensAroundConditions.swift
  • Code Duplication · Edited copy of a member (8 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (5 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (10 corresponding lines) Sources/SwiftFormat/Rules/NeverForceUnwrap.swift
  • Code Duplication · Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/Rules/OmitExplicitReturns.swift
  • Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) Sources/SwiftFormat/Core/RuleMask.swift
  • Code Duplication · Edited copy of a member (11 corresponding lines) Sources/SwiftFormat/Core/SyntaxProtocol+Convenience.swift
  • Code Duplication · Edited copy of a member (15 corresponding lines) Sources/SwiftFormat/Rules/NoAccessLevelOnExtensionDeclaration.swift
  • Code Duplication · Edited copy of a member (8 corresponding lines) Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift
  • Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift
  • Code Duplication · Duplicated block (16 lines × 2) Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift
  • Code Duplication · Duplicated block (11 lines × 3) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (8–10 lines × 5) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (8 lines × 2) Sources/SwiftFormat/PrettyPrint/Comment.swift
  • Code Duplication · Duplicated block (8 lines × 3) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Edited copy of a member (44 corresponding lines) Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift
  • Code Duplication · Duplicated block (43–44 lines × 2) Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift
  • Test Quality · No assertions: testEndOfLineCommentAtEndOfSelectionDoesNotLeakFormattingOntoNextLine Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift
  • Test Quality · No assertions: testMultilineStringLiteralWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift
  • Test Quality · No assertions: testReflowCommentCompletelyEncompassed Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift
  • Test Quality · No assertions: testCRLFLineEndingsWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift
  • Test Quality · No assertions: testReflowCommentFunctionHeaderEncompassedButNotDocComment Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift
  • Test Quality · No assertions: testBlankLinesWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift

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: 14 findings

These 14 critical or serious findings were in the previous survey, on 28 October 2026, and are gone from this one.

  • Cyclomatic Complexity · OrderedImports.orderImports (cyclomatic 28) Sources/SwiftFormat/Rules/OrderedImports.swift
  • Cognitive Complexity · OrderedImports.orderImports (cognitive 37) Sources/SwiftFormat/Rules/OrderedImports.swift
  • God Classes · MethodTooLong: OrderedImports.orderImports Sources/SwiftFormat/Rules/OrderedImports.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (15 lines × 2) Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift
  • Code Duplication · Duplicated block (11 lines × 3) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (8–10 lines × 5) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (7 lines × 3) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Code Duplication · Duplicated block (25 lines × 2) Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift
  • Code Duplication · Duplicated block (10 lines × 2) Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift
  • Cohesion (LCOM4) · Low cohesion: CommentMovingRewriter (LCOM4 4) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
  • Documentation (README) · README may be stale
Rebuild cost: about €54,000 · Estimate
Cost to rebuild€18,000 to €91,000, for 301 to 956 hours of work, about 0.4 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 53. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 22,211 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 35 No assertions finding(s) in Test Quality — start with SwiftFormatterSelectionTests.swift (35).
Raises the score by about 11 points · Medium effort · Test Quality
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Package.swift.
Raises the score by about 5 points · Low effort · ADR Quality
3
Resolve the 9 Skipped test finding(s) in Test Quality — start with FileIteratorTests.swift (5), ConfigurationTests.swift (4).
Raises the score by about 4 points · Low effort · Test Quality

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €54,000 to build again, about 0.4 person-years of work. Its weakest lens is Production Readiness, at 40 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 35 No assertions finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 11 points for medium effort, because it clears the 35 Test Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 7,710 lines over the last 90 days, which is about 31,268 lines a year. At that pace, the extra work comes to an estimated 4 to 24.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — 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.

arch SwiftFormat (CMake) SwiftFormat (CMake) SwiftFormat (SwiftPM) SwiftFormat (SwiftPM) _GenerateSwiftFormat _GenerateSwiftFormat _GenerateSwiftFormat->SwiftFormat (SwiftPM) _SwiftFormatInstructionCounter (CMake) _SwiftFormatInstructionCounter (CMake) _SwiftFormatInstructionCounter (SwiftPM) _SwiftFormatInstructionCounter (SwiftPM) generate-swift-format generate-swift-format generate-swift-format->_GenerateSwiftFormat swift-format (CMake) swift-format (CMake) swift-format (CMake)->SwiftFormat (CMake) swift-format (CMake)->_SwiftFormatInstructionCounter (CMake) swift-format (SwiftPM) swift-format (SwiftPM)

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.

5 modules, with 4 dependencies between them. One loop runs through 3 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.
uses →1 (global)2 generate-swift-format3 _GenerateSwiftFormat4 swift-format5 SwiftFormat
1 (global)
2 generate-swift-format
3 _GenerateSwiftFormat5
4 swift-format11
5 SwiftFormat17
Uses a module listed above itPart of a loopThe module itself
1 (global)2 generate-swift-format3 _GenerateSwiftFormat4 swift-format5 SwiftFormat(global)1generate-swift-format2_GenerateSwiftFormat3swift-format4SwiftFormat551117

At a glance — Code Health · 82% · Adequate · gated by D2 ·

At a glance — Architecture · 96% · Exemplary ·

At a glance — Maturity · 59% · Adequate · gated by M2 ·

At a glance — Readiness · 40% · Weak · gated by P2, P3 ·

At a glance — Security · 57% · Checked 3 of 8 · gated by D36 ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection14High / Critical
A03:2025 — Software Supply Chain Failures4Medium

Roadmap

Top priorities: Resolve the 35 No assertions finding(s) in Test Quality — start with SwiftFormatterSelectionTests.swift (35); Write a diagnostic trail the user can hand back with a bug report: log through `os.Logger` (one per subsystem), which the unified log keeps and a sysdiagnose carries to you. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce; 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.

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

Do thisHelpsEffortDimension
Resolve the 35 No assertions finding(s) in Test Quality — start with SwiftFormatterSelectionTests.swift (35).+11.2 ptsMediumTest Quality
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Package.swift.+4.6 ptsLowADR Quality
Resolve the 9 Skipped test finding(s) in Test Quality — start with FileIteratorTests.swift (5), ConfigurationTests.swift (4).+4.4 ptsLowTest Quality
Write a diagnostic trail the user can hand back with a bug report: log through `os.Logger` (one per subsystem), which the unified log keeps and a sysdiagnose carries to you. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.+8.5 ptsMediumObservability
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.+4.6 ptsMediumSecurity & performance tooling
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+3.9 ptsMediumArchitecture documentation
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.4 ptsLowSupply-chain Provenance & Signing

File quality

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

FileScoreBandWorst signal
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
Sources/SwiftFormat/API/SwiftFormatter.swift5.9MixedCode Duplication: Edited copy of a member (19 corresponding lines)
Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift6.0MixedExplicit Debt: TodoComment
Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift6.0MixedExplicit Debt: TodoComment
Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift6.0MixedExplicit Debt: FixmeComment
Sources/SwiftFormat/Rules/GroupNumericLiterals.swift6.0MixedExplicit Debt: TodoComment
Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift6.0MixedExplicit Debt: FixmeComment
Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift6.5MixedExplicit Debt: TodoComment
Sources/SwiftFormat/PrettyPrint/Comment.swift7.0MixedCyclomatic Complexity: Comment.printReflowedBlockComment (cyclomatic 58)
Sources/SwiftFormat/Core/Trivia+Convenience.swift7.0MixedCognitive Complexity: Trivia.trimmingSuperfluousNewlines (cognitive 23)
Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift7.0MixedTest Quality: No assertions: testSingleLineFormatting
Sources/SwiftFormat/Rules/OrderedImports.swift7.0MixedCyclomatic Complexity: OrderedImports.orderImportsInSlice (cyclomatic 28)
Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift7.0MixedCode Duplication: Edited copy of a member (24 corresponding lines)
Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift7.1MixedCyclomatic Complexity: WhitespaceLinter.checkForLineLengthErrors (cyclomatic 18)
Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift7.1MixedTest Quality: Skipped test: testNoFollowSymlinks
Tests/SwiftFormatTests/API/ConfigurationTests.swift7.2MixedTest Quality: Skipped test: testMissingConfigurationFile
REDACTED7.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED7.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED7.2MixedStatic Analysis (SAST): High: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 14

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

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

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

Could not be resolved — 21

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 33 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 — 33 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D16D17D20D27D28D29D35D36AX10AX3AX4AX8AX9M1M2M3M4P1P2P3P4P6X3

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 253 of 266 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1dc3c-05cb-73b0-93b8-fe87ca5507e3.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the 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 (swift-format), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 6 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (1 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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)` (22211 LoC, 202 module-visible types across 13 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. `Sources/SwiftFormat/Core/RuleMask.swift`, `Sources/SwiftFormat/Core/SyntaxTraits.swift`, `Sources/SwiftFormat/PrettyPrint/Comment.swift`, `Sources/SwiftFormat/Utilities/FileIterator.swift` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D34 Knowledge Freshness — not measured this run — 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. File-level freshness contradicts repo activity: 35 commits in the last 90 days, yet 53 of 82 significant files carry no living knowledge. Those two readings cannot both be true, so the per-file recency signal is treated as unreliable here and freshness is not scored for this run.
  • D44 Platform End-of-Life — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AX6 Interface segregation — 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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 no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Swift, c 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Swift, c is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • 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.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no 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.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Python, Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • 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.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity5.6 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

28 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PrettyPrinter.printToken at 103. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being PrettyPrinter.printDebugToken at 21 — they are counted neither in the figure above nor in this dimension's score.

PrettyPrinter.printToken (cyclomatic 103)Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:227
TokenStreamCreator.extractLeadingTrivia (cyclomatic 72)Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3667
Comment.printReflowedBlockComment (cyclomatic 58)Sources/SwiftFormat/PrettyPrint/Comment.swift:476
InlineWordCollector.collectInline (cyclomatic 50)Sources/SwiftFormat/PrettyPrint/Comment.swift:2157
MarkdownReflower.visitParagraph (cyclomatic 47)Sources/SwiftFormat/PrettyPrint/Comment.swift:1733

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with PrettyPrinter.printToken (cyclomatic 103), TokenStreamCreator.extractLeadingTrivia (cyclomatic 72). — 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 2 together lifts Cyclomatic Complexity from 5.6 to about 6.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

59 method(s) exceeded the cognitive complexity threshold of 15; the worst was PrettyPrinter.printToken at 150.

PrettyPrinter.printToken (cognitive 150)Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:227
TokenStreamCreator.extractLeadingTrivia (cognitive 136)Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3667
Comment.printReflowedBlockComment (cognitive 93)Sources/SwiftFormat/PrettyPrint/Comment.swift:476
MarkdownReflower.visitParagraph (cognitive 77)Sources/SwiftFormat/PrettyPrint/Comment.swift:1733
InlineWordCollector.collectInline (cognitive 67)Sources/SwiftFormat/PrettyPrint/Comment.swift:2157

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

What to do

  1. Bring the 5 bodies over 60 down to 60 or less in Cognitive Complexity — start with PrettyPrinter.printToken (cognitive 150), TokenStreamCreator.extractLeadingTrivia (cognitive 136), Comment.printReflowedBlockComment (cognitive 93). — 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 5 together lifts Cognitive Complexity from 2.0 to about 4.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes9.2 / 10Stronggated by 11 serious findings✓ Tool-verified

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

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

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

11 god class(es) detected.

MethodTooLong: OverlongLineReflower.mayReflowIntoPreviousLine · ×4Sources/SwiftFormat/PrettyPrint/Comment.swift:1029
FileTooLong: PrettyPrint/TokenStreamCreator.swift · ×3Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift
TooManyMethods: TokenStreamCreator · ×2Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:30
ClassTooLong: OverlongLineReflower · ×2Sources/SwiftFormat/PrettyPrint/Comment.swift:861

What to do

  1. Resolve the 4 MethodTooLong finding(s) in God Classes — start with Comment.swift (3), OrderedImports.swift. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 3 FileTooLong finding(s) in God Classes — start with TokenStreamCreator.swift, Comment.swift, OrderedImports.swift. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 2 TooManyMethods finding(s) in God Classes — start with TokenStreamCreator.swift, Finding.swift. — One of this dimension's main actionable groups (2 warning-level).

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

D4 · Code Duplication7.2 / 10Strong✓ Tool-verified

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

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

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

22 duplicated block group(s) detected. 7.0 % of the production lines (1,559 of 22,211) are in a reported copy. A further 40 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 3 of the 62 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 (18 corresponding lines) · ×4Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3451
Edited copy of a member (11 corresponding lines) · ×3Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2421
Edited copy of a member (8 corresponding lines) · ×3Sources/swift-format/Subcommands/LintFormatOptions.swift:155
Duplicated block (16 lines × 2) · ×3Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:88
Edited copies of one member (3 members, 13+ corresponding lines) · ×2Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3382

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

What to do

  1. Resolve the 4 Edited copy of a member (18 corresponding lines) finding(s) in Code Duplication — start with TokenStreamCreator.swift, LintPipeline.swift, AlwaysUseLiteralForEmptyCollectionInit.swift. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 3 Edited copy of a member (11 corresponding lines) finding(s) in Code Duplication — start with TokenStreamCreator.swift, AlwaysUseLiteralForEmptyCollectionInit.swift, SyntaxProtocol+Convenience.swift. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 3 Edited copy of a member (8 corresponding lines) finding(s) in Code Duplication — start with LintFormatOptions.swift, TokenStreamCreator.swift, NoAssignmentInExpressions.swift. — One of this dimension's main actionable groups (3 warning-level).

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

D5 · Coupling9.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

8 production modules (SwiftPM+CMake), 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, with abstractness counted on 4 of the 8 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: SwiftFormat (SwiftPM)

What to do

  1. 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.

D6 · Cohesion (LCOM4)9.0 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

2 of 24 classes have LCOM4 above 3.

Low cohesion: TokenStreamCreator (LCOM4 40) · ×2Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:30

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with TokenStreamCreator.swift, Trivia+Convenience.swift. — One of this dimension's main actionable groups (2 warning-level).

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

D10 · Test Quality5.4 / 10Adequate✓ Tool-verified

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

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

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

10 skipped (1 with a documented reason), 35 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 154 tests.

No assertions: testSingleLineFormatting · ×35Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:21
Skipped test: testMissingConfigurationFile · ×9Tests/SwiftFormatTests/API/ConfigurationTests.swift:35
Skipped (documented): fileIteratorWithMultipleNonEmptySwiftIgoreFilesTests/SwiftFormatTests/Utilities/FileIteratorIgnoreTests.swift:134

What to do

  1. Resolve the 35 No assertions finding(s) in Test Quality — start with SwiftFormatterSelectionTests.swift (35). — One of this dimension's main actionable groups (35 warning-level).
  2. Resolve the 9 Skipped test finding(s) in Test Quality — start with FileIteratorTests.swift (5), ConfigurationTests.swift (4). — One of this dimension's main actionable groups (9 warning-level).

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

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 3 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 0 of them read from the licence file the repository carries at the revision Package.resolved pins, and 3 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed Package.resolved pins, direct and transitive, and every declared dependency none pins. 3 of them are declared by a manifest that commits no Package.resolved (a library, whose resolution is its consumer's), so their own dependencies are resolved by whoever builds it and are not in this verdict.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.9 / 10Strong✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift (7×72=504); Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift (3×103=309); Sources/SwiftFormat/PrettyPrint/Comment.swift (2×58=116)

Hotspot: Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift · ×3Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3667

What to do

  1. Resolve the 3 Hotspot finding(s) in Churn × Complexity Hotspots — start with TokenStreamCreator.swift, PrettyPrint.swift, Comment.swift. — One of this dimension's main actionable groups (3 warning-level).

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

D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

5 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift. Counted over 81 of the 130 production source files in this repository: 48 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.8 / 10Stronggated by 24 serious findings✓ Tool-verified

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

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

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

24 deducted task-comment markers across 22211 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×14Tests/SwiftFormatTests/Rules/IdentifiersMustBeASCIITests.swift:28
FixmeComment · ×8Tests/SwiftFormatTests/Rules/BeginDocumentationCommentWithOneLineSummaryTests.swift:16
XxxComment · ×2Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift:2153

What to do

  1. Resolve the 14 TodoComment finding(s) in Explicit Debt — start with TokenStreamCreator.swift (3), CommentTests.swift (2), GroupNumericLiterals.swift (2). — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 8 FixmeComment finding(s) in Explicit Debt — start with CommentTests.swift (2), DiagnosingTestCase.swift (2), BeginDocumentationCommentWithOneLineSummaryTests.swift. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 2 XxxComment finding(s) in Explicit Debt — start with CommentTests.swift (2). — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

No architecture decision records were found.

No ADRs foundPackage.swift:18

What to do

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

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)7.1 / 10Adequategated by 14 critical findings✓ Tool-verified

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

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

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

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

14 finding(s): 0 critical, 14 high, 0 medium, 0 low. 12 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. No action in Static Analysis (SAST) — all 7 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (7 issue-level, 0 of them charged here).
  3. No action in Static Analysis (SAST) — all 5 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (5 issue-level, 0 of them charged here).

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

D35 · Change Coupling9.8 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: SwiftFormatter.swift↔SwiftLinter.swift 67%; PrettyPrint.swift↔TokenStreamCreator.swift 52%

Change coupling: SwiftFormatter.swift ↔ SwiftLinter.swift · ×2Sources/SwiftFormat/API/SwiftFormatter.swift:1

What to do

  1. Resolve the 2 Change coupling finding(s) in Change Coupling — start with SwiftFormatter.swift, PrettyPrint.swift. — One of this dimension's main actionable groups (2 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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.

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

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.3 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

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.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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.

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

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

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

M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

P2 · Observability0.0 / 10Critical✓ Tool-verified

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

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

  • No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.

What to do

  • Write a diagnostic trail the user can hand back with a bug report: log through `os.Logger` (one per subsystem), which the unified log keeps and a sysdiagnose carries to you. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add 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 4 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:10

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.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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

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

P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

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

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

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.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health82%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture96%ExemplaryStrongest area.
Maturity59%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness40%Weak — gated by P2, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security57%Checked 3 of 8Capped at Fair by a Critical contributor — resolve it before relying on this lens.
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 — 2 control(s) we could not find positive evidence for

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

  • 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.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 79 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. 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 — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
  • D12 Dependency Hygiene — Not scored — 6 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (1 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • 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 — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
  • D21 Naming Consistency — N/A — too few peers to establish a naming convention (2296 declarations, no unit with a dominant convention).
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, .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.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 4 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D34 Knowledge Freshness — knowledge concentrated in recent work — freshness signal contradicted by repo activity
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • 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
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, 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 `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not 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 (21,914 lines), c (49 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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — not 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 — 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
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 14 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 239 finding(s)
D10 · Test Quality · No assertions · ×35
  • No assertions: testSingleLineFormatting Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:21 — 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: testMultipleLinesFormatting Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:43 — 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: testDisjointLineRanges Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:65 — 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: testPartiallyWrappedFunctionSignature Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:87 — 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: testComplexExpressionIndentation Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:109 — 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: testMultipleSpacesInsideLine Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:131 — 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: testAdjacentLongLineNotWrapped Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:149 — 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: testDegenerateSignatureIndentation Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:165 — 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: testOutOfBoundsLineRange Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:187 — 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: testEndOfLineCommentAtEndOfSelectionDoesNotLeakFormattingOntoNextLine Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:203 — 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: testPartialOutOfBoundsLineRange Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:237 — 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: testZeroLineRange Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:253 — 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: testMultilineStringLiteralWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:269 — 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: testReflowCommentCompletelyEncompassed Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:349 — 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: testCRLFLineEndingsWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:375 — 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: testReflowCommentFunctionHeaderEncompassedButNotDocComment Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:421 — 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: testBlankLinesWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:448 — 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: testLeadingAndTrailingFileBlankLinesWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:563 — 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: testIndentBlankLinesWithSelection Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:607 — 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: testReflowCommentFunctionHeaderEncompassedButNotDocBlockComment Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:639 — 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: testReflowMultilineLineCommentPartiallyEncompassedFirstLine Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:668 — 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: testReflowMultilineLineCommentPartiallyEncompassedMiddleLine Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:693 — 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: testReflowMultilineLineCommentPartiallyEncompassedLastLine Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:718 — 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: testReflowMultilineLineCommentPartiallyEncompassedAndFunctionHeader Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:743 — 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: testReflowBlockCommentPartiallyEncompassed Tests/SwiftFormatTests/API/SwiftFormatterSelectionTests.swift:772 — 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.
  • + 10 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×14
  • TodoComment Tests/SwiftFormatTests/Rules/IdentifiersMustBeASCIITests.swift:28 — // TODO: It would be nice to allow Δ (among other mathematically meaningful symbols) without — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift:2147 — // TODO: keep this on its own line. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift:2210 — // TODO: keep this on its own line. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/swift-format/PrintVersion.swift:14 — // TODO: Automate updates to this somehow. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/Rules/GroupNumericLiterals.swift:24 — /// TODO: Minimum numeric literal length bounds and numeric groupings have been selected arbitrarily; — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/Rules/GroupNumericLiterals.swift:26 — /// TODO: Handle floating point literals. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/Rules/NeverUseForceTry.swift:23 — /// TODO: Create exception for NSRegularExpression — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/Rules/NeverUseImplicitlyUnwrappedOptionals.swift:23 — /// TODO: Create exceptions for other UI elements (ex: viewDidLoad) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/Rules/UseWhereClausesInForLoops.swift:34 — // TODO: Create an `&&` expression with both conditions? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:651 — // TODO(dabelknap): Handle the unwrapping more gracefully — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:658 — // TODO(dabelknap): Handle the unwrapping more gracefully — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:901 — // TODO: - Other nodes (yet to be organized) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1349 — // TODO: For now, just use the raw text of the node and don't try to format it deeper. In the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3938 — // TODO: It would be nice to restrict this to only allow multiple lines between statements — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D10 · Test Quality · Skipped test · ×9
  • Skipped test: testMissingConfigurationFile Tests/SwiftFormatTests/API/ConfigurationTests.swift:35 — Skipped — throws XCTSkip
  • Skipped test: testMissingConfigurationFileInSubdirectory Tests/SwiftFormatTests/API/ConfigurationTests.swift:47 — Skipped — throws XCTSkip
  • Skipped test: testMissingConfigurationFileMountedDirectory Tests/SwiftFormatTests/API/ConfigurationTests.swift:59 — Skipped — throws XCTSkip
  • Skipped test: testConfigurationWithComments Tests/SwiftFormatTests/API/ConfigurationTests.swift:118 — Skipped — throws XCTSkip
  • Skipped test: testNoFollowSymlinks Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift:75 — Skipped — throws XCTSkip
  • Skipped test: testFollowSymlinks Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift:85 — Skipped — throws XCTSkip
  • Skipped test: testFollowSymlinksToSymlinks Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift:97 — Skipped — throws XCTSkip
  • Skipped test: testSymlinkCyclesAreIgnored Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift:109 — Skipped — throws XCTSkip
  • Skipped test: testTraversesHiddenFilesIfExplicitlySpecified Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift:127 — Skipped — throws XCTSkip
D17 · Explicit Debt · FixmeComment · ×8
  • FixmeComment Tests/SwiftFormatTests/Rules/BeginDocumentationCommentWithOneLineSummaryTests.swift:16 — // FIXME: We should place the diagnostic somewhere in the comment, not on the declaration. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Tests/SwiftFormatTests/Rules/ValidateDocumentationCommentsTests.swift:16 — // FIXME: Diagnostics should be emitted inside the comment, not at the beginning of the declaration. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift:2150 — // FIXME: keep this on its own line. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift:2214 — // FIXME: keep this on its own line. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Tests/SwiftFormatTests/PrettyPrint/PrettyPrintTestCase.swift:73 — // FIXME: It would be nice to check findings when whitespaceOnly == false, but their locations — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:101 — // FIXME: We do this to provide a better error message if the finding is in the right place but — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:178 — // FIXME: We do this to provide a better error message if the note is in the right place but — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift:232 — // FIXME: Stop using these extensions; they make assumptions about the structure of stored — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D3 · God Classes · MethodTooLong · ×4
  • MethodTooLong: OverlongLineReflower.mayReflowIntoPreviousLine Sources/SwiftFormat/PrettyPrint/Comment.swift:1029 — MethodTooLong — mayReflowIntoPreviousLine runs 841 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 741 over it, 8.41× 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.
  • MethodTooLong: MarkdownReflower.visitParagraph Sources/SwiftFormat/PrettyPrint/Comment.swift:1733 — MethodTooLong — visitParagraph runs 365 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× 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.
  • MethodTooLong: Comment.printReflowedBlockComment Sources/SwiftFormat/PrettyPrint/Comment.swift:476 — MethodTooLong — printReflowedBlockComment runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× 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.
  • MethodTooLong: OrderedImports.orderImportsInSlice Sources/SwiftFormat/Rules/OrderedImports.swift:156 — MethodTooLong — orderImportsInSlice runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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 · Edited copy of a member (18 corresponding lines) · ×4
  • Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3451 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3451-3476 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3489-3506 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/Core/LintPipeline.swift:28 — Sources/SwiftFormat/Core/LintPipeline.swift:28-45 | Sources/SwiftFormat/Core/LintPipeline.swift:56-73 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:27 — Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:27-44 | Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:46-63 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Sources/SwiftFormat/Rules/OmitExplicitReturns.swift:45 — Sources/SwiftFormat/Rules/OmitExplicitReturns.swift:45-64 | Sources/SwiftFormat/Rules/OmitExplicitReturns.swift:66-83 — 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×3
  • Hotspot: Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3667 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in TokenStreamCreator.extractLeadingTrivia at line 3667. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 12:33:18 -05:00' --until='2026-11-11 12:33:18 -05:00' --full-history --no-merges -- Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.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.
  • Hotspot: Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:227 — Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in PrettyPrinter.printToken at line 227. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 12:33:18 -05:00' --until='2026-11-11 12:33:18 -05:00' --full-history --no-merges -- Sources/SwiftFormat/PrettyPrint/PrettyPrint.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.
  • Hotspot: Sources/SwiftFormat/PrettyPrint/Comment.swift Sources/SwiftFormat/PrettyPrint/Comment.swift:476 — Sources/SwiftFormat/PrettyPrint/Comment.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in Comment.printReflowedBlockComment at line 476. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 12:33:18 -05:00' --until='2026-11-11 12:33:18 -05:00' --full-history --no-merges -- Sources/SwiftFormat/PrettyPrint/Comment.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.
D3 · God Classes · FileTooLong · ×3
  • FileTooLong: PrettyPrint/TokenStreamCreator.swift Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift — FileTooLong — 2780 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2280 over it, 5.56× 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: PrettyPrint/Comment.swift Sources/SwiftFormat/PrettyPrint/Comment.swift — FileTooLong — 1621 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: OverlongLineReflower (861-2453). The bar is 500 significant lines; this is 1121 over it, 3.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Rules/OrderedImports.swift Sources/SwiftFormat/Rules/OrderedImports.swift — FileTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10 over it, 1.02× 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 copy of a member (11 corresponding lines) · ×3
  • Edited copy of a member (11 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2421 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2421-2431 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2736-2746 — 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) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:137 — Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:137-147 | Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:149-159 — 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) Sources/SwiftFormat/Core/SyntaxProtocol+Convenience.swift:27 — Sources/SwiftFormat/Core/SyntaxProtocol+Convenience.swift:27-37 | Sources/SwiftFormat/Core/SyntaxProtocol+Convenience.swift:50-60 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) Sources/swift-format/Subcommands/LintFormatOptions.swift:155 — Sources/swift-format/Subcommands/LintFormatOptions.swift:155-162 | Sources/swift-format/Subcommands/LintFormatOptions.swift:166-173 — 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) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1633 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1633-1642 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2856-2863 — 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) Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift:106 — Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift:106-115 | Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift:152-159 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:88 — Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:88-103 | Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:115-130 — 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 `Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `type` to `ArrayTypeSyntax` in one and `DictionaryTypeSyntax` 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 (16 lines × 2) Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift:27 — Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift:27-42 | Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift:58-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) build-script-helper.py:189 — build-script-helper.py:189-204 | build-script-helper.py:208-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D17 · Explicit Debt · XxxComment · ×2
  • XxxComment Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift:2153 — // XXX: keep this on its own line. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment Tests/SwiftFormatTests/PrettyPrint/CommentTests.swift:2218 — // XXX: keep this on its own line. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D3 · God Classes · TooManyMethods · ×2
  • TooManyMethods: TokenStreamCreator Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:30 — TooManyMethods — 263 methods. The bar is 30 methods; this is 233 over it, 8.77× 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: Message Sources/SwiftFormat/API/Finding.swift:41 — TooManyMethods — 41 methods, declared across 28 files: Rules/ValidateDocumentationComments.swift (5), PrettyPrint/WhitespaceLinter.swift (3), Rules/NoAccessLevelOnExtensionDeclaration.swift (3), API/Finding.swift (2), +24 more file(s). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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.
D3 · God Classes · ClassTooLong · ×2
  • ClassTooLong: OverlongLineReflower Sources/SwiftFormat/PrettyPrint/Comment.swift:861 — ClassTooLong — 1049 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 649 over it, 2.62× 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.
  • ClassTooLong: Comment Sources/SwiftFormat/PrettyPrint/Comment.swift:77 — ClassTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 134 over it, 1.34× 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.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: SwiftFormatter.swift ↔ SwiftLinter.swift Sources/SwiftFormat/API/SwiftFormatter.swift:1 — `Sources/SwiftFormat/API/SwiftFormatter.swift` and `Sources/SwiftFormat/API/SwiftLinter.swift` change together 67% of the time (14 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 14 shared commits counted here, the most recent 3 are `dba874b4` Fix documentation; `fee42c92` Add `--enable-experimental-feature` to enable those features in the p…; `a0ee6ebd` Don't do anything if the input is empty. — run `git show` on any of them.
  • Change coupling: PrettyPrint.swift ↔ TokenStreamCreator.swift Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:1 — `Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift` and `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift` change together 52% of the time (23 of the 44 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 23 shared commits counted here, the most recent 3 are `97a26e73` Fix selection boundary handling in TokenStreamCreator and PrettyPrint…; `74e8d24a` Fix multiline string literal handling with partial selections and whi…; `893c1b70` Introduce `multilineTrailingCommaBehavior` configuration (#1044) — run `git show` on any of them.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3382 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3382-3394 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3403-3415 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3424-3436 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) Sources/SwiftFormat/Rules/UseLetInEveryBoundCaseVariable.swift:26 — Sources/SwiftFormat/Rules/UseLetInEveryBoundCaseVariable.swift:26-38 | Sources/SwiftFormat/Rules/UseLetInEveryBoundCaseVariable.swift:40-53 | Sources/SwiftFormat/Rules/UseLetInEveryBoundCaseVariable.swift:55-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×2
  • Duplicated block (7 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:682 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:682-688 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2885-2891 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:965 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:965-971 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1017-1023 — 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 `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1017` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2426 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2426-2431 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2741-2746 — 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 `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2426` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2434` calls `before`, `after` and `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2749` 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) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:140 — Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:140-145 | Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:152-157 — 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 `Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: TokenStreamCreator (LCOM4 40) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:30 — TokenStreamCreator's methods fall into 40 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 40 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: Trivia (LCOM4 5) Sources/SwiftFormat/Core/Trivia+Convenience.swift:15 — Trivia'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.
D1 · Cyclomatic Complexity · PrettyPrinter.printToken (cyclomatic 103) · ×1
  • PrettyPrinter.printToken (cyclomatic 103) Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:227 — PrettyPrinter.printToken has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamCreator.extractLeadingTrivia (cyclomatic 72) · ×1
  • TokenStreamCreator.extractLeadingTrivia (cyclomatic 72) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3667 — TokenStreamCreator.extractLeadingTrivia has cyclomatic complexity 72 (threshold 15). Of this number, 51 points are the body's own statements and 21 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Comment.printReflowedBlockComment (cyclomatic 58) · ×1
  • Comment.printReflowedBlockComment (cyclomatic 58) Sources/SwiftFormat/PrettyPrint/Comment.swift:476 — Comment.printReflowedBlockComment has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InlineWordCollector.collectInline (cyclomatic 50) · ×1
  • InlineWordCollector.collectInline (cyclomatic 50) Sources/SwiftFormat/PrettyPrint/Comment.swift:2157 — InlineWordCollector.collectInline has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownReflower.visitParagraph (cyclomatic 47) · ×1
  • MarkdownReflower.visitParagraph (cyclomatic 47) Sources/SwiftFormat/PrettyPrint/Comment.swift:1733 — MarkdownReflower.visitParagraph has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownReflower.visitBlockChildren (cyclomatic 39) · ×1
  • MarkdownReflower.visitBlockChildren (cyclomatic 39) Sources/SwiftFormat/PrettyPrint/Comment.swift:1266 — MarkdownReflower.visitBlockChildren has cyclomatic complexity 39 (threshold 15). Of this number, 24 points are the body's own statements and 15 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InlineWordCollector.collectBracketedInline (cyclomatic 31) · ×1
  • InlineWordCollector.collectBracketedInline (cyclomatic 31) Sources/SwiftFormat/PrettyPrint/Comment.swift:2336 — InlineWordCollector.collectBracketedInline has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PrettyPrinter.prettyPrint (cyclomatic 30) · ×1
  • PrettyPrinter.prettyPrint (cyclomatic 30) Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:625 — PrettyPrinter.prettyPrint has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OrderedImports.orderImportsInSlice (cyclomatic 28) · ×1
  • OrderedImports.orderImportsInSlice (cyclomatic 28) Sources/SwiftFormat/Rules/OrderedImports.swift:156 — OrderedImports.orderImportsInSlice has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownReflower.extractListMarker (cyclomatic 23) · ×1
  • MarkdownReflower.extractListMarker (cyclomatic 23) Sources/SwiftFormat/PrettyPrint/Comment.swift:1547 — MarkdownReflower.extractListMarker has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Selection.collectEdits (cyclomatic 20) · ×1
  • Selection.collectEdits (cyclomatic 20) Sources/SwiftFormat/API/Selection.swift:147 — Selection.collectEdits has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Comment.exceedsMaxLineLength (cyclomatic 20) · ×1
  • Comment.exceedsMaxLineLength (cyclomatic 20) Sources/SwiftFormat/PrettyPrint/Comment.swift:320 — Comment.exceedsMaxLineLength has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Comment.printReflowedLineComment (cyclomatic 19) · ×1
  • Comment.printReflowedLineComment (cyclomatic 19) Sources/SwiftFormat/PrettyPrint/Comment.swift:376 — Comment.printReflowedLineComment has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (flushSegment). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · OverlongLineReflower.reflow (cyclomatic 19) · ×1
  • OverlongLineReflower.reflow (cyclomatic 19) Sources/SwiftFormat/PrettyPrint/Comment.swift:864 — OverlongLineReflower.reflow has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InlineWordCollector.appendBreakableText (cyclomatic 19) · ×1
  • InlineWordCollector.appendBreakableText (cyclomatic 19) Sources/SwiftFormat/PrettyPrint/Comment.swift:2046 — InlineWordCollector.appendBreakableText has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamCreator.insertContextualBreaks (cyclomatic 19) · ×1
  • TokenStreamCreator.insertContextualBreaks (cyclomatic 19) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:4634 — TokenStreamCreator.insertContextualBreaks has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WhitespaceLinter.checkForLineLengthErrors (cyclomatic 18) · ×1
  • WhitespaceLinter.checkForLineLengthErrors (cyclomatic 18) Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:187 — WhitespaceLinter.checkForLineLengthErrors has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DoNotUseSemicolons.nodeByRemovingSemicolons (cyclomatic 18) · ×1
  • DoNotUseSemicolons.nodeByRemovingSemicolons (cyclomatic 18) Sources/SwiftFormat/Rules/DoNotUseSemicolons.swift:30 — DoNotUseSemicolons.nodeByRemovingSemicolons has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OrderedImports.formatImports (cyclomatic 18) · ×1
  • OrderedImports.formatImports (cyclomatic 18) Sources/SwiftFormat/Rules/OrderedImports.swift:405 — OrderedImports.formatImports has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamCreator.appendAfterTokensAndTrailingComments (cyclomatic 17) · ×1
  • TokenStreamCreator.appendAfterTokensAndTrailingComments (cyclomatic 17) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3139 — TokenStreamCreator.appendAfterTokensAndTrailingComments has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WhitespaceLinter.compareWhitespace (cyclomatic 17) · ×1
  • WhitespaceLinter.compareWhitespace (cyclomatic 17) Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:86 — WhitespaceLinter.compareWhitespace has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LintFormatOptions.validate (cyclomatic 17) · ×1
  • LintFormatOptions.validate (cyclomatic 17) Sources/swift-format/Subcommands/LintFormatOptions.swift:117 — LintFormatOptions.validate has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DocumentationCommentText.init (cyclomatic 16) · ×1
  • DocumentationCommentText.init (cyclomatic 16) Sources/SwiftFormat/Core/DocumentationCommentText.swift:54 — DocumentationCommentText.init has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Comment.reflowBlockBodyLines (cyclomatic 16) · ×1
  • Comment.reflowBlockBodyLines (cyclomatic 16) Sources/SwiftFormat/PrettyPrint/Comment.swift:733 — Comment.reflowBlockBodyLines has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (flushSegment). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · MarkdownReflower.visitBlock (cyclomatic 16) · ×1
  • MarkdownReflower.visitBlock (cyclomatic 16) Sources/SwiftFormat/PrettyPrint/Comment.swift:1400 — MarkdownReflower.visitBlock has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamCreator.arrangeAttributeList (cyclomatic 16) · ×1
  • TokenStreamCreator.arrangeAttributeList (cyclomatic 16) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3242 — TokenStreamCreator.arrangeAttributeList has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamCreator.stackedIndentationBehavior (cyclomatic 16) · ×1
  • TokenStreamCreator.stackedIndentationBehavior (cyclomatic 16) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:4414 — TokenStreamCreator.stackedIndentationBehavior has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GitIgnorePattern.doubleAsteriskMatch (cyclomatic 16) · ×1
  • GitIgnorePattern.doubleAsteriskMatch (cyclomatic 16) Sources/SwiftFormat/Utilities/GitIgnorePattern.swift:150 — GitIgnorePattern.doubleAsteriskMatch 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.
D12 · Dependency Hygiene · Floating branch dependency · ×1
  • Floating branch dependency: swift-syntax — Dependency `swift-syntax` is declared in Package.swift against branch `main` — the declaration pins no immutable point, so `swift package update` moves this dependency to whatever that branch holds at the time, which is code nobody reviewed. Pin it to a version requirement (`from:`, `.upToNextMajor(from:)`, `exact:`) or to a `revision:` commit SHA.
D2 · Cognitive Complexity · PrettyPrinter.printToken (cognitive 150) · ×1
  • PrettyPrinter.printToken (cognitive 150) Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:227 — PrettyPrinter.printToken has cognitive complexity 150 (threshold 15). Drivers by points: if/else 39 (88 pts), boolean chains 36, match/switch 6 (13 pts), ternaries 4 (13 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamCreator.extractLeadingTrivia (cognitive 136) · ×1
  • TokenStreamCreator.extractLeadingTrivia (cognitive 136) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3667 — TokenStreamCreator.extractLeadingTrivia has cognitive complexity 136 (threshold 15). Drivers by points: if/else 40 (92 pts), boolean chains 17, match/switch 6 (14 pts), loops 6 (9 pts), ternaries 2 (4 pts) (nesting depth added 65). Of this number, 96 points are the body's own statements and 40 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Comment.printReflowedBlockComment (cognitive 93) · ×1
  • Comment.printReflowedBlockComment (cognitive 93) Sources/SwiftFormat/PrettyPrint/Comment.swift:476 — Comment.printReflowedBlockComment has cognitive complexity 93 (threshold 15). Drivers by points: if/else 35 (49 pts), ternaries 13 (23 pts), boolean chains 13, loops 5 (8 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownReflower.visitParagraph (cognitive 77) · ×1
  • MarkdownReflower.visitParagraph (cognitive 77) Sources/SwiftFormat/PrettyPrint/Comment.swift:1733 — MarkdownReflower.visitParagraph has cognitive complexity 77 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 9 (24 pts), boolean chains 20, loops 4 (6 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InlineWordCollector.collectInline (cognitive 67) · ×1
  • InlineWordCollector.collectInline (cognitive 67) Sources/SwiftFormat/PrettyPrint/Comment.swift:2157 — InlineWordCollector.collectInline has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (40 pts), boolean chains 21, loops 1 (3 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 26). 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.
D2 · Cognitive Complexity · InlineWordCollector.collectBracketedInline (cognitive 50) · ×1
  • InlineWordCollector.collectBracketedInline (cognitive 50) Sources/SwiftFormat/PrettyPrint/Comment.swift:2336 — InlineWordCollector.collectBracketedInline has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 11, loops 3 (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.
D2 · Cognitive Complexity · PrettyPrinter.prettyPrint (cognitive 43) · ×1
  • PrettyPrinter.prettyPrint (cognitive 43) Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift:625 — PrettyPrinter.prettyPrint has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (27 pts), ternaries 2 (7 pts), match/switch 2 (5 pts), boolean chains 2, loops 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Comment.exceedsMaxLineLength (cognitive 40) · ×1
  • Comment.exceedsMaxLineLength (cognitive 40) Sources/SwiftFormat/PrettyPrint/Comment.swift:320 — Comment.exceedsMaxLineLength has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 2 (8 pts), boolean chains 4, loops 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · Selection.collectEdits (cognitive 38) · ×1
  • Selection.collectEdits (cognitive 38) Sources/SwiftFormat/API/Selection.swift:147 — Selection.collectEdits has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (10 pts), boolean chains 6 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamCreator.visit (cognitive 38) · ×1
  • TokenStreamCreator.visit (cognitive 38) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2171 — TokenStreamCreator.visit has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OrderedImports.orderImportsInSlice (cognitive 37) · ×1
  • OrderedImports.orderImportsInSlice (cognitive 37) Sources/SwiftFormat/Rules/OrderedImports.swift:156 — OrderedImports.orderImportsInSlice has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 3 (9 pts), boolean chains 6, loops 1 (nesting depth added 15). Of this number, 33 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OverlongLineReflower.reflow (cognitive 35) · ×1
  • OverlongLineReflower.reflow (cognitive 35) Sources/SwiftFormat/PrettyPrint/Comment.swift:864 — OverlongLineReflower.reflow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 5 (13 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownReflower.extractListMarker (cognitive 35) · ×1
  • MarkdownReflower.extractListMarker (cognitive 35) Sources/SwiftFormat/PrettyPrint/Comment.swift:1547 — MarkdownReflower.extractListMarker has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 9 (12 pts), boolean chains 10 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamCreator.insertContextualBreaks (cognitive 34) · ×1
  • TokenStreamCreator.insertContextualBreaks (cognitive 34) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:4634 — TokenStreamCreator.insertContextualBreaks has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownReflower.visitBlockChildren (cognitive 33) · ×1
  • MarkdownReflower.visitBlockChildren (cognitive 33) Sources/SwiftFormat/PrettyPrint/Comment.swift:1266 — MarkdownReflower.visitBlockChildren has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 12, ternaries 2 (5 pts), loops 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MarkdownReflower.visitBlockChildren::emitUnvisitedGap) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · InlineWordCollector.appendBreakableText (cognitive 33) · ×1
  • InlineWordCollector.appendBreakableText (cognitive 33) Sources/SwiftFormat/PrettyPrint/Comment.swift:2046 — InlineWordCollector.appendBreakableText has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 11, loops 3 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamCreator.appendAfterTokensAndTrailingComments (cognitive 32) · ×1
  • TokenStreamCreator.appendAfterTokensAndTrailingComments (cognitive 32) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3139 — TokenStreamCreator.appendAfterTokensAndTrailingComments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (4 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 15). Of this number, 28 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamCreator.arrangeAttributeList (cognitive 31) · ×1
  • TokenStreamCreator.arrangeAttributeList (cognitive 31) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3242 — TokenStreamCreator.arrangeAttributeList has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (8 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitIgnorePattern.doubleAsteriskMatch (cognitive 31) · ×1
  • GitIgnorePattern.doubleAsteriskMatch (cognitive 31) Sources/SwiftFormat/Utilities/GitIgnorePattern.swift:150 — GitIgnorePattern.doubleAsteriskMatch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (10 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderedImports.swift.generateLines (cognitive 31) · ×1
  • OrderedImports.swift.generateLines (cognitive 31) Sources/SwiftFormat/Rules/OrderedImports.swift:511 — OrderedImports.swift.generateLines has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (9 pts), match/switch 2 (7 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderedImports.checkGrouping (cognitive 30) · ×1
  • OrderedImports.checkGrouping (cognitive 30) Sources/SwiftFormat/Rules/OrderedImports.swift:334 — OrderedImports.checkGrouping has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 5 (14 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderedImports.formatImports (cognitive 30) · ×1
  • OrderedImports.formatImports (cognitive 30) Sources/SwiftFormat/Rules/OrderedImports.swift:405 — OrderedImports.formatImports has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 7, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentationCommentText.init (cognitive 29) · ×1
  • DocumentationCommentText.init (cognitive 29) Sources/SwiftFormat/Core/DocumentationCommentText.swift:54 — DocumentationCommentText.init has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 13). Of this number, 26 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Comment.printReflowedLineComment (cognitive 27) · ×1
  • Comment.printReflowedLineComment (cognitive 27) Sources/SwiftFormat/PrettyPrint/Comment.swift:376 — Comment.printReflowedLineComment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 5 (6 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to one function item inside it that branches (flushSegment). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DoNotUseSemicolons.nodeByRemovingSemicolons (cognitive 27) · ×1
  • DoNotUseSemicolons.nodeByRemovingSemicolons (cognitive 27) Sources/SwiftFormat/Rules/DoNotUseSemicolons.swift:30 — DoNotUseSemicolons.nodeByRemovingSemicolons has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 10, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhitespaceLinter.compareWhitespace (cognitive 26) · ×1
  • WhitespaceLinter.compareWhitespace (cognitive 26) Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:86 — WhitespaceLinter.compareWhitespace has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Line.description (cognitive 26) · ×1
  • Line.description (cognitive 26) Sources/SwiftFormat/Rules/OrderedImports.swift:785 — Line.description has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (5 pts), loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileIterator.next (cognitive 26) · ×1
  • FileIterator.next (cognitive 26) Sources/SwiftFormat/Utilities/FileIterator.swift:90 — FileIterator.next has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportsAnyTestingLibrary.swift.statementsImportAnyTestLibrary (cognitive 26) · ×1
  • ImportsAnyTestingLibrary.swift.statementsImportAnyTestLibrary (cognitive 26) Sources/SwiftFormat/Core/ImportsAnyTestingLibrary.swift:39 — ImportsAnyTestingLibrary.swift.statementsImportAnyTestLibrary has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Comment.pragmaLineIndices (cognitive 25) · ×1
  • Comment.pragmaLineIndices (cognitive 25) Sources/SwiftFormat/PrettyPrint/Comment.swift:207 — Comment.pragmaLineIndices has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (10 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OverlongLineReflower.splitAtLastWhitespace (cognitive 25) · ×1
  • OverlongLineReflower.splitAtLastWhitespace (cognitive 25) Sources/SwiftFormat/PrettyPrint/Comment.swift:958 — OverlongLineReflower.splitAtLastWhitespace has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleCollector.detectedRule (cognitive 25) · ×1
  • RuleCollector.detectedRule (cognitive 25) Sources/_GenerateSwiftFormat/RuleCollector.swift:90 — RuleCollector.detectedRule has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownReflower.visitListItems (cognitive 24) · ×1
  • MarkdownReflower.visitListItems (cognitive 24) Sources/SwiftFormat/PrettyPrint/Comment.swift:1485 — MarkdownReflower.visitListItems has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitIgnorePattern.globMatchRecursive (cognitive 24) · ×1
  • GitIgnorePattern.globMatchRecursive (cognitive 24) Sources/SwiftFormat/Utilities/GitIgnorePattern.swift:248 — GitIgnorePattern.globMatchRecursive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownReflower.visitBlock (cognitive 23) · ×1
  • MarkdownReflower.visitBlock (cognitive 23) Sources/SwiftFormat/PrettyPrint/Comment.swift:1400 — MarkdownReflower.visitBlock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, loops 1 (3 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 10). 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.
D2 · Cognitive Complexity · UseSynthesizedInitializer.matchesAssignmentBody (cognitive 23) · ×1
  • UseSynthesizedInitializer.matchesAssignmentBody (cognitive 23) Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift:144 — UseSynthesizedInitializer.matchesAssignmentBody has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Trivia.trimmingSuperfluousNewlines (cognitive 23) · ×1
  • Trivia.trimmingSuperfluousNewlines (cognitive 23) Sources/SwiftFormat/Core/Trivia+Convenience.swift:130 — Trivia.trimmingSuperfluousNewlines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UseShorthandTypeNames.visit (cognitive 22) · ×1
  • UseShorthandTypeNames.visit (cognitive 22) Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift:25 — UseShorthandTypeNames.visit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UseSynthesizedInitializer.visit (cognitive 22) · ×1
  • UseSynthesizedInitializer.visit (cognitive 22) Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift:26 — UseSynthesizedInitializer.visit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamCreator.visit (cognitive 21) · ×1
  • TokenStreamCreator.visit (cognitive 21) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2341 — TokenStreamCreator.visit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhitespaceLinter.checkForLineLengthErrors (cognitive 21) · ×1
  • WhitespaceLinter.checkForLineLengthErrors (cognitive 21) Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:187 — WhitespaceLinter.checkForLineLengthErrors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OneCasePerLine.visit (cognitive 21) · ×1
  • OneCasePerLine.visit (cognitive 21) Sources/SwiftFormat/Rules/OneCasePerLine.swift:120 — OneCasePerLine.visit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · FileIterator.nextInDirectory (cognitive 21) · ×1
  • FileIterator.nextInDirectory (cognitive 21) Sources/SwiftFormat/Utilities/FileIterator.swift:144 — FileIterator.nextInDirectory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Message.indentationError (cognitive 20) · ×1
  • Message.indentationError (cognitive 20) Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:468 — Message.indentationError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · Comment.reflowBlockBodyLines (cognitive 20) · ×1
  • Comment.reflowBlockBodyLines (cognitive 20) Sources/SwiftFormat/PrettyPrint/Comment.swift:733 — Comment.reflowBlockBodyLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (5 pts), boolean chains 4, ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (flushSegment). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · TokenStreamCreator.appendToken (cognitive 20) · ×1
  • TokenStreamCreator.appendToken (cognitive 20) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:4099 — TokenStreamCreator.appendToken has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 3 (7 pts), boolean chains 6 (nesting depth added 6). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamCreator.stackedIndentationBehavior (cognitive 20) · ×1
  • TokenStreamCreator.stackedIndentationBehavior (cognitive 20) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:4414 — TokenStreamCreator.stackedIndentationBehavior has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UseShorthandTypeNames.visit (cognitive 19) · ×1
  • UseShorthandTypeNames.visit (cognitive 19) Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift:115 — UseShorthandTypeNames.visit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UseSynthesizedInitializer.matchesPropertyList (cognitive 19) · ×1
  • UseSynthesizedInitializer.matchesPropertyList (cognitive 19) Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift:108 — UseSynthesizedInitializer.matchesPropertyList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LintFormatOptions.validate (cognitive 19) · ×1
  • LintFormatOptions.validate (cognitive 19) Sources/swift-format/Subcommands/LintFormatOptions.swift:117 — LintFormatOptions.validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Selection.resolved (cognitive 18) · ×1
  • Selection.resolved (cognitive 18) Sources/SwiftFormat/API/Selection.swift:47 — Selection.resolved has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 8). 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.
D2 · Cognitive Complexity · Comment.print (cognitive 18) · ×1
  • Comment.print (cognitive 18) Sources/SwiftFormat/PrettyPrint/Comment.swift:138 — Comment.print has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 1 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 10). 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.
D2 · Cognitive Complexity · MarkdownReflower.visitBlockChildren · ×1
  • MarkdownReflower.visitBlockChildren::emitUnvisitedGap (cognitive 18) Sources/SwiftFormat/PrettyPrint/Comment.swift:1304 — MarkdownReflower.visitBlockChildren::emitUnvisitedGap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MarkdownReflower.visitBlockChildren) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ConfigurationProvider.provide (cognitive 18) · ×1
  • ConfigurationProvider.provide (cognitive 18) Sources/swift-format/Frontend/Frontend.swift:97 — ConfigurationProvider.provide has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentationComment.extractParameterOutline (cognitive 17) · ×1
  • DocumentationComment.extractParameterOutline (cognitive 17) Sources/SwiftFormat/Core/DocumentationComment.swift:145 — DocumentationComment.extractParameterOutline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmitExplicitReturns.transformAccessorBlock (cognitive 17) · ×1
  • OmitExplicitReturns.transformAccessorBlock (cognitive 17) Sources/SwiftFormat/Rules/OmitExplicitReturns.swift:103 — OmitExplicitReturns.transformAccessorBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, match/switch 1 (nesting depth added 4). 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.
D2 · Cognitive Complexity · UseTripleSlashForDocumentationComments.rewrittenDocCommentLeadingTrivia (cognitive 17) · ×1
  • UseTripleSlashForDocumentationComments.rewrittenDocCommentLeadingTrivia (cognitive 17) Sources/SwiftFormat/Rules/UseTripleSlashForDocumentationComments.swift:88 — UseTripleSlashForDocumentationComments.rewrittenDocCommentLeadingTrivia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AlwaysUseLowerCamelCase.collectTestMethods (cognitive 16) · ×1
  • AlwaysUseLowerCamelCase.collectTestMethods (cognitive 16) Sources/SwiftFormat/Rules/AlwaysUseLowerCamelCase.swift:160 — AlwaysUseLowerCamelCase.collectTestMethods has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleCollector.collect (cognitive 16) · ×1
  • RuleCollector.collect (cognitive 16) Sources/_GenerateSwiftFormat/RuleCollector.swift:53 — RuleCollector.collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1435 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1435-1450 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1452-1466 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1468-1483 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1788-1802 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2518-2528 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (89 corresponding lines) · ×1
  • Edited copy of a member (89 corresponding lines) Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift:25 — Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift:25-113 | Sources/SwiftFormat/Rules/UseShorthandTypeNames.swift:115-208 — These two members are one piece of code written twice and then edited apart: 89 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1649 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1649-1677 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2882-2914 — 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 (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:370 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:370-411 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:413-444 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift:25 — Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift:25-52 | Sources/SwiftFormat/Rules/ReturnVoidInsteadOfEmptyTuple.swift:54-96 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1582 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1582-1597 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1719-1734 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) Sources/SwiftFormat/API/SwiftFormatter.swift:57 — Sources/SwiftFormat/API/SwiftFormatter.swift:57-77 | Sources/SwiftFormat/API/SwiftLinter.swift:55-73 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:85 — Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:85-110 | Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:112-135 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) Sources/SwiftFormat/API/SwiftFormatter.swift:101 — Sources/SwiftFormat/API/SwiftFormatter.swift:101-129 | Sources/SwiftFormat/API/SwiftLinter.swift:125-151 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×1
  • Edited copy of a member (14 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:981 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:981-994 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1013-1027 — 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 copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1827 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1827-1843 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1845-1861 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1863-1878 — 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 (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) Sources/SwiftFormat/Rules/OmitExplicitReturns.swift:25 — Sources/SwiftFormat/Rules/OmitExplicitReturns.swift:25-43 | Sources/SwiftFormat/Rules/OmitExplicitReturns.swift:85-101 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2006 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2006-2015 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2496-2504 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2530-2538 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2775-2783 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:973 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:973-979 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1000-1011 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×1
  • Edited copy of a member (9 corresponding lines) Sources/SwiftFormat/Core/RuleMask.swift:80 — Sources/SwiftFormat/Core/RuleMask.swift:80-88 | Sources/SwiftFormat/Core/RuleMask.swift:95-104 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2271 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2271-2276 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2278-2283 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) Sources/SwiftFormat/Rules/NoParensAroundConditions.swift:68 — Sources/SwiftFormat/Rules/NoParensAroundConditions.swift:68-80 | Sources/SwiftFormat/Rules/NoParensAroundConditions.swift:82-94 — 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 (6 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 14+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:189 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:189-202 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:204-217 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:219-232 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:234-247 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:249-263 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:265-281 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies 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) Sources/SwiftFormat/Rules/NoParensAroundConditions.swift:29 — Sources/SwiftFormat/Rules/NoParensAroundConditions.swift:29-41 | Sources/SwiftFormat/Rules/NoParensAroundConditions.swift:57-66 | Sources/SwiftFormat/Rules/NoParensAroundConditions.swift:96-105 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1753 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1753-1757 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1764-1768 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1992-2004 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1288 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1288-1292 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1774-1780 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1617 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1617-1625 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1985-1990 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2875-2880 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 5+ corresponding lines) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1782 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1782-1786 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1804-1808 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1816-1820 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2942-2946 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) Sources/SwiftFormat/Rules/NeverForceUnwrap.swift:45 — Sources/SwiftFormat/Rules/NeverForceUnwrap.swift:45-55 | Sources/SwiftFormat/Rules/NeverUseForceTry.swift:37-46 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/SwiftFormat/Core/RuleMask.swift:183 — Sources/SwiftFormat/Core/RuleMask.swift:183-193 | Sources/SwiftFormat/Core/RuleMask.swift:195-201 | Sources/SwiftFormat/Core/RuleMask.swift:203-209 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) Sources/SwiftFormat/Rules/NoAccessLevelOnExtensionDeclaration.swift:42 — Sources/SwiftFormat/Rules/NoAccessLevelOnExtensionDeclaration.swift:42-57 | Sources/SwiftFormat/Core/SyntaxFormatRule.swift:50-64 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 3+ corresponding lines) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:221 — Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:221-226 | Sources/SwiftFormat/Rules/AlwaysUseLowerCamelCase.swift:231-236 | Sources/SwiftFormat/Rules/DontRepeatTypeInStaticProperties.swift:72-74 | Sources/SwiftFormat/Rules/OrderedImports.swift:866-868 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1083 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1083-1104 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1375-1395 — 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 `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1083` 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:30 — Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:30-44 | Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:49-63 — 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 `Sources/SwiftFormat/Rules/AlwaysUseLiteralForEmptyCollectionInit.swift:30` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1660 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1660-1673 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2361-2373 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2897-2910 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1660` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×1
  • Duplicated block (13 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1585 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1585-1597 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1722-1734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×1
  • Duplicated block (12 lines × 2) Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:204 — Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:204-215 | Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:229-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1438 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1438-1448 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1454-1464 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1471-1481 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1790-1800 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1437` calls `arrangeAttributeList` and `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1453` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3384 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3384-3394 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3405-3415 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3426-3436 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:3384` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–10 lines × 5) · ×1
  • Duplicated block (8–10 lines × 5) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1441 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1441-1450 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1457-1466 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1474-1483 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1793-1802 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2521-2528 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1441` 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, `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1470` calls `arrangeAttributeList` and `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1454` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×1
  • Duplicated block (10 lines × 2) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1828 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1828-1837 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1846-1855 — 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 `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:1828` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×1
  • Duplicated block (9 lines × 2) Sources/SwiftFormat/API/SwiftFormatter.swift:60 — Sources/SwiftFormat/API/SwiftFormatter.swift:60-68 | Sources/SwiftFormat/API/SwiftLinter.swift:57-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 `Sources/SwiftFormat/API/SwiftFormatter.swift:60` 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×1
  • Duplicated block (8 lines × 2) Sources/SwiftFormat/PrettyPrint/Comment.swift:1805 — Sources/SwiftFormat/PrettyPrint/Comment.swift:1805-1812 | Sources/SwiftFormat/PrettyPrint/Comment.swift:1868-1875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2497 — Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2497-2504 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2531-2538 | Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2776-2783 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2542` calls `after` and `Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift:2507` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×1
  • Duplicated block (5 lines × 2) Sources/SwiftFormat/Rules/GroupNumericLiterals.swift:40 — Sources/SwiftFormat/Rules/GroupNumericLiterals.swift:40-44 | Sources/SwiftFormat/Rules/GroupNumericLiterals.swift:46-50 — 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 `Sources/SwiftFormat/Rules/GroupNumericLiterals.swift:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:84 — Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:84-160 | Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:162-209 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (43–44 lines × 2) · ×1
  • Duplicated block (43–44 lines × 2) Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:88 — Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:88-131 | Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:166-208 — 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 `Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:88` 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:60 — Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:60-82 | Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:138-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift:60` 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.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: SwiftFormat (SwiftPM) — SwiftFormat (SwiftPM): abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
Minor — 11 finding(s)
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 4 significant file(s) lose their only recent owner: Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift, Sources/SwiftFormat/API/Selection.swift, Sources/SwiftFormat/Core/LintPipeline.swift, Sources/SwiftFormat/Core/Rule.swift. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (5 single-owned of 81 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 81 of the 130 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Sources/SwiftFormat/Core/ImportsAnyTestingLibrary.swift.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found Package.swift:18 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `Package.swift` makes this repository a deployable product (line 18).
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:10 — 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 4 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.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X10 · Duplicated predicate · Duplicated predicate · ×1
  • Duplicated predicate Plugins/FormatPlugin/plugin.swift:34 — `process.terminationReason == .exit && process.terminationStatus == 0` appears character-identically in 2 files — Plugins/FormatPlugin/plugin.swift, Plugins/LintPlugin/plugin.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.
Minor — 2 finding(s)
D10 · Test Quality · Skipped (documented) · ×1
  • Skipped (documented): fileIteratorWithMultipleNonEmptySwiftIgoreFiles Tests/SwiftFormatTests/Utilities/FileIteratorIgnoreTests.swift:134 — Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
D12 · Dependency Hygiene · Dependency hygiene PARTLY measured · ×1
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established — This repository's SwiftPM dependencies were read for PINNING discipline: 6 declaration(s) across 1 `Package.swift` manifest(s), against 0 committed pin(s). 1 pinning defect(s) are reported as separate rows below. That is only PART of dependency hygiene, so this dimension is NOT SCORED: whether any of these packages has a newer release is the dependency-CURRENCY question, and no dependency here resolves to a VERSION to ask about — each is pinned to a branch or a revision, which tracks whatever that ref points at and therefore cannot be behind a release. A clean pinning pass is NOT an all-clear for these dependencies, and it is not a finding that they are all USED. Note also what is deliberately NOT charged here: a published LIBRARY correctly commits no `Package.resolved` (SwiftPM ignores a library's resolution when the package is consumed), and a `path:` dependency is a local directory and the tightest possible binding, not a floating one. Known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-0b818a6663e74ebcb2348281b8544c7f/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-0b818a6663e74ebcb2348281b8544c7f/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .14artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 4 file(s) — `Sources/SwiftFormat/Core/RuleMask.swift`, `Sources/SwiftFormat/Core/SyntaxTraits.swift`, `Sources/SwiftFormat/PrettyPrint/Comment.swift`, `Sources/SwiftFormat/Utilities/FileIterator.swift` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).0—

Run 01a1dc3c-05cb-73b0-93b8-fe87ca5507e3 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md