Public report of swiftlang/swift-foundation, 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:55 UTC · Survey ID cd_4c6decbf48a5438da08ad0c3cc4f4ce0

swiftlang/swift-foundation

Measured 14 November 2026, 22:54 UTC, at code version d53ce9c

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

CAI score 65out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Down 1 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 large codebase: 143,856 lines of product code in 12 projects, tests not counted · Estimated rebuild effort: about 1.7 person-years · Weakest lens: Production Readiness, 56

Findings by how serious they are

13 critical 1974 serious 149 minor

34 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:54 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 ▸

37of 37 dimensions measured by tools.
2121of 2136 findings point to an exact file and line, so you can open each one in the code. The other 15 concern the repository as a whole, such as missing documentation.
37dimensions across 6 lenses, read from 143,856 lines of product code in 12 projects.
Chapters

Executive summary

swiftlang/swift-foundation falls short of our standard for production, in part because two passwords or keys sit in the current code. It scores 65 out of 100 and is rated Adequate, and all 13 of its critical findings are security problems.

Production Readiness, at 56, is the weakest lens and counts most in the score. The best first step is replacing the two exposed passwords or keys and switching the old ones off, worth about 8 points. Adding automated security scanning comes next, worth about 5 points. Raising Production Readiness to 70 would lift the score to about 70.

Ten pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Two passwords or keys are open to anyone who can read the repository, and one automatic update takes new releases before a bad one can be spotted. Pinning each tool to an exact version, replacing each exposed password or key and setting a waiting period for automatic updates would close these risks.

The product code is 143,856 lines, about €250,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 56 · counts for 46%Code Health 64 · counts for 25%Maturity 70 · counts for 14%Security and Compliance 85 · counts for 8%Architecture 95 · counts for 4%Performance 97 · counts for 2%

If Production Readiness rose from 56 to 70, the lowest score rated Strong, the score would rise from 65 to about 70.

Code composition: what the lines of code are
Product code 68%Tests 32%
New since the last survey: 516 findings

These 516 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 · _CalendarChinese.addingComponents (cyclomatic 76) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cyclomatic Complexity · DatePatternFormatter.appendField (cyclomatic 72) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • Cyclomatic Complexity · update-date-format-data-impl.swift.parseLocale (cyclomatic 43) utils/update-date-format-data-impl.swift
  • Cyclomatic Complexity · _CalendarChinese.makeDate (cyclomatic 38) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cyclomatic Complexity · _CalendarFixedMonth.range (cyclomatic 35) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cyclomatic Complexity · _CalendarFixedMonth.ordinality (cyclomatic 25) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cyclomatic Complexity · _CalendarFixedMonth.rolled (cyclomatic 25) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cyclomatic Complexity · DatePatternFormatter.fill (cyclomatic 22) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • Cyclomatic Complexity · DatePatternFormatter.appendLocalizedGMT (cyclomatic 22) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • Cyclomatic Complexity · DataLocaleIdentifier.parseBaseName (cyclomatic 22) Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift
  • Cyclomatic Complexity · _CalendarFixedMonth.rataDie (cyclomatic 21) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cyclomatic Complexity · DateComponents.description (cyclomatic 20) Sources/FoundationEssentials/Calendar/DateComponents.swift
  • Cyclomatic Complexity · BuildDateFormatData.main (cyclomatic 20) utils/build-date-format-data-impl.swift
  • Cyclomatic Complexity · _CalendarFixedMonth.dateComponents (cyclomatic 19) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cyclomatic Complexity · cldr-locale-fallback.swift.icuLocales (cyclomatic 19) utils/cldr-locale-fallback.swift
  • Cyclomatic Complexity · _CalendarFixedMonth.date (cyclomatic 18) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cyclomatic Complexity · GenerateDateFormatData.main (cyclomatic 17) utils/update-date-format-data-impl.swift
  • Cyclomatic Complexity · _CalendarUtility.orderedDifferenceComponents (cyclomatic 16) Sources/FoundationEssentials/Calendar/CalendarUtility.swift
  • Cyclomatic Complexity · _CalendarFixedMonth.date (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cognitive Complexity · _CalendarChinese.addingComponents (cognitive 130) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cognitive Complexity · update-date-format-data-impl.swift.parseLocale (cognitive 103) utils/update-date-format-data-impl.swift
  • Cognitive Complexity · DatePatternFormatter.appendField (cognitive 72) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • Cognitive Complexity · _CalendarChinese.makeDate (cognitive 47) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cognitive Complexity · DataLocaleIdentifier.parseBaseName (cognitive 40) Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift
  • Cognitive Complexity · _CalendarFixedMonth.range (cognitive 37) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cognitive Complexity · DatePatternFormatter.fill (cognitive 37) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • Cognitive Complexity · DatePatternFormatter.appendLocalizedGMT (cognitive 34) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • Cognitive Complexity · _CalendarFixedMonth.rolled (cognitive 25) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cognitive Complexity · BuildDateFormatData.main (cognitive 24) utils/build-date-format-data-impl.swift
  • Cognitive Complexity · _CalendarFixedMonth.rataDie (cognitive 23) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cognitive Complexity · _CalendarFixedMonth.dateComponents (cognitive 22) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cognitive Complexity · GenerateDateFormatData.main (cognitive 22) utils/update-date-format-data-impl.swift
  • Cognitive Complexity · cldr-locale-fallback.swift.icuLocales (cognitive 21) utils/cldr-locale-fallback.swift
  • Cognitive Complexity · _CalendarUtility.differenceBySearch (cognitive 20) Sources/FoundationEssentials/Calendar/CalendarUtility.swift
  • Cognitive Complexity · _CalendarFixedMonth.date (cognitive 20) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cognitive Complexity · DateComponents.description (cognitive 19) Sources/FoundationEssentials/Calendar/DateComponents.swift
  • Cognitive Complexity · DatePatternFormatter.capitalizationUsage (cognitive 19) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • Cognitive Complexity · DataLocaleIdentifier.init (cognitive 19) Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift
  • Cognitive Complexity · StringPool.init (cognitive 19) utils/build-date-format-data-impl.swift
  • Cognitive Complexity · Keywords.regionalBaseName (cognitive 18) Sources/_FoundationInternationalizationData/DateFormatLookup.swift
  • Cognitive Complexity · _CalendarFixedMonth.date (cognitive 17) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • Cognitive Complexity · _CalendarFixedMonth.ordinality (cognitive 16) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • God Classes · FileTooLong: Calendar/Calendar_FixedMonth.swift Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • God Classes · MethodTooLong: _CalendarChinese.addingComponents Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • God Classes · MethodTooLong: DatePatternFormatter.appendField Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • God Classes · ClassTooLong: _CalendarFixedMonth Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift
  • God Classes · ClassTooLong: DatePatternFormatter Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • God Classes · FileTooLong: Date/DatePatternFormatter.swift Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift
  • God Classes · FunctionTooLong: build-list-format-data-impl.swift.pack utils/build-list-format-data-impl.swift
  • God Classes · FileTooLong: Locale/Locale+Components_ICU.swift Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift
  • God Classes · FileTooLong: JSON/JSONPrimitive.swift Sources/FoundationEssentials/JSON/JSONPrimitive.swift
  • Code Duplication · Near-duplicate member pair (71 shared lines) Sources/FoundationEssentials/CharacterSet/Annex.swift
  • Code Duplication · Near-duplicate member pair (64 shared lines) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Edited copy of a member (31 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift
  • Code Duplication · Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/URL/URL.swift
  • Code Duplication · Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/URL/URL.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Edited copy of a member (126 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (81 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift
  • Code Duplication · Edited copy of a member (64 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Edited copy of a member (97 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (60 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift
  • Code Duplication · Edited copy of a member (38 corresponding lines) Sources/FoundationEssentials/String/StringProtocol+Essentials.swift
  • Code Duplication · Edited copy of a member (34 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift
  • Code Duplication · Edited copy of a member (19 corresponding lines) Sources/FoundationEssentials/Calendar/CalendarUtility.swift
  • Code Duplication · Edited copy of a member (41 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (55 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift
  • Code Duplication · Edited copy of a member (46 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift
  • Code Duplication · Edited copy of a member (38 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Edited copy of a member (33 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (30 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift
  • Code Duplication · Edited copy of a member (23 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Edited copy of a member (34 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift
  • Code Duplication · Edited copy of a member (31 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift
  • Code Duplication · Edited copy of a member (22 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift
  • Code Duplication · Edited copy of a member (58 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift
  • Code Duplication · Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift
  • Code Duplication · Edited copy of a member (28 corresponding lines) Sources/FoundationEssentials/FileManager/FileOperations.swift
  • Code Duplication · Edited copy of a member (39 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift
  • Code Duplication · Edited copy of a member (63 corresponding lines) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift
  • Code Duplication · Edited copy of a member (24 corresponding lines) Sources/FoundationInternationalization/String/KeyPathComparator.swift
  • Code Duplication · Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift
  • Code Duplication · Edited copy of a member (26 corresponding lines) Sources/FoundationEssentials/Locale/Locale_Preferences.swift
  • Code Duplication · Edited copy of a member (27 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift
  • Code Duplication · Edited copy of a member (37 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift
  • Code Duplication · Edited copy of a member (15 corresponding lines) Sources/FoundationEssentials/Data/Data+Reading.swift
  • Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift
  • Code Duplication · Edited copy of a member (32 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift
  • Code Duplication · Edited copy of a member (26 corresponding lines) Sources/FoundationInternationalization/ICU/ICU+Foundation.swift
  • Code Duplication · Edited copy of a member (26 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Edited copy of a member (35 corresponding lines) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift
  • Code Duplication · Edited copy of a member (17 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift
  • Code Duplication · Edited copy of a member (21 corresponding lines) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift
  • Code Duplication · Edited copy of a member (30 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift
  • Code Duplication · Edited copy of a member (16 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift
  • Code Duplication · Edited copy of a member (35 corresponding lines) Sources/FoundationInternationalization/URLParser+ICU.swift
  • Code Duplication · Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift
  • Code Duplication · Edited copy of a member (21 corresponding lines) Sources/FoundationEssentials/String/String+IO.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: 94 findings

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

  • Cyclomatic Complexity · _CalendarChinese.date (cyclomatic 60) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cyclomatic Complexity · _CalendarChinese.date (cyclomatic 21) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cyclomatic Complexity · _CalendarChinese.dateInterval (cyclomatic 17) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cyclomatic Complexity · _CalendarChinese.orderedDifferenceComponents (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cognitive Complexity · _CalendarChinese.date (cognitive 73) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Cognitive Complexity · _CalendarChinese.date (cognitive 23) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • God Classes · MethodTooLong: _CalendarChinese.date Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Near-duplicate member family (3 members, 16 shared lines) Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifierTables.swift
  • Code Duplication · Near-duplicate member pair (71 shared lines) Sources/FoundationEssentials/CharacterSet/Annex.swift
  • Code Duplication · Near-duplicate member pair (64 shared lines) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Near-duplicate member pair (42 shared lines) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Near-duplicate member pair (22 shared lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift
  • Code Duplication · Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/URL/URL.swift
  • Code Duplication · Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/URL/URL.swift
  • Code Duplication · Duplicated block (29–38 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (26–34 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (26–27 lines × 2) Sources/FoundationEssentials/String/String+Internals.swift
  • Code Duplication · Duplicated block (24 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift
  • Code Duplication · Duplicated block (21–23 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift
  • Code Duplication · Duplicated block (21–22 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift
  • Code Duplication · Duplicated block (22 lines × 2) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift
  • Code Duplication · Duplicated block (16–21 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (20–21 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (19–20 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (20 lines × 2) Sources/FoundationEssentials/URL/URL_Bridge.swift
  • Code Duplication · Duplicated block (16–18 lines × 3) Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift
  • Code Duplication · Duplicated block (17–18 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (12–17 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (15–17 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift
  • Code Duplication · Duplicated block (15–17 lines × 2) Sources/FoundationEssentials/CharacterSet/Annex.swift
  • Code Duplication · Duplicated block (13–15 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (14–15 lines × 2) Sources/FoundationEssentials/URL/URLComponents.swift
  • Code Duplication · Duplicated block (7–14 lines × 6) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (14 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift
  • Code Duplication · Duplicated block (11–13 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (12–13 lines × 3) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Duplicated block (12–13 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (13 lines × 2) REDACTED
  • Code Duplication · Duplicated block (11–13 lines × 2) Sources/FoundationEssentials/URL/URL_Swift.swift
  • Code Duplication · Duplicated block (13 lines × 2) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Duplicated block (12 lines × 3) Sources/FoundationEssentials/Locale/Locale_Preferences.swift
  • Code Duplication · Duplicated block (10–12 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (12 lines × 2) Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift
  • Code Duplication · Duplicated block (10–11 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (11 lines × 2) REDACTED
  • Code Duplication · Duplicated block (10 lines × 3) utils/build-list-format-data-impl.swift
  • Code Duplication · Duplicated block (10 lines × 2) Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift
  • Code Duplication · Duplicated block (10 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift
  • Code Duplication · Duplicated block (9 lines × 4) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (9 lines × 4) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Duplicated block (9 lines × 3) Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift
  • Code Duplication · Duplicated block (9 lines × 3) Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifierTables.swift
  • Code Duplication · Duplicated block (8–9 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (9 lines × 2) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift
  • Code Duplication · Duplicated block (8–9 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift
  • Code Duplication · Duplicated block (9 lines × 2) Sources/FoundationEssentials/URL/URL_Impl.swift
  • Code Duplication · Duplicated block (4–8 lines × 7) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (8 lines × 5) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (8 lines × 5) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Duplicated block (8 lines × 2) Sources/FoundationEssentials/Locale/Locale_Preferences.swift
  • Code Duplication · Duplicated block (8 lines × 2) Sources/FoundationEssentials/Predicate/Predicate.swift
  • Code Duplication · Duplicated block (3–7 lines × 6) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Duplicated block (7 lines × 3) Sources/FoundationEssentials/JSON/JSONScanner.swift
  • Code Duplication · Duplicated block (7 lines × 3) Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifierTables.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift
  • Code Duplication · Duplicated block (6 lines × 7) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (6 lines × 6) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (5–6 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (6 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoder.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/FoundationEssentials/String/StringProtocol+Essentials.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/FoundationEssentials/URL/URL_Parsing.swift
  • Code Duplication · Duplicated block (5 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (5 lines × 3) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift
  • Code Duplication · Duplicated block (5 lines × 3) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift
  • Code Duplication · Duplicated block (5 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Code Duplication · Duplicated block (4–5 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift
  • Code Duplication · Duplicated block (5 lines × 2) Sources/FoundationEssentials/FileManager/SearchPaths/FileManager+XDGSearchPaths.swift
  • Code Duplication · Duplicated block (5 lines × 2) Sources/FoundationEssentials/URL/URLComponents.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSONPrimitive.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift
  • Code Duplication · Duplicated block (5 lines × 4) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift
  • Code Duplication · Duplicated block (5 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift
  • Secret Scanning · Leaked secret: high-entropy-secret Benchmarks/Benchmarks/CharacterSet/BenchmarkCharacterSet.swift
  • Secret Scanning · Leaked secret: signing-key Benchmarks/Benchmarks/CharacterSet/BenchmarkCharacterSet.swift
  • Secret Scanning · Leaked secret: REDACTED Sources/FoundationInternationalization/Formatting/ListFormatData.json
  • Churn × Complexity Hotspots · Hotspot: Sources/FoundationEssentials/Data/Data+Writing.swift Sources/FoundationEssentials/Data/Data+Writing.swift
  • Churn × Complexity Hotspots · Hotspot: Sources/FoundationEssentials/JSON/JSONPrimitive.swift Sources/FoundationEssentials/JSON/JSONPrimitive.swift
  • Explicit Debt · TodoComment Sources/FoundationInternationalization/ICU/ICU+StringConverter.swift
  • Explicit Debt · TodoComment Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift
  • Static Analysis (SAST) · High: watchdog-mutable-reusable-workflow-ref REDACTED
Rebuild cost: about €250,000 · Estimate
Cost to rebuild€82,000 to €410,000, for 1,362 to 4,322 hours of work, about 1.7 person-years for 1 to 4 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 65. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 143,856 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 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.
Raises the score by about 8 points · Low effort · Secret Scanning
2
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.
Raises the score by about 5 points · Medium effort · Security & performance tooling
3
Resolve the 1 `emitAsciiStringScalar` spells `Ascii` where 30 names in the project… finding(s) in Naming Consistency — start with BPlistPrimitiveSource.swift.
Raises the score by about 2 points · Low effort · Naming Consistency

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €250,000 to build again, about 1.7 person-years of work. Its weakest lens is Production Readiness, at 56 (Adequate). 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 2 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for low effort, because it clears the 2 Secret Scanning 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.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 67,220 lines over the last 90 days, which is about 272,614 lines a year. At that pace, the extra work comes to an estimated 40.2 to 241.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch Foundation Foundation FoundationMacros (SwiftPM) FoundationMacros (SwiftPM) Foundation->FoundationMacros (SwiftPM) _FoundationCShims (SwiftPM) _FoundationCShims (SwiftPM) Foundation->_FoundationCShims (SwiftPM) _FoundationInternationalizationData (SwiftPM) _FoundationInternationalizationData (SwiftPM) Foundation->_FoundationInternationalizationData (SwiftPM) FoundationEssentials (CMake) FoundationEssentials (CMake) _FoundationCShims (CMake) _FoundationCShims (CMake) FoundationEssentials (CMake)->_FoundationCShims (CMake) FoundationEssentials (SwiftPM) FoundationEssentials (SwiftPM) FoundationEssentials (SwiftPM)->FoundationMacros (SwiftPM) FoundationEssentials (SwiftPM)->_FoundationCShims (SwiftPM) _FoundationRefs _FoundationRefs FoundationEssentials (SwiftPM)->_FoundationRefs FoundationInternationalization (CMake) FoundationInternationalization (CMake) FoundationInternationalization (CMake)->FoundationEssentials (CMake) FoundationInternationalization (CMake)->_FoundationCShims (CMake) _FoundationInternationalizationData (CMake) _FoundationInternationalizationData (CMake) FoundationInternationalization (CMake)->_FoundationInternationalizationData (CMake) FoundationInternationalization (SwiftPM) FoundationInternationalization (SwiftPM) FoundationInternationalization (SwiftPM)->FoundationEssentials (SwiftPM) FoundationInternationalization (SwiftPM)->_FoundationCShims (SwiftPM) FoundationInternationalization (SwiftPM)->_FoundationInternationalizationData (SwiftPM) FoundationMacros (CMake) FoundationMacros (CMake)

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.

6 modules, with 13 dependencies between them. One loop runs through 4 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 _FoundationRefs2 repository3 _FoundationInternationalizationData4 FoundationInternationalization5 FoundationEssentials6 FoundationMacros
1 _FoundationRefs
2 repository136
3 _FoundationInternationalizationData7227
4 FoundationInternationalization717332
5 FoundationEssentials5273104
6 FoundationMacros81
Uses a module listed above itPart of a loopThe module itself
1 _FoundationRefs2 repository3 _FoundationInternationalizationData4 FoundationInternationalization5 FoundationEssentials6 FoundationMacros_FoundationRefs1repository2_FoundationInternationalizationData3FoundationInternationalization4FoundationEssentials5FoundationMacros61367227717332527310481

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

At a glance — Architecture · 95% · Exemplary ·

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

At a glance — Readiness · 56% · Adequate · gated by D13, P3 ·

At a glance — Security · 85% · Checked 2 of 7 ·

At a glance — Performance · 97% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection11High / Critical
A07:2025 — Authentication Failures2High / Critical

Roadmap

Top priorities: Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED; Resolve the 301 No assertions finding(s) in Test Quality — start with JSONEncoderTests.swift (70), PropertyListEncoderTests.swift (27), CalendarTests.swift (21); 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 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.+8.4 ptsLowSecret Scanning
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.9 ptsMediumSecurity & performance tooling
Resolve the 1 `emitAsciiStringScalar` spells `Ascii` where 30 names in the project… finding(s) in Naming Consistency — start with BPlistPrimitiveSource.swift.+2.4 ptsLowNaming Consistency
Resolve the 1 `hexToAscii` spells `Ascii` where 30 names in the project spell it… finding(s) in Naming Consistency — start with REDACTED.+2.4 ptsLowNaming Consistency
Resolve the 1 `timezoneLocalizedGmtOffset` spells `Gmt` where 29 names in the project… finding(s) in Naming Consistency — start with ICU+Enums.swift.+2.4 ptsLowNaming Consistency
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+3.0 ptsMediumDeployment & Rollback
Swallowed exception (caught, then discarded)+2.8 ptsMediumException handling
Resolve the 301 No assertions finding(s) in Test Quality — start with JSONEncoderTests.swift (70), PropertyListEncoderTests.swift (27), CalendarTests.swift (21).+5.3 ptsHighTest Quality

File quality

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

FileScoreBandWorst signal
REDACTED3.7SlopSecret Scanning: Leaked secret: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.0MixedSecret Scanning: Leaked secret: REDACTED
Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift5.5MixedCyclomatic Complexity: _CharacterSet.remove (cyclomatic 16)
Sources/FoundationEssentials/String/String+IO.swift5.5MixedCyclomatic Complexity: String+IO.swift.encodingFromDataForExtendedAttribute (cyclomatic 30)
Sources/FoundationEssentials/JSON/JSONScanner.swift5.5MixedCyclomatic Complexity: JSONScanner.validateNumber (cyclomatic 16)
Sources/FoundationEssentials/ProgressManager/ProgressManager.swift5.5MixedGod Classes: TooManyMethods: ProgressManager
Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift5.6MixedCode Duplication: Edited copies of one member (4 members, 5+ corresponding lines)
Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift5.6MixedCode Duplication: Duplicated block (5 lines × 2)
Sources/FoundationEssentials/TimeZone/TimeZone_GMT.swift5.7MixedCyclomatic Complexity: TimeZone.tryParseGMTName (cyclomatic 35)
Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift5.7MixedCognitive Complexity: ISO8601FormatStyle.format (cognitive 16)
Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift6.0MixedExplicit Debt: FixmeComment
Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift6.0MixedExplicit Debt: FixmeComment
Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift6.0MixedExplicit Debt: TodoComment
Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift6.0MixedExplicit Debt: FixmeComment
Sources/FoundationEssentials/FileManager/FileOperations.swift6.0MixedExplicit Debt: TodoComment
Sources/FoundationEssentials/Calendar/Calendar.swift6.0MixedExplicit Debt: TodoComment
Sources/FoundationEssentials/Data/Data+Base64.swift6.0MixedExplicit Debt: TodoComment
Sources/FoundationEssentials/FileManager/FileManager+Files.swift6.0MixedExplicit Debt: TodoComment
Sources/FoundationEssentials/Data/Data+Writing.swift6.0MixedExplicit Debt: TodoComment

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

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

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

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

Could not be resolved — 34

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 37 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 — 37 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D16D17D21D27D28D29D34D35AX10AX3AX4AX8AX9M1M2M3M4P1P10P2P3P4PF1PF3X14X28X3

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, 2121 of 2136 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 01a1dc45-244e-71ac-88d0-b834e3fda559.

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-foundation), 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 — 11 SwiftPM declaration(s) across 2 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (5 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.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • 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)` (139353 LoC, 933 module-visible types across 37 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. `Benchmarks/Benchmarks/Base64/Base64.swift`, `Benchmarks/Benchmarks/Predicates/BenchmarkPredicates.swift`, `Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift`, `Sources/FoundationEssentials/AttributedString/AttributedString.swift`, `Sources/FoundationEssentials/AttributedString/AttributedStringAttributeConstrainingBehavior.swift`, … (+178 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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 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 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.
  • P8 Schema migrations — 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 EF Core usage in C# and the schema tooling its file scan recognises only, and no .NET project was loaded, and this repository's language is not one the scan models, 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.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
  • X15 Unvalidated length from an untrusted reader — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust and Dart source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust or Dart was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala 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.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
  • X19 Unrestored process-global state — 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, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, 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 JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's C, Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin 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.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby 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.
  • X27 Collection changed while being enumerated — 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 Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's C, Swift (Foundation mutable collections) 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.
  • 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.
  • X30 Support guard that admits what it rejects — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart and Ruby source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart or Ruby 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 no JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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, 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.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • 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").
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • 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".

Dimensions

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

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

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

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

232 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _CalendarICU._locked_ordinality at 146. A further 46 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 Locale.localeStringPrefixToCanonical at 305 — they are counted neither in the figure above nor in this dimension's score. 9 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifierTables.swift (Locale.localeStringPrefixToCanonical at 305), Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift (Field.init at 37), Sources/FoundationEssentials/Error/CocoaError+FilePath.swift (Code.init at 30), Sources/FoundationInternationalization/Locale/Locale_ObjC.swift (_NSSwiftLocale.object at 27), Sources/FoundationEssentials/String/String+Encoding.swift (Encoding.description at 25), and 4 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

_CalendarGregorian.date (cyclomatic 18) · ×2Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2902
Iterator.next (cyclomatic 17) · ×2Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift:349
_CalendarICU._locked_ordinality (cyclomatic 146)Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:569
_CalendarGregorian._ordinality (cyclomatic 143)Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:945
UnicodeLookalikeTable.isLookalikeScalar (cyclomatic 136)Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:84

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

What to do

  1. Bring the 11 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with _CalendarICU._locked_ordinality (cyclomatic 146), _CalendarGregorian._ordinality (cyclomatic 143), UnicodeLookalikeTable.isLookalikeScalar (cyclomatic 136). — 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 11 together lifts Cyclomatic Complexity from 5.3 to about 6.4/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 Complexity3.6 / 10Weak✓ Tool-verified

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

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

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

304 method(s) exceeded the cognitive complexity threshold of 15; the worst was _CalendarICU._locked_ordinality at 253.

URL.parse::checkHost (cognitive 26) · ×2Sources/FoundationEssentials/URL/URL_Parsing.swift:577
_CalendarGregorian.date (cognitive 17) · ×2Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2902
_CalendarICU._locked_ordinality (cognitive 253)Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:569
_CalendarGregorian._ordinality (cognitive 240)Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:945
ISO8601FormatStyle.components (cognitive 162)Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:352

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

What to do

  1. Bring the 7 bodies over 120 down to 120 or less in Cognitive Complexity — start with _CalendarICU._locked_ordinality (cognitive 253), _CalendarGregorian._ordinality (cognitive 240), ISO8601FormatStyle.components (cognitive 162). — 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 7 together lifts Cognitive Complexity from 3.6 to about 4.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes7.3 / 10Strong✓ Tool-verified

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

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

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

142 god class(es) detected.

FileTooLong: Calendar/Calendar_Gregorian.swift · ×47Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift
TooManyMethods: Calendar · ×44Sources/FoundationEssentials/Calendar/Calendar.swift:21
MethodTooLong: _CalendarGregorian._ordinality · ×28Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:945
ClassTooLong: _CalendarHebrew · ×18Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:22
FunctionTooLong: FileManager+Directories.swift._mkpath_np · ×5Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:48

What to do

  1. Resolve the 47 FileTooLong finding(s) in God Classes — start with Calendar_Gregorian.swift, Calendar_ICU.swift, Calendar_Enumerate.swift. — One of this dimension's main actionable groups (47 warning-level).
  2. Resolve the 44 TooManyMethods finding(s) in God Classes — start with PlistDecoderGeneric.swift (3), CharacterSet.swift (2), Calendar.swift. — One of this dimension's main actionable groups (44 warning-level).
  3. Resolve the 28 MethodTooLong finding(s) in God Classes — start with Calendar_Gregorian.swift (4), URL_Parsing.swift (3), URL+UnicodeLookalikeTable.swift (2). — One of this dimension's main actionable groups (28 warning-level).

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

D4 · Code Duplication6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Verified

231 duplicated block group(s) detected. 9.9 % of the production lines (14,250 of 143,856) are in a reported copy. A further 472 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Edited copy of a member (3 corresponding lines) · ×51Sources/FoundationInternationalization/Formatting/Duration+UnitsFormatStyle.swift:509
Edited copy of a member (4 corresponding lines) · ×28Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:463
Duplicated block (5 lines × 2) · ×23Sources/FoundationEssentials/Data/Data+Writing.swift:743
Edited copy of a member (6 corresponding lines) · ×20Sources/FoundationEssentials/URL/URL.swift:1301
Edited copy of a member (7 corresponding lines) · ×20Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:524

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

What to do

  1. Resolve the 51 Edited copy of a member (3 corresponding lines) finding(s) in Code Duplication — start with BPlistEncodingFormat.swift (17), FileManager+Bridge.swift (13), Date+ISO8601FormatStyle.swift (3). — One of this dimension's main actionable groups (51 warning-level).
  2. Resolve the 28 Edited copy of a member (4 corresponding lines) finding(s) in Code Duplication — start with BinaryFloatingPoint+FormatStyle.swift (4), URL_Impl.swift (4), JSONMapBuildingSink.swift (3). — One of this dimension's main actionable groups (28 warning-level).
  3. Resolve the 23 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with Date+VerbatimFormatStyle.swift (3), JSONMapBuildingSink.swift (3), JSONScannerEventSource.swift (2). — One of this dimension's main actionable groups (23 warning-level).

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

D5 · Coupling8.7 / 10Strong✓ Tool-verified

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

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

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

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

12 production modules (SwiftPM+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 2 module(s) off the main sequence, with abstractness counted on 4 of the 12 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: _FoundationInternationalizationData (SwiftPM) · ×2

What to do

  1. Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).

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

D6 · Cohesion (LCOM4)7.6 / 10Strong✓ 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 7.6 / 10 · rule-coverage 100% · ceiling Verified

32 of 159 classes have LCOM4 above 3.

Low cohesion: FileManager (LCOM4 34) · ×32Sources/FoundationEssentials/FileManager/SwiftFileManager.swift:235

What to do

  1. Resolve the 32 Low cohesion finding(s) in Cohesion (LCOM4) — start with AttributedString+IndexValidity.swift (3), Span+Utils.swift (2), SwiftFileManager.swift. — One of this dimension's main actionable groups (32 warning-level).

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

D10 · Test Quality8.3 / 10Strong✓ Tool-verified

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

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

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

29 skipped (28 with a documented reason), 351 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2731 tests (1 harness-style project(s) excluded from the assertion penalty).

No assertions: initBufferViewOrdinaryElement · ×301Tests/FoundationEssentialsTests/BufferViewTests.swift:36
Skipped test: searchPaths_XDGEnvironmentVariablesTests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:1144
No direct assertions: noBuildConfig · ×50Tests/FoundationMacrosTests/BundleMacroTests.swift:24
Test project verifies nothing: FoundationMacrosTestsTests/FoundationMacrosTests/BundleMacroTests.swift:24
Skipped (documented): overflowingAdd · ×28Tests/FoundationEssentialsTests/ChineseFamilyCalendarTests.swift:158

What to do

  1. Resolve the 301 No assertions finding(s) in Test Quality — start with JSONEncoderTests.swift (70), PropertyListEncoderTests.swift (27), CalendarTests.swift (21). — One of this dimension's main actionable groups (301 warning-level).
  2. Resolve the 50 No direct assertions finding(s) in Test Quality — start with PredicateMacroLanguageOperatorTests.swift (16), PredicateMacroFunctionCallTests.swift (13), PredicateMacroBasicTests.swift (8). — One of this dimension's main actionable groups (50 recommendation-level).
  3. Resolve the 1 Skipped test finding(s) in Test Quality — start with FileManagerTests.swift. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

2 secret(s) detected. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

REDACTED

What to do

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

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

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

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

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

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

0 of 6 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 6 — 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. 6 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 Hotspots9.6 / 10Stronggated by 17 serious findings✓ 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 9.6 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: Sources/FoundationEssentials/Decimal/Decimal.swift (9×62=558); Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift (6×76=456); Sources/FoundationEssentials/URL/URL_Parsing.swift (7×59=413)

Hotspot: Sources/FoundationEssentials/Decimal/Decimal.swift · ×17Sources/FoundationEssentials/Decimal/Decimal.swift:478

What to do

  1. Resolve the 17 Hotspot finding(s) in Churn × Complexity Hotspots — start with Decimal.swift, Calendar_Chinese.swift, URL_Parsing.swift. — One of this dimension's main actionable groups (17 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

21 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/FoundationMacros/PredicateMacro.swift. Counted over 360 of the 406 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×4
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.6 / 10Stronggated by 267 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.6 / 10 · rule-coverage 100% · ceiling Prevented

267 deducted task-comment markers across 143856 LoC (0.2/KLoC) → score 9.6. 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 · ×139Tests/FoundationInternationalizationTests/DateTests+Locale.swift:22
FixmeComment · ×126Tests/FoundationInternationalizationTests/CalendarTests.swift:741
XxxCommentSources/FoundationEssentials/JSON/JSONPrimitive.swift:375
HackCommentSources/FoundationEssentials/Data/Representations/Data+LegacyRepresentation.swift:177

What to do

  1. Resolve the 139 TodoComment finding(s) in Explicit Debt — start with Calendar_ICU.swift (10), Calendar_Enumerate.swift (9), ICUNumberFormatter.swift (7). — One of this dimension's main actionable groups (139 warning-level).
  2. Resolve the 126 FixmeComment finding(s) in Explicit Debt — start with Conversion.swift (20), AttributedString+Runs+AttributeSlices.swift (17), ContiguousBytes.swift (10). — One of this dimension's main actionable groups (126 warning-level).
  3. Resolve the 1 XxxComment finding(s) in Explicit Debt — start with JSONPrimitive.swift. — One of this dimension's main actionable groups (1 warning-level).

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

D21 · Naming Consistency4.5 / 10Weak✓ Tool-verified

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

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

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

3 naming inconsistencies among 55 declarations measured against a convention their peers follow.

`emitAsciiStringScalar` spells `Ascii` where 30 names in the project spell it `ASCII`Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:137
`hexToAscii` spells `Ascii` where 30 names in the project spell it `ASCII`REDACTED:976
`timezoneLocalizedGmtOffset` spells `Gmt` where 29 names in the project spell it `GMT`Sources/FoundationInternationalization/ICU/ICU+Enums.swift:192

What to do

  1. Resolve the 1 `emitAsciiStringScalar` spells `Ascii` where 30 names in the project… finding(s) in Naming Consistency — start with BPlistPrimitiveSource.swift. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `hexToAscii` spells `Ascii` where 30 names in the project spell it… finding(s) in Naming Consistency — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `timezoneLocalizedGmtOffset` spells `Gmt` where 29 names in the project… finding(s) in Naming Consistency — start with ICU+Enums.swift. — One of this dimension's main actionable groups (1 recommendation-level).

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

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 1 % 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 11 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

11 finding(s): 0 critical, 11 high, 0 medium, 0 low. 9 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. semgrep hit a parse error in 26 file(s) — `Sources/FoundationEssentials/FileManager/FileManager+Directories.swift` (line 49), `Tests/FoundationEssentialsTests/Resources/JSON/fail/fail10.json`, `Tests/FoundationEssentialsTests/Resources/JSON/fail/fail16.json`, `Tests/FoundationEssentialsTests/Resources/JSON/fail/fail18.json`, `Tests/FoundationEssentialsTests/Resources/JSON/fail/fail19.json`, … (+21 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED
REDACTED

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 2 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 (2 issue-level, 0 of them charged here).

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

D34 · Knowledge Freshness9.5 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

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

Orphaned file · ×17Sources/FoundationEssentials/Formatting/DiscreteFormatStyle.swift:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

Strongest change-coupling: Decimal+Compatibility.swift↔Decimal+Conformances.swift 50%

Change coupling: Decimal+Compatibility.swift ↔ Decimal+Conformances.swiftSources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:1

What to do

  1. Resolve the 1 Change coupling finding(s) in Change Coupling — start with Decimal+Compatibility.swift. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.5 / 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 documentation3.0 / 10Weak✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation 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.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

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

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

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

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

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 & Rollback5.0 / 10Adequate✓ Tool-verified

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

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

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.2 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×21) — Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:139, Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:196, Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:224, …

What to do

  • Swallowed exception (caught, then discarded)

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 Health64%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture95%ExemplarySolid.
Maturity70%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness56%Adequate — gated by D13, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security85%Checked 2 of 7Solid.
Performance97%ExemplaryStrongest area.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 74 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — 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 — 11 SwiftPM declaration(s) across 2 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (5 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.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .swift source were not judged.
  • 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) — 183 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files).
  • 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 Swift source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — 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
  • 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
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X13 Undrained process stream — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X15 Unvalidated length from an untrusted reader — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X19 Unrestored process-global state — not 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
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. In C a `case` label must be a constant expression, and a switch has no guards, so no label can change state. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X23 Unguarded diagnostic materialisation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X25 Inert configuration knob — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — not 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
  • X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — 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.
  • 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 — 13 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · Secret Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 1974 finding(s)
D10 · Test Quality · No assertions · ×301
  • No assertions: initBufferViewOrdinaryElement Tests/FoundationEssentialsTests/BufferViewTests.swift:36 — 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: membership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:28 — 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: bmpMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:59 — 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: nonBMPMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:67 — 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: illegalSetMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:75 — 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: controlAndFormatterSetMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:86 — 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: whitespaceSetMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:99 — 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: newlineSetMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:114 — 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: whitespaceAndNewlineSetMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:127 — 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: unsupportedNonBMPPlaneMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:136 — 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: illegalSetUnsupportedNonBMPNonSpecialPlaneMembership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:142 — 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: illegalSetUnsupportedPlane15And16Membership Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:159 — 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: controlAndFormatterSetUnsupportedNonBMPNonPlane14 Tests/FoundationEssentialsTests/BuiltInUnicodeScalarSetTests.swift:167 — 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: span Tests/FoundationEssentialsTests/ContiguousBytesTests.swift:50 — 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: basicReadWrite Tests/FoundationEssentialsTests/DataIOTests.swift:80 — 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: readWriteAtomic Tests/FoundationEssentialsTests/DataIOTests.swift:103 — 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: readWriteMapped Tests/FoundationEssentialsTests/DataIOTests.swift:112 — 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: writeFailure Tests/FoundationEssentialsTests/DataIOTests.swift:116 — 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: hashing Tests/FoundationEssentialsTests/DateIntervalTests.swift:59 — 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: throwCocoaError Tests/FoundationEssentialsTests/ErrorTests.swift:27 — 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: emptySequence Tests/FoundationEssentialsTests/GregorianCalendarRecurrenceRuleTests.swift:687 — 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: testRemoteJulianDayCrash Tests/FoundationEssentialsTests/GregorianCalendarTests.swift:45 — 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: testAddLargeValue Tests/FoundationEssentialsTests/GregorianCalendarTests.swift:609 — 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: hashing Tests/FoundationEssentialsTests/IndexPathTests.swift:232 — 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: dropFirst Tests/FoundationEssentialsTests/IndexPathTests.swift:629 — 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.
  • + 276 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×139
  • TodoComment Tests/FoundationInternationalizationTests/DateTests+Locale.swift:22 — // TODO: Reenable these tests once DateFormatStyle has been ported — 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/FoundationInternationalizationTests/LocaleCanonicalIdentifierTests.swift:235 — // TODO: Enable the tests when once we are done implementing ICU locale canonicalization functions in FoundationEssentials — 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/FoundationInternationalizationTests/LocaleTests.swift:878 — // TODO: Reenable once (Locale.canonicalIdentifier) is implemented — 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/FoundationInternationalizationTests/LocaleTests.swift:900 — // TODO: Reenable once (Locale.canonicalIdentifier) is implemented — 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/FoundationInternationalizationTests/LocaleTests.swift:914 — // TODO: Reenable once (Locale.canonicalIdentifier) is implemented — 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/FoundationInternationalizationTests/SortDescriptorTests.swift:197 — // TODO: When String.compare(_:options:locale:) is available in FoundationInternationalization, enable these tests — 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/FoundationInternationalizationTests/StringSortComparatorTests.swift:35 — // TODO: Until we support String.compare(_:options:locale:) in FoundationInternationalization, only support unlocalized comparisons — 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/FoundationInternationalization/String/String+SortComparator.swift:167 — // TODO: Until we support String.compare(_:options:locale:) in FoundationInternationalization, only support unlocalized comparisons — 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/FoundationInternationalization/String/String+SortComparator.swift:186 — // TODO: Until we support String.compare(_:options:locale:) in FoundationInternationalization, only support unlocalized comparisons — 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/FoundationInternationalization/String/String+SortComparator.swift:196 — // TODO: Until we support String.compare(_:options:locale:) in FoundationInternationalization, only support unlocalized comparisons — 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/FoundationInternationalizationTests/TimeZoneTests.swift:345 — // TODO: In non-framework, no FoundationInternationalization cases, return nil for all of tehse — 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/FoundationInternationalizationTests/Formatting/DatePatternFormattingTests.swift:534 — // TODO: Remove `hasSymbolLoadingFix` once rdar://188932615 and rdar://188036385 are fixed. — 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/FoundationInternationalizationTests/Formatting/NumberParseStrategyTests.swift:322 — // TODO: Parse integers greater than Int64 — 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/FoundationInternationalizationTests/Formatting/NumberParseStrategyTests.swift:336 — // TODO: Parse integers greater than Int64 — 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/FoundationEssentialsTests/ContiguousBytesTests.swift:21 — // TODO: ContiguousBytes should refine ~Escapable and ~Copyable — 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/FoundationEssentialsTests/URLTests.swift:2862 — // TODO: Update this once .fileSystemPath uses backslashes for Windows — 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/FoundationEssentialsTests/UUIDTests.swift:218 — // TODO: This is meant to be public (see https://github.com/swiftlang/swift-foundation/blob/main/Proposals/0041-uuid-versions.md), but is not yet public due to a compiler lifetimes bug when using it (186581562).
  • TodoComment Tests/FoundationEssentialsTests/AttributedString/AttributedStringTests.swift:261 — // TODO: Re-evaluate whether we want these. — 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/FoundationEssentialsTests/AttributedString/AttributedStringTests.swift:1162 — // TODO: Support AttributedString codable conformance in FoundationPreview — 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/FoundationEssentials/AttributedString/AttributedStringCodable.swift:228 — // TODO: Support AttributedString codable conformance in FoundationPreview — 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/FoundationEssentialsTests/AttributedString/AttributedStringTests.swift:2597 — // TODO: Support scope-specific AttributedString initialization in FoundationPreview — 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/FoundationInternationalization/TimeZone/TimeZone_GMTICU.swift:98 — // TODO: Consider implementing this ourselves — 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/FoundationInternationalization/TimeZone/TimeZone_ICU.swift:104 — // TODO: add logging for when initializaiton fails — 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/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:474 — // TODO: We should throw an error properly, but for now return 0 just like how we handle this when calling into ICU timezone — 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/FoundationInternationalization/TimeZone/TimeZone_ObjC.swift:158 — // TODO: If we intend to implement this in Swift, we will need to remove the placeholder TimeZone in CoreFoundation — 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.
  • + 114 more in this group — see findings.md.
D17 · Explicit Debt · FixmeComment · ×126
  • FixmeComment Tests/FoundationInternationalizationTests/CalendarTests.swift:741 — // FIXME: https://github.com/swiftlang/swift-foundation-icu/issues/62
  • FixmeComment Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1153 — // FIXME: https://github.com/swiftlang/swift-foundation-icu/issues/62
  • FixmeComment Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1247 — // FIXME: https://github.com/swiftlang/swift-foundation-icu/issues/62
  • FixmeComment Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1811 — // FIXME: https://github.com/swiftlang/swift-foundation-icu/issues/62
  • FixmeComment Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1872 — // FIXME: https://github.com/swiftlang/swift-foundation-icu/issues/62
  • FixmeComment Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:2254 — // FIXME: https://github.com/swiftlang/swift-foundation-icu/issues/62
  • FixmeComment Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:2298 — // FIXME: https://github.com/swiftlang/swift-foundation-icu/issues/62
  • FixmeComment Tests/FoundationInternationalizationTests/CalendarTests.swift:2290 — // FIXME: This is failing — 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/FoundationInternationalizationTests/Formatting/DatePatternFormattingTests.swift:624 — // FIXME: Since #2299, Locale canonicalizes this identifier to th-TH-u-nu, dropping the numbering system. Uncomment this case once that's fixed.
  • FixmeComment Tests/FoundationInternationalizationTests/Formatting/NumberFormatStyleTests.swift:2109 — // FIXME: This matches ",345" as it matches ICU's decimal format "#,##0.###"
  • FixmeComment Tests/FoundationInternationalizationTests/Formatting/ParseStrategy+RegexComponentTests.swift:317 — // FIXME 94663783: This passes but shouldn't since the time zone separator doesn't match — 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/FoundationEssentialsTests/GregorianCalendarTests.swift:1260 — // FIXME 123202377: This is wrong, but it's the same as Calendar_ICU's current behavior — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment Tests/FoundationEssentialsTests/StringTests.swift:2231 — // FIXME(strings): this API should probably change to accept a Substring? — 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/FoundationEssentialsTests/StringTests.swift:2467 — // FIXME: add a test where this function actually returns nil. — 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/FoundationEssentialsTests/StringTests.swift:2486 — // FIXME: add a test where this function actually returns nil. — 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/FoundationEssentialsTests/StringTests.swift:2897 — // FIXME: Indices that don't correspond to grapheme cluster boundaries. — 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/FoundationEssentialsTests/Formatting/ISO8601FormatStyleParsingTests.swift:413 — // FIXME: Need tests that starts from somewhere else — 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/FoundationEssentialsTests/Formatting/ISO8601FormatStyleParsingTests.swift:430 — // FIXME: Need tests that starts from somewhere else — 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/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:27 — // FIXME: Remove the lock once ICU fix is available — 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/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:43 — // FIXME: Support the other calendars before the Swift path becomes the default. — 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/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:96 — // FIXME: Support these fields before the Swift path becomes the default. — 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/FoundationEssentials/Platform.swift:209 — // FIXME: avoid the coerce cast workaround once https://github.com/android/ndk/issues/2098 is fixed.
  • FixmeComment Sources/FoundationEssentials/Platform.swift:232 — // FIXME: avoid the coerce cast workaround once https://github.com/android/ndk/issues/2098 is fixed.
  • FixmeComment Sources/FoundationEssentials/Platform.swift:241 — // FIXME: avoid the coerce cast workaround once https://github.com/android/ndk/issues/2098 is fixed.
  • FixmeComment Sources/FoundationEssentials/Platform.swift:250 — // FIXME: avoid the coerce cast workaround once https://github.com/android/ndk/issues/2098 is fixed.
  • + 101 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×51
  • Edited copy of a member (3 corresponding lines) Sources/FoundationInternationalization/Formatting/Duration+UnitsFormatStyle.swift:509 — Sources/FoundationInternationalization/Formatting/Duration+UnitsFormatStyle.swift:509-511 | Sources/FoundationInternationalization/Formatting/Duration+UnitsFormatStyle.swift:522-524 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:528 — Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:528-530 | Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:745-747 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Error/CocoaError+FilePath.swift:37 — Sources/FoundationEssentials/Error/CocoaError+FilePath.swift:37-39 | Sources/FoundationEssentials/Error/CocoaError+FilePath.swift:41-43 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:516 — Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:516-518 | Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:733-735 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:1294 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:1294-1296 | Sources/FoundationEssentials/JSON/JSONDecoder.swift:1298-1300 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:41 — Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:41-43 | Sources/FoundationEssentials/FileManager/SwiftFileManager.swift:305-307 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/CodableWithConfiguration.swift:86 — Sources/FoundationEssentials/CodableWithConfiguration.swift:86-88 | Sources/FoundationEssentials/CodableWithConfiguration.swift:89-92 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Autoupdating.swift:17 — Sources/FoundationEssentials/Calendar/Calendar_Autoupdating.swift:17-19 | Sources/FoundationInternationalization/Calendar/Calendar_Bridge.swift:28-30 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:487 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:487-489 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:474-476 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:170 — Sources/FoundationEssentials/URL/URL_Impl.swift:170-172 | Sources/FoundationEssentials/URL/URL_Swift.swift:124-127 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:176 — Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:176-178 | Sources/FoundationEssentials/FileManager/SwiftFileManager.swift:401-403 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:58 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:58-60 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:60-62 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:62 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:62-64 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:64-66 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Autoupdating.swift:88 — Sources/FoundationEssentials/Calendar/Calendar_Autoupdating.swift:88-90 | Sources/FoundationInternationalization/Calendar/Calendar_Bridge.swift:130-132 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:53 — Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:53-55 | Sources/FoundationEssentials/FileManager/SwiftFileManager.swift:285-287 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:65 — Sources/FoundationEssentials/FileManager/FileManager+Bridge.swift:65-67 | Sources/FoundationEssentials/FileManager/SwiftFileManager.swift:289-291 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:537 — Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:537-539 | Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:754-756 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Predicate/Expressions/Filter.swift:47 — Sources/FoundationEssentials/Predicate/Expressions/Filter.swift:47-49 | Sources/FoundationEssentials/Predicate/Expressions/Sequence.swift:137-139 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Predicate/Predicate+Description.swift:415 — Sources/FoundationEssentials/Predicate/Predicate+Description.swift:415-417 | Sources/FoundationInternationalization/Predicate/LocalizedString.swift:53-55 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/Predicate/Predicate+Description.swift:415 — Sources/FoundationEssentials/Predicate/Predicate+Description.swift:415-417 | Sources/FoundationInternationalization/Predicate/LocalizedString.swift:117-119 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:215 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:215-217 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:202-204 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:218 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:218-220 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:205-207 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:221 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:221-223 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:208-210 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:224 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:224-226 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:211-213 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:227 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:227-229 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:214-216 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 26 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×47
  • FileTooLong: Calendar/Calendar_Gregorian.swift Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift — FileTooLong — 2214 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1714 over it, 4.43× 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: Calendar/Calendar_ICU.swift Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift — FileTooLong — 1592 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1092 over it, 3.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Calendar/Calendar_Enumerate.swift Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift — FileTooLong — 1364 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 864 over it, 2.73× 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: Locale/Locale+Components.swift Sources/FoundationEssentials/Locale/Locale+Components.swift — FileTooLong — 1304 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 804 over it, 2.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: JSON/JSONDecoder.swift Sources/FoundationEssentials/JSON/JSONDecoder.swift — FileTooLong — 1161 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 661 over it, 2.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Calendar/Calendar_Hebrew.swift Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift — FileTooLong — 1134 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: _CalendarHebrew (22-1442). The bar is 500 significant lines; this is 634 over it, 2.27× 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: Calendar/Calendar.swift Sources/FoundationEssentials/Calendar/Calendar.swift — FileTooLong — 1029 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: Calendar (22-1626). The bar is 500 significant lines; this is 529 over it, 2.06× 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: CharacterSet/CharacterSet.swift Sources/FoundationEssentials/CharacterSet/CharacterSet.swift — FileTooLong — 1020 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 520 over it, 2.04× 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: Locale/Locale_ICU.swift Sources/FoundationInternationalization/Locale/Locale_ICU.swift — FileTooLong — 1011 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: _LocaleICU (37-1504). The bar is 500 significant lines; this is 511 over it, 2.02× 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: Data/Data+Base64.swift Sources/FoundationEssentials/Data/Data+Base64.swift — FileTooLong — 956 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 456 over it, 1.91× 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: Decimal/Decimal+Math.swift Sources/FoundationEssentials/Decimal/Decimal+Math.swift — FileTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 449 over it, 1.90× 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: URL/URL_Impl.swift Sources/FoundationEssentials/URL/URL_Impl.swift — FileTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 449 over it, 1.90× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 924 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 424 over it, 1.85× 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: JSON/JSONEncoder.swift Sources/FoundationEssentials/JSON/JSONEncoder.swift — FileTooLong — 897 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 397 over it, 1.79× 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: PropertyList/XMLPlistScanner.swift Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift — FileTooLong — 895 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 395 over it, 1.79× 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: URL/URLComponents.swift Sources/FoundationEssentials/URL/URLComponents.swift — FileTooLong — 890 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: URLComponents (21-1218). The bar is 500 significant lines; this is 390 over it, 1.78× 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: FoundationMacros/PredicateMacro.swift Sources/FoundationMacros/PredicateMacro.swift — FileTooLong — 869 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: PredicateQueryRewriter (413-1138). The bar is 500 significant lines; this is 369 over it, 1.74× 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: URL/URL.swift Sources/FoundationEssentials/URL/URL.swift — FileTooLong — 865 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 365 over it, 1.73× 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: FileManager/FileOperations.swift Sources/FoundationEssentials/FileManager/FileOperations.swift — FileTooLong — 838 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: _FileOperations (328-1321). The bar is 500 significant lines; this is 338 over it, 1.68× 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: URL/URL_Swift.swift Sources/FoundationEssentials/URL/URL_Swift.swift — FileTooLong — 832 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: _SwiftURL (29-1055). The bar is 500 significant lines; this is 332 over it, 1.66× 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: JSON/JSONScanner.swift Sources/FoundationEssentials/JSON/JSONScanner.swift — FileTooLong — 822 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 322 over it, 1.64× 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: JSON/JSON5Scanner.swift Sources/FoundationEssentials/JSON/JSON5Scanner.swift — FileTooLong — 804 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 304 over it, 1.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: PropertyList/XMLPlistPrimitive.swift Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift — FileTooLong — 802 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: XMLPlistSpanReader (506-1179). The bar is 500 significant lines; this is 302 over it, 1.60× 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: Calendar/Calendar_Recurrence.swift Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift — FileTooLong — 744 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 244 over it, 1.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Calendar/Calendar_Chinese.swift Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift — FileTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: _CalendarChinese (240-1014). The bar is 500 significant lines; this is 242 over it, 1.48× 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.
  • + 22 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×44
  • TooManyMethods: Calendar Sources/FoundationEssentials/Calendar/Calendar.swift:21 — TooManyMethods — 105 methods, declared across 5 files: Calendar/Calendar.swift (55), Calendar/Calendar_Enumerate.swift (35), Calendar/Calendar_Recurrence.swift (10), Date/DateFormatStyle.swift (3), +1 more file(s). The bar is 30 methods; this is 75 over it, 3.50× 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.
  • TooManyMethods: Data Sources/FoundationEssentials/Data/Data.swift:123 — TooManyMethods — 100 methods, declared across 12 files: Data/Data.swift (66), Data/Data+Deprecated.swift (6), Data/Data+Searching+BoyerMoore.swift (5), Data/Data+Base64.swift (4), +8 more file(s). The bar is 30 methods; this is 70 over it, 3.33× 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.
  • TooManyMethods: URL Sources/FoundationEssentials/URL/URL.swift:647 — TooManyMethods — 99 methods, declared across 8 files: URL/URL.swift (79), URL/URL_Parsing.swift (9), URL/URL_File.swift (5), Formatting/URLFormatStyle.swift (2), +4 more file(s). The bar is 30 methods; this is 69 over it, 3.30× 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.
  • TooManyMethods: Decimal Sources/FoundationEssentials/Decimal/Decimal.swift:16 — TooManyMethods — 82 methods, declared across 6 files: Decimal/Decimal+Conformances.swift (39), Decimal/Decimal+Math.swift (21), Decimal/Decimal.swift (12), Decimal/Decimal+Compatibility.swift (4), +2 more file(s). The bar is 30 methods; this is 52 over it, 2.73× 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.
  • TooManyMethods: Locale Sources/FoundationEssentials/Locale/Locale.swift:48 — TooManyMethods — 78 methods, declared across 5 files: Locale/Locale.swift (38), Locale/Locale_CanonicalIdentifier.swift (15), Locale/Locale_ICU.swift (14), Locale/Locale_ObjC.swift (7), +1 more file(s). The bar is 30 methods; this is 48 over it, 2.60× 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.
  • TooManyMethods: SortDescriptor Sources/FoundationInternationalization/String/SortDescriptor.swift:20 — TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× 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: ProgressManager Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:27 — TooManyMethods — 65 methods, declared across 4 files: ProgressManager/ProgressManager+Properties+Helpers.swift (38), ProgressManager/ProgressManager.swift (20), ProgressManager/ProgressManager+Interop.swift (6), ProgressManager/ProgressManager+Properties+Accessors.swift (1). The bar is 30 methods; this is 35 over it, 2.17× 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.
  • TooManyMethods: _CharacterSet Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:21 — TooManyMethods — 63 methods, declared across 9 files: CharacterSet/_CharacterSet.swift (15), CharacterSet/_CharacterSet+MutableFunctions.swift (14), CharacterSet/_CharacterSet+StorageConversionHelpers.swift (10), CharacterSet/_CharacterSet+SetAlgebra.swift (7), +5 more file(s). The bar is 30 methods; this is 33 over it, 2.10× 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.
  • TooManyMethods: String utils/update-iana-charset-names-impl.swift:165 — TooManyMethods — 61 methods, declared across 20 files: String/String+Path.swift (16), String/String+Internals.swift (10), String/String+IO.swift (8), String/String+Bridging.swift (5), +16 more file(s). The bar is 30 methods; this is 31 over it, 2.03× 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.
  • TooManyMethods: _CalendarGregorian Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:169 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× 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: AttributedString Sources/FoundationEssentials/AttributedString/AttributedString.swift:89 — TooManyMethods — 55 methods, declared across 6 files: AttributedString/AttributedString.swift (26), AttributedString/AttributedString+AttributeTransformation.swift (12), AttributedString/AttributedStringCodable.swift (7), AttributedString/AttributedString+IndexTracking.swift (4), +2 more file(s). The bar is 30 methods; this is 25 over it, 1.83× 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.
  • TooManyMethods: _URL Sources/FoundationEssentials/URL/URL_Impl.swift:46 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× 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: Date Sources/FoundationEssentials/Date.swift:41 — TooManyMethods — 53 methods, declared across 11 files: FoundationEssentials/Date.swift (28), FoundationEssentials/CodableUtilities.swift (7), Calendar/Calendar_Gregorian.swift (6), Calendar/Date+FormatStyle.swift (3), +7 more file(s). The bar is 30 methods; this is 23 over it, 1.77× 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.
  • TooManyMethods: _FileManagerImpl Sources/FoundationEssentials/FileManager/FileManager+Basics.swift:52 — TooManyMethods — 53 methods, declared across 5 files: FileManager/FileManager+Files.swift (20), FileManager/FileManager+Directories.swift (16), FileManager/FileManager+Basics.swift (6), FileManager/FileManager+Utilities.swift (6), +1 more file(s). The bar is 30 methods; this is 23 over it, 1.77× 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.
  • TooManyMethods: __JSONEncoder Sources/FoundationEssentials/JSON/JSONEncoder.swift:460 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: Guts Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift:57 — TooManyMethods — 51 methods, declared across 4 files: AttributedString/AttributedString+Guts.swift (35), AttributedString/AttributedStringAttributeConstrainingBehavior.swift (12), AttributedString/AttributedString+IndexTracking.swift (2), AttributedString/AttributedString+IndexValidity.swift (2). The bar is 30 methods; this is 21 over it, 1.70× 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.
  • TooManyMethods: _SwiftURL Sources/FoundationEssentials/URL/URL_Swift.swift:29 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: FileManager Sources/FoundationEssentials/FileManager/SwiftFileManager.swift:235 — TooManyMethods — 46 methods, declared across 3 files: FileManager/SwiftFileManager.swift (35), FileManager/FileOperations.swift (10), FileManager/FileManager+Basics.swift (1). The bar is 30 methods; this is 16 over it, 1.53× 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.
  • TooManyMethods: JSONDecoderImpl Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:25 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: _PlistKeyedDecodingContainer Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:280 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: CharacterSet Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:799 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: JSONLegacyDecoderImpl Sources/FoundationEssentials/JSON/JSONDecoder.swift:622 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: _PlistUnkeyedDecodingContainer Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:568 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: __PlistDictionaryDecoder Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:17 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× 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: __PlistEncoderBPlist Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:31 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× 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.
  • + 19 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×32
  • Low cohesion: FileManager (LCOM4 34) Sources/FoundationEssentials/FileManager/SwiftFileManager.swift:235 — FileManager's methods fall into 34 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 34 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: String (LCOM4 28) utils/update-iana-charset-names-impl.swift:165 — String's methods fall into 28 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 28 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: ProgressManager (LCOM4 20) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:27 — ProgressManager's methods fall into 20 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 20 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: StringProtocol (LCOM4 19) Sources/FoundationEssentials/String/String+IO.swift:453 — StringProtocol's methods fall into 19 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 19 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: _LocaleAutoupdating (LCOM4 17) Sources/FoundationEssentials/Locale/Locale_Autoupdating.swift:13 — _LocaleAutoupdating's methods fall into 17 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 17 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: _LocaleUnlocalized (LCOM4 17) Sources/FoundationEssentials/Locale/Locale_Unlocalized.swift:14 — _LocaleUnlocalized's methods fall into 17 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 17 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: ISO8601FormatStyle (LCOM4 17) Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:213 — ISO8601FormatStyle's methods fall into 17 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 17 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: _CalendarAutoupdating (LCOM4 14) Sources/FoundationEssentials/Calendar/Calendar_Autoupdating.swift:13 — _CalendarAutoupdating's methods fall into 14 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 14 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: Guts (LCOM4 13) Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift:57 — Guts's methods fall into 13 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 13 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: Span (LCOM4 12) Sources/FoundationEssentials/Span+Utils.swift:13 — Span's methods fall into 12 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 12 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: Range (LCOM4 11) Sources/FoundationEssentials/AttributedString/AttributedString+IndexValidity.swift:59 — Range's methods fall into 11 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 11 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: _TimeZoneAutoupdating (LCOM4 8) Sources/FoundationEssentials/TimeZone/TimeZone_Autoupdating.swift:14 — _TimeZoneAutoupdating's methods fall into 8 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 8 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: _AttributeStorage (LCOM4 8) Sources/FoundationEssentials/AttributedString/AttributedStringAttributeConstrainingBehavior.swift:21 — _AttributeStorage's methods fall into 8 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 8 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: NotificationCenter (LCOM4 6) Sources/FoundationEssentials/NotificationCenter/NotificationCenter.swift:83 — NotificationCenter's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Array (LCOM4 6) Sources/FoundationEssentials/CodableWithConfiguration.swift:288 — Array's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _InternalRuns (LCOM4 6) Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRuns.swift:44 — _InternalRuns's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _LocaleBridged (LCOM4 6) Sources/FoundationInternationalization/Locale/Locale_Bridge.swift:24 — _LocaleBridged's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Scalar (LCOM4 6) Sources/FoundationInternationalization/BidiClass+ICU.swift:50 — Scalar's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: VerbatimFormatStyle (LCOM4 6) Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:82 — VerbatimFormatStyle's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _TimeZoneGMT (LCOM4 5) Sources/FoundationEssentials/TimeZone/TimeZone_GMT.swift:13 — _TimeZoneGMT's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _InternalRun (LCOM4 5) Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRun.swift:35 — _InternalRun's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UnsafeBufferPointer (LCOM4 5) Sources/FoundationEssentials/Data/ContiguousBytes.swift:220 — UnsafeBufferPointer's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _LocaleICU (LCOM4 5) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:37 — _LocaleICU's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _TimeZoneGMTICU (LCOM4 5) Sources/FoundationInternationalization/TimeZone/TimeZone_GMTICU.swift:27 — _TimeZoneGMTICU's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: JSONDocument (LCOM4 4) Sources/FoundationEssentials/JSON/JSONScanner.swift:21 — JSONDocument's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • + 7 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×28
  • MethodTooLong: _CalendarGregorian._ordinality Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:945 — MethodTooLong — _ordinality runs 382 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 282 over it, 3.82× 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: _CalendarGregorian.addAndWrap Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2590 — MethodTooLong — addAndWrap runs 205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× 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: URL.encode Sources/FoundationEssentials/URL/URL_Parsing.swift:883 — MethodTooLong — encode runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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: ISO8601FormatStyle.components Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:352 — MethodTooLong — components runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× 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: PredicateQueryRewriter.visit Sources/FoundationMacros/PredicateMacro.swift:489 — MethodTooLong — visit runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× 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: UnicodeLookalikeTable.allCharactersAllowedByTLDRules Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:300 — MethodTooLong — allCharactersAllowedByTLDRules runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× 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: UnicodeLookalikeTable.isLookalikeScalar Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:84 — MethodTooLong — isLookalikeScalar runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× 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: _FileManagerImpl.contentsEqual Sources/FoundationEssentials/FileManager/FileManager+Basics.swift:70 — MethodTooLong — contentsEqual runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× 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: Decimal.__decimal Sources/FoundationEssentials/Decimal/Decimal.swift:478 — MethodTooLong — __decimal runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× 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: Base64._decodeIgnoringErrors Sources/FoundationEssentials/Data/Data+Base64.swift:733 — MethodTooLong — _decodeIgnoringErrors runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: URL.parse Sources/FoundationEssentials/URL/URL_Parsing.swift:285 — MethodTooLong — parse runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× 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: Decimal._assemble Sources/FoundationEssentials/Decimal/Decimal+Math.swift:1141 — MethodTooLong — _assemble runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× 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: _FileOperations.moveFile Sources/FoundationEssentials/FileManager/FileOperations.swift:596 — MethodTooLong — moveFile runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× 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: _FileManagerImpl.setAttributes Sources/FoundationEssentials/FileManager/FileManager+Files.swift:848 — MethodTooLong — setAttributes runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: _CalendarChinese.addingComponents Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:823 — MethodTooLong — addingComponents runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DatePatternFormatter.appendField Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:355 — MethodTooLong — appendField runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× 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: _CalendarGregorian._dateComponents Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2109 — MethodTooLong — _dateComponents runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× 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: String.init Sources/FoundationEssentials/String/String+IO.swift:70 — MethodTooLong — init runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× 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: _CalendarHebrew.date Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:764 — MethodTooLong — date runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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: String.data Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:53 — MethodTooLong — data runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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: _CalendarGregorian.add Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2403 — MethodTooLong — add runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× 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: _CharacterSet.formUnion Sources/FoundationEssentials/CharacterSet/_CharacterSet+SetAlgebra.swift:98 — MethodTooLong — formUnion runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× 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: URL.parse Sources/FoundationEssentials/URL/URL_Parsing.swift:537 — MethodTooLong — parse runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _StringCompareOptionsIterable._range Sources/FoundationEssentials/String/String+Comparison.swift:245 — MethodTooLong — _range runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× 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: _FileManagerImpl.createDirectory Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:324 — MethodTooLong — createDirectory runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×28
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:463 — Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:463-466 | Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:468-471 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:47 — Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:47-50 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:78-84 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/Formatting/Date/DateParseStrategy.swift:168 — Sources/FoundationInternationalization/Formatting/Date/DateParseStrategy.swift:168-171 | Sources/FoundationInternationalization/Formatting/Date/DateParseStrategy.swift:180-183 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:422 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:422-425 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:214-217 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:465 — Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:465-470 | Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:496-499 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:83 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:83-86 | Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:88-91 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:85 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:85-88 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:90-93 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:899 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:899-902 | Sources/FoundationEssentials/JSON/JSONEncoder.swift:918-921 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/String/KeyPathComparator.swift:90 — Sources/FoundationInternationalization/String/KeyPathComparator.swift:90-93 | Sources/FoundationInternationalization/String/KeyPathComparator.swift:95-98 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/Codable.swift:41 — Sources/FoundationEssentials/Codable.swift:41-44 | Sources/FoundationEssentials/Codable.swift:46-49 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:258 — Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:258-261 | Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:276-279 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:108 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:108-111 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:159-162 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/Predicate/Expression.swift:20 — Sources/FoundationEssentials/Predicate/Expression.swift:20-23 | Sources/FoundationEssentials/Predicate/Predicate.swift:67-70 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:58 — Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:58-61 | Sources/FoundationInternationalization/Formatting/Number/BinaryInteger+FormatStyle.swift:58-61 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:63 — Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:63-66 | Sources/FoundationInternationalization/Formatting/Number/BinaryInteger+FormatStyle.swift:63-66 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:53 — Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:53-56 | Sources/FoundationInternationalization/Formatting/Number/BinaryInteger+FormatStyle.swift:53-56 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:118 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:118-121 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:182-189 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:80 — Sources/FoundationEssentials/JSON/JSONPrimitive.swift:80-83 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:74-77 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:43 — Sources/FoundationInternationalization/Formatting/Number/BinaryFloatingPoint+FormatStyle.swift:43-46 | Sources/FoundationInternationalization/Formatting/Number/BinaryInteger+FormatStyle.swift:44-47 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:923 — Sources/FoundationEssentials/URL/URL_Impl.swift:923-926 | Sources/FoundationEssentials/URL/URL_Swift.swift:620-623 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedSubstring.swift:149 — Sources/FoundationEssentials/AttributedString/AttributedSubstring.swift:149-152 | Sources/FoundationEssentials/AttributedString/DiscontiguousAttributedSubstring.swift:96-101 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:495 — Sources/FoundationEssentials/URL/URL_Impl.swift:495-500 | REDACTED:118-121 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:113 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:113-116 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:177-180 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:126 — Sources/FoundationEssentials/URL/URL_Impl.swift:126-129 | Sources/FoundationEssentials/URL/URL_Swift.swift:90-93 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) utils/date-format-data-schema.swift:21 — utils/date-format-data-schema.swift:21-24 | utils/list-format-data-schema.swift:27-30 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×23
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/Data/Data+Writing.swift:743 — Sources/FoundationEssentials/Data/Data+Writing.swift:743-747 | Sources/FoundationEssentials/Data/Data+Writing.swift:778-783 — 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/FoundationEssentials/Data/Data+Writing.swift:743` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FoundationEssentials/Data/Data+Writing.swift:786` calls `unlink` and `Sources/FoundationEssentials/Data/Data+Writing.swift:748` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:185 — Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:185-190 | Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:202-206 — 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/FoundationEssentials/JSON/JSONScannerEventSource.swift:185` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:287 — Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:287-291 | Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:304-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:26 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:26-30 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:27-31 — 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/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:26` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:52 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:52-56 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:54-58 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:651 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:651-655 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:679-683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/URL/URL_C+Spans.swift:93 — Sources/FoundationEssentials/URL/URL_C+Spans.swift:93-99 | Sources/FoundationEssentials/URL/URL_C+Spans.swift:109-113 — 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/FoundationEssentials/URL/URL_C+Spans.swift:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:232 — Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:232-236 | Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1291-1295 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+Runs+Run.swift:62 — Sources/FoundationEssentials/AttributedString/AttributedString+Runs+Run.swift:62-66 | Sources/FoundationEssentials/AttributedString/AttributedStringProtocol.swift:210-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:81 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:81-85 | Sources/FoundationEssentials/JSON/JSONScanner.swift:210-214 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:88 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:88-92 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:127-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:150 — Sources/FoundationEssentials/JSON/JSONPrimitive.swift:150-154 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:103-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:929 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:929-933 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:728-732 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:220 — Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:220-224 | Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1297-1301 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:226 — Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:226-230 | Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1303-1307 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:69 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:69-73 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:107-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:82 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:82-86 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:121-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:118` calls `recordKey` and `Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:78` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/Predicate/Expression.swift:25 — Sources/FoundationEssentials/Predicate/Expression.swift:25-29 | Sources/FoundationEssentials/Predicate/Predicate.swift:72-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/Predicate/Expressions/ExpressionEvaluation.swift:58 — Sources/FoundationEssentials/Predicate/Expressions/ExpressionEvaluation.swift:58-62 | Sources/FoundationEssentials/Predicate/Expressions/PredicateEvaluation.swift:60-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/Predicate/Expressions/ExpressionEvaluation.swift:64 — Sources/FoundationEssentials/Predicate/Expressions/ExpressionEvaluation.swift:64-68 | Sources/FoundationEssentials/Predicate/Expressions/PredicateEvaluation.swift:66-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/Data/Data+Base64.swift:409 — Sources/FoundationEssentials/Data/Data+Base64.swift:409-413 | Sources/FoundationEssentials/Data/Data+Base64.swift:727-731 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `options` to `Data.Base64EncodingOptions) -> (UInt8` in one and `Data.Base64DecodingOptions) -> (UInt8` 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 (5 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:883 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:883-887 | Sources/FoundationEssentials/JSON/JSONScanner.swift:839-843 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:883` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:557 — Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:557-561 | Sources/FoundationEssentials/ProgressManager/ProgressReporter.swift:71-75 — 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×21
  • Swallowed exception (caught, then discarded) Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:139 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:196 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:224 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:252 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:265 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:278 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:291 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:304 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:317 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:330 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:348 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/URL/URLTemplate.swift:165 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:307 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:289 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:725 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:743 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:763 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:783 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Decimal/Decimal.swift:410 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:213 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3040 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×20
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/URL/URL.swift:1301 — Sources/FoundationEssentials/URL/URL.swift:1301-1308 | Sources/FoundationEssentials/URL/URL.swift:1321-1328 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/URL/URL.swift:1241 — Sources/FoundationEssentials/URL/URL.swift:1241-1248 | Sources/FoundationEssentials/URL/URL.swift:1261-1268 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:40 — Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:40-45 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:71-76 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:448 — Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:448-453 | Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:457-463 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/Data/Data+Base64.swift:408 — Sources/FoundationEssentials/Data/Data+Base64.swift:408-413 | Sources/FoundationEssentials/Data/Data+Base64.swift:726-731 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:51 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:51-56 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:53-58 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/DateInterval.swift:184 — Sources/FoundationEssentials/DateInterval.swift:184-190 | Sources/FoundationEssentials/Locale/Locale.swift:910-915 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRuns.swift:162 — Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRuns.swift:162-167 | Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRuns.swift:197-202 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+IndexTracking.swift:88 — Sources/FoundationEssentials/AttributedString/AttributedString+IndexTracking.swift:88-93 | Sources/FoundationEssentials/AttributedString/AttributedString+IndexTracking.swift:101-106 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationInternationalization/String/String+SortComparator.swift:267 — Sources/FoundationInternationalization/String/String+SortComparator.swift:267-272 | Sources/FoundationInternationalization/String/String+SortComparator.swift:291-296 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:506 — Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:506-511 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:513-518 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:848 — Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:848-853 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:855-860 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:75 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:75-80 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:113-119 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:367 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:367-372 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:354-359 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/JSON/BufferView.swift:398 — Sources/FoundationEssentials/JSON/BufferView.swift:398-403 | Sources/FoundationEssentials/JSON/BufferView.swift:405-410 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationInternationalization/Formatting/ListFormatStyle.swift:266 — Sources/FoundationInternationalization/Formatting/ListFormatStyle.swift:266-271 | Sources/FoundationInternationalization/Formatting/ListFormatStyle.swift:298-303 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:116 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:116-121 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:542-547 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/Date.swift:357 — Sources/FoundationEssentials/Date.swift:357-362 | Sources/FoundationEssentials/URL/URLComponents.swift:1382-1388 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/Predicate/Expressions/Filter.swift:64 — Sources/FoundationEssentials/Predicate/Expressions/Filter.swift:64-69 | Sources/FoundationEssentials/Predicate/Expressions/Sequence.swift:196-201 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/FoundationEssentials/Predicate/Expressions/Dictionary.swift:120 — Sources/FoundationEssentials/Predicate/Expressions/Dictionary.swift:120-125 | Sources/FoundationEssentials/Predicate/Expressions/Optional.swift:148-153 — 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 (7 corresponding lines) · ×20
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:524 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:524-534 | Sources/FoundationEssentials/Calendar/Calendar_Protocol.swift:91-97 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:150 — Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:150-156 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:158-165 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:406 — Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:406-412 | Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:416-423 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Data/ContiguousBytes.swift:108 — Sources/FoundationEssentials/Data/ContiguousBytes.swift:108-114 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:131-137 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Data/Data+Writing.swift:425 — Sources/FoundationEssentials/Data/Data+Writing.swift:425-431 | Sources/FoundationEssentials/Data/Data+Writing.swift:433-439 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift:674 — Sources/FoundationEssentials/Calendar/Calendar.swift:674-685 | Sources/FoundationEssentials/Calendar/Calendar.swift:695-701 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:213 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:213-220 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:222-228 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Locale/Locale_Cache.swift:317 — Sources/FoundationEssentials/Locale/Locale_Cache.swift:317-324 | Sources/FoundationEssentials/Locale/Locale_Cache.swift:328-334 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Error/CocoaError.swift:172 — Sources/FoundationEssentials/Error/CocoaError.swift:172-178 | Sources/FoundationEssentials/Error/CocoaError.swift:180-186 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/String/StringBlocks.swift:193 — Sources/FoundationEssentials/String/StringBlocks.swift:193-199 | Sources/FoundationEssentials/String/StringBlocks.swift:201-207 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/NotificationCenter/AsyncMessage.swift:123 — Sources/FoundationEssentials/NotificationCenter/AsyncMessage.swift:123-131 | Sources/FoundationEssentials/NotificationCenter/AsyncMessage.swift:139-145 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/NotificationCenter/AsyncMessage+AsyncSequence.swift:36 — Sources/FoundationEssentials/NotificationCenter/AsyncMessage+AsyncSequence.swift:36-42 | Sources/FoundationEssentials/NotificationCenter/AsyncMessage+AsyncSequence.swift:50-56 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Bytes/Bytes+Mutation.swift:54 — Sources/FoundationEssentials/Bytes/Bytes+Mutation.swift:54-60 | Sources/FoundationEssentials/Bytes/Bytes+Mutation.swift:76-83 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/NotificationCenter/MainActorMessage.swift:120 — Sources/FoundationEssentials/NotificationCenter/MainActorMessage.swift:120-127 | Sources/FoundationEssentials/NotificationCenter/MainActorMessage.swift:136-142 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:543 — Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:543-549 | Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:552-558 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/NotificationCenter/AsyncMessage.swift:153 — Sources/FoundationEssentials/NotificationCenter/AsyncMessage.swift:153-159 | Sources/FoundationEssentials/NotificationCenter/MainActorMessage.swift:150-156 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:32 — Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift:32-40 | Sources/FoundationEssentials/PropertyList/XMLPlistMapBuildingSink.swift:65-71 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:107 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:107-113 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1492-1498 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift:1818 — Sources/FoundationEssentials/Calendar/Calendar.swift:1818-1826 | Sources/FoundationEssentials/SortComparator.swift:76-82 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:137 — Sources/FoundationEssentials/JSON/JSONPrimitive.swift:137-143 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:175-182 — 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) · ×20
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:449 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:449-457 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:459-467 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/Predicate/Archiving/Predicate+Codable.swift:63 — Sources/FoundationEssentials/Predicate/Archiving/Predicate+Codable.swift:63-71 | Sources/FoundationEssentials/Predicate/Archiving/Predicate+Codable.swift:84-92 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:191 — Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:191-200 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:202-210 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/Data/Data.swift:780 — Sources/FoundationEssentials/Data/Data.swift:780-788 | Sources/FoundationEssentials/Data/Data.swift:944-953 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:190 — Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:190-199 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:201-209 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationInternationalization/String/SortDescriptor.swift:459 — Sources/FoundationInternationalization/String/SortDescriptor.swift:459-467 | Sources/FoundationInternationalization/String/SortDescriptor.swift:481-489 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/Data/Data.swift:262 — Sources/FoundationEssentials/Data/Data.swift:262-270 | Sources/FoundationEssentials/Data/Data.swift:597-605 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:55 — Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:55-64 | Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:76-84 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/URL/URL_C+File.swift:163 — Sources/FoundationEssentials/URL/URL_C+File.swift:163-174 | Sources/FoundationEssentials/URL/URL_File.swift:213-221 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:345 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:345-353 | Sources/FoundationEssentials/JSON/JSONScanner.swift:453-462 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:199 — Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:199-207 | Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:211-219 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/Platform.swift:460 — Sources/FoundationEssentials/Platform.swift:460-468 | Sources/FoundationEssentials/Platform.swift:470-478 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:212 — Sources/FoundationEssentials/JSON/JSONPrimitive.swift:212-220 | Sources/FoundationEssentials/JSON/JSONPrimitive.swift:268-276 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:272 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:272-280 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:330-338 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift:1044 — Sources/FoundationEssentials/Calendar/Calendar.swift:1044-1052 | Sources/FoundationEssentials/Calendar/Calendar.swift:1059-1067 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:158 — Sources/FoundationEssentials/JSON/JSONPrimitive.swift:158-166 | Sources/FoundationEssentials/JSON/JSONPrimitive.swift:171-179 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/URL/URL_Swift.swift:458 — Sources/FoundationEssentials/URL/URL_Swift.swift:458-466 | Sources/FoundationEssentials/URL/URL_Swift.swift:468-479 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1337 — Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1337-1345 | Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:245-253 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:44 — Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:44-52 | Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:66-74 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:238 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:238-249 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:75-83 — 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.
D3 · God Classes · ClassTooLong · ×18
  • ClassTooLong: _CalendarHebrew Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:22 — ClassTooLong — 951 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 551 over it, 2.38× 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: _LocaleICU Sources/FoundationInternationalization/Locale/Locale_ICU.swift:37 — ClassTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 454 over it, 2.14× 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: Calendar Sources/FoundationEssentials/Calendar/Calendar.swift:21 — ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded), 105 methods. The bar is 400 significant lines; this is 453 over it, 2.13× 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: URLComponents Sources/FoundationEssentials/URL/URLComponents.swift:20 — ClassTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 319 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _SwiftURL Sources/FoundationEssentials/URL/URL_Swift.swift:29 — ClassTooLong — 654 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 254 over it, 1.64× 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: _FileOperations Sources/FoundationEssentials/FileManager/FileOperations.swift:328 — ClassTooLong — 628 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 228 over it, 1.57× 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: __CharacterSetStorage Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:37 — ClassTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 162 over it, 1.41× 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: _CalendarChinese Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:240 — ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 155 over it, 1.39× 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: PredicateQueryRewriter Sources/FoundationMacros/PredicateMacro.swift:413 — ClassTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 135 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.
  • ClassTooLong: Data Sources/FoundationEssentials/Data/Data.swift:123 — ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 100 methods. The bar is 400 significant lines; this is 100 over it, 1.25× 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: RFC3986Parser REDACTED:192 — ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 98 over it, 1.25× 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: _CalendarFixedMonth Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:16 — ClassTooLong — 488 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 88 over it, 1.22× 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: DatePatternFormatter Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:26 — ClassTooLong — 480 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 80 over it, 1.20× 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: XMLPlistSpanReader Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:506 — ClassTooLong — 479 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 79 over it, 1.20× 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: SortDescriptor Sources/FoundationInternationalization/String/SortDescriptor.swift:20 — ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 74 over it, 1.19× 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: BPlistPrimitive Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:315 — ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 70 over it, 1.18× 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: XMLPlistScanner Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:682 — ClassTooLong — 456 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 56 over it, 1.14× 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: IndexPath Sources/FoundationEssentials/IndexPath.swift:20 — ClassTooLong — 445 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 45 over it, 1.11× 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×17
  • Hotspot: Sources/FoundationEssentials/Decimal/Decimal.swift Sources/FoundationEssentials/Decimal/Decimal.swift:478 — Sources/FoundationEssentials/Decimal/Decimal.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in Decimal.__decimal at line 478. 2 of those changes were fix/bug commits, and the other 7 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/Decimal/Decimal.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/FoundationEssentials/Calendar/Calendar_Chinese.swift Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:823 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in _CalendarChinese.addingComponents at line 823. 2 of those changes were fix/bug commits, and the other 4 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/Calendar/Calendar_Chinese.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/FoundationEssentials/URL/URL_Parsing.swift Sources/FoundationEssentials/URL/URL_Parsing.swift:883 — Sources/FoundationEssentials/URL/URL_Parsing.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in URL.encode at line 883. 1 of those changes was a fix/bug commit, and the other 6 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/URL/URL_Parsing.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/FoundationEssentials/Data/Data+Base64.swift Sources/FoundationEssentials/Data/Data+Base64.swift:733 — Sources/FoundationEssentials/Data/Data+Base64.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in Base64._decodeIgnoringErrors at line 733. 1 of those changes was a fix/bug commit, and the other 7 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/Data/Data+Base64.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/FoundationEssentials/String/String+Comparison.swift Sources/FoundationEssentials/String/String+Comparison.swift:245 — Sources/FoundationEssentials/String/String+Comparison.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in _StringCompareOptionsIterable._range at line 245. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/String/String+Comparison.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/FoundationEssentials/JSON/JSONDecoder.swift Sources/FoundationEssentials/JSON/JSONDecoder.swift:1017 — Sources/FoundationEssentials/JSON/JSONDecoder.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in JSONLegacyDecoderImpl.unwrapFloatingPoint at line 1017. 2 of those changes were fix/bug commits, and the other 9 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/JSON/JSONDecoder.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/FoundationEssentials/Decimal/Decimal+Math.swift Sources/FoundationEssentials/Decimal/Decimal+Math.swift:1141 — Sources/FoundationEssentials/Decimal/Decimal+Math.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in Decimal._assemble at line 1141. 2 of those changes were fix/bug commits, and the other 3 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/Decimal/Decimal+Math.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/FoundationEssentials/String/StringProtocol+Essentials.swift Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:53 — Sources/FoundationEssentials/String/StringProtocol+Essentials.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in String.data at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/String/StringProtocol+Essentials.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: Benchmarks/Benchmarks/Internationalization/BenchmarkCalendar.swift Benchmarks/Benchmarks/Internationalization/BenchmarkCalendar.swift:30 — Benchmarks/Benchmarks/Internationalization/BenchmarkCalendar.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in BenchmarkCalendar.swift.calendarBenchmarks at line 30. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Benchmarks/Benchmarks/Internationalization/BenchmarkCalendar.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/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift:352 — Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in BuiltInUnicodeScalarSet.appendBitmap at line 352. 3 of those changes were fix/bug commits, and the other 5 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.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/FoundationEssentials/FileManager/FileManager+Directories.swift Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:324 — Sources/FoundationEssentials/FileManager/FileManager+Directories.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in _FileManagerImpl.createDirectory at line 324. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/FileManager/FileManager+Directories.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/FoundationEssentials/FileManager/FileManager+Basics.swift Sources/FoundationEssentials/FileManager/FileManager+Basics.swift:70 — Sources/FoundationEssentials/FileManager/FileManager+Basics.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in _FileManagerImpl.contentsEqual at line 70. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/FileManager/FileManager+Basics.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/FoundationInternationalization/Locale/Locale_ICU.swift Sources/FoundationInternationalization/Locale/Locale_ICU.swift:183 — Sources/FoundationInternationalization/Locale/Locale_ICU.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in _LocaleICU.init at line 183. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationInternationalization/Locale/Locale_ICU.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/FoundationEssentials/Data/Data+Reading.swift Sources/FoundationEssentials/Data/Data+Reading.swift:228 — Sources/FoundationEssentials/Data/Data+Reading.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in Data+Reading.swift.readBytesFromFile at line 228. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/Data/Data+Reading.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/FoundationEssentials/String/String+Path.swift Sources/FoundationEssentials/String/String+Path.swift:641 — Sources/FoundationEssentials/String/String+Path.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in String._resolvingSymlinksInPath at line 641. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/String/String+Path.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/FoundationEssentials/Calendar/Calendar_Gregorian.swift Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1449 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in _CalendarGregorian.dateInterval at line 1449. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- Sources/FoundationEssentials/Calendar/Calendar_Gregorian.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: REDACTED REDACTED:442 — REDACTED changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in _URLInfo.originalString at line 442. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 15:52:16 -08:00' --until='2026-11-13 15:52:16 -08:00' --full-history --no-merges -- REDACTED`: 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×16
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:99 — Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:99-105 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift:99-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:763 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:763-769 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:724-730 — 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/FoundationEssentials/Calendar/Calendar_Chinese.swift:763` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoder.swift:1018 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:1018-1024 | Sources/FoundationEssentials/JSON/JSONDecoder.swift:1118-1124 — 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/FoundationEssentials/JSON/JSONDecoder.swift:1018` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:224 — Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:224-230 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:279-285 — 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/FoundationEssentials/JSON/JSONDecoderImpl.swift:224` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/URL/URL_C+Parsing.swift:69 — Sources/FoundationEssentials/URL/URL_C+Parsing.swift:69-75 | Sources/FoundationEssentials/URL/URL_C+Parsing.swift:83-89 — 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/FoundationEssentials/URL/URL_C+Parsing.swift:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/URL/URL_Swift.swift:1218 — Sources/FoundationEssentials/URL/URL_Swift.swift:1218-1224 | Sources/FoundationEssentials/URL/URL_Swift.swift:1230-1236 — 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/FoundationEssentials/URL/URL_Swift.swift:1218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:694 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:694-703 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:928-934 — 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/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:46 — Sources/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:46-52 | Sources/FoundationInternationalization/Formatting/Number/IntegerParseStrategy.swift:44-50 — 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/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:175 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:175-181 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:622-628 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1036 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1036-1042 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:646-652 — 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/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1036` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:355 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:355-361 | Sources/FoundationEssentials/JSON/JSONScanner.swift:464-470 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:196 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:196-202 | Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:127-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:204 — Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:204-210 | Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1275-1281 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:212 — Sources/FoundationInternationalization/Formatting/Date/Date+VerbatimFormatStyle.swift:212-218 | Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1283-1289 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/Calendar/DateComponents.swift:800 — Sources/FoundationEssentials/Calendar/DateComponents.swift:800-806 | Sources/FoundationEssentials/URL/URLComponents.swift:1313-1319 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:58 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:58-64 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:45-51 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×15
  • Edited copy of a member (11 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:30 — Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:30-40 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:28-38 — 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/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:32 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:32-42 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:33-43 — 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/FoundationEssentials/JSON/JSONPrimitiveSource.swift:118 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:118-128 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:119-129 — 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/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:216 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:216-226 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:207-218 — 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/FoundationEssentials/Calendar/Calendar_Chinese.swift:242 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:242-252 | Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:18-28 — 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/_FoundationInternationalizationData/DateFormatLookup.swift:86 — Sources/_FoundationInternationalizationData/DateFormatLookup.swift:86-96 | Sources/_FoundationInternationalizationData/ListFormatLookup.swift:117-134 — 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/FoundationEssentials/Calendar/CalendarUtility.swift:124 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:124-134 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:551-561 — 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/FoundationEssentials/Bytes/RigidBytes+Mutation.swift:70 — Sources/FoundationEssentials/Bytes/RigidBytes+Mutation.swift:70-89 | Sources/FoundationEssentials/Bytes/RigidBytes+Mutation.swift:95-105 — 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/FoundationEssentials/AttributedString/AttributedString+Runs.swift:351 — Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:351-362 | Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:379-389 — 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/FoundationEssentials/AttributedString/Collection Stdlib Defaults.swift:87 — Sources/FoundationEssentials/AttributedString/Collection Stdlib Defaults.swift:87-97 | Sources/FoundationEssentials/AttributedString/Collection Stdlib Defaults.swift:99-114 — 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/FoundationEssentials/CodableWithConfiguration.swift:114 — Sources/FoundationEssentials/CodableWithConfiguration.swift:114-124 | Sources/FoundationEssentials/CodableWithConfiguration.swift:133-143 — 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/FoundationEssentials/Calendar/Calendar.swift:1773 — Sources/FoundationEssentials/Calendar/Calendar.swift:1773-1787 | Sources/FoundationEssentials/Calendar/Calendar.swift:1806-1816 — 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/FoundationEssentials/AttributedString/Collection Stdlib Defaults.swift:35 — Sources/FoundationEssentials/AttributedString/Collection Stdlib Defaults.swift:35-45 | Sources/FoundationEssentials/AttributedString/Collection Stdlib Defaults.swift:47-62 — 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) REDACTED:324 — REDACTED:324-334 | REDACTED:336-347 — 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/FoundationEssentials/URL/URL_Impl.swift:1526 — Sources/FoundationEssentials/URL/URL_Impl.swift:1526-1536 | Sources/FoundationEssentials/URL/URL_Swift.swift:943-953 — 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) · ×15
  • Edited copy of a member (8 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:853 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:853-862 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:408-415 — 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/FoundationInternationalization/Formatting/Date/Date+AnchoredRelativeFormatStyle.swift:136 — Sources/FoundationInternationalization/Formatting/Date/Date+AnchoredRelativeFormatStyle.swift:136-143 | Sources/FoundationInternationalization/Formatting/Date/Date+AnchoredRelativeFormatStyle.swift:145-152 — 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/FoundationEssentials/Calendar/CalendarUtility.swift:429 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:429-436 | Sources/FoundationEssentials/Calendar/CalendarUtility.swift:439-446 — 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/FoundationEssentials/PropertyList/PlistDecoder.swift:440 — Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:440-447 | Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:449-456 — 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/FoundationEssentials/Predicate/Archiving/PredicateCodableConfiguration.swift:263 — Sources/FoundationEssentials/Predicate/Archiving/PredicateCodableConfiguration.swift:263-270 | Sources/FoundationEssentials/Predicate/Archiving/PredicateCodableConfiguration.swift:272-279 — 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/FoundationEssentials/Predicate/NSPredicateConversion.swift:581 — Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:581-588 | Sources/FoundationEssentials/Predicate/NSPredicateConversion.swift:593-600 — 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/FoundationEssentials/FileManager/FileOperations.swift:157 — Sources/FoundationEssentials/FileManager/FileOperations.swift:157-164 | Sources/FoundationEssentials/FileManager/FileOperations.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/FoundationEssentials/Predicate/Predicate+Description.swift:261 — Sources/FoundationEssentials/Predicate/Predicate+Description.swift:261-268 | Sources/FoundationEssentials/Predicate/Predicate+Description.swift:374-381 — 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/FoundationEssentials/PropertyList/BPlistPrimitive.swift:590 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:590-597 | Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:601-608 — 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/FoundationEssentials/URL/URL_Impl.swift:739 — Sources/FoundationEssentials/URL/URL_Impl.swift:739-746 | Sources/FoundationEssentials/URL/URL_Swift.swift:579-586 — 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/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:797 — Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:797-804 | Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:845-852 — 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/FoundationInternationalization/Formatting/Number/FloatingPointFormatStyle.swift:216 — Sources/FoundationInternationalization/Formatting/Number/FloatingPointFormatStyle.swift:216-223 | Sources/FoundationInternationalization/Formatting/Number/IntegerFormatStyle.swift:231-238 — 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/FoundationEssentials/JSON/JSONPrimitive.swift:247 — Sources/FoundationEssentials/JSON/JSONPrimitive.swift:247-254 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:307-314 — 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/FoundationEssentials/TimeZone/TimeZone_GMT.swift:17 — Sources/FoundationEssentials/TimeZone/TimeZone_GMT.swift:17-24 | Sources/FoundationInternationalization/TimeZone/TimeZone_GMTICU.swift:32-39 — 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/FoundationEssentials/TimeZone/TimeZone_GMT.swift:26 — Sources/FoundationEssentials/TimeZone/TimeZone_GMT.swift:26-33 | Sources/FoundationInternationalization/TimeZone/TimeZone_GMTICU.swift:41-48 — 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 (8 lines × 2) · ×15
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/Calendar/DateComponents.swift:45 — Sources/FoundationEssentials/Calendar/DateComponents.swift:45-52 | Sources/FoundationEssentials/Calendar/DateComponents.swift:83-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:450 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:450-457 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:460-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:111 — Sources/FoundationEssentials/Decimal/Decimal+Math.swift:111-118 | Sources/FoundationEssentials/Decimal/Decimal+Math.swift:151-158 — 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/FoundationEssentials/Decimal/Decimal+Math.swift:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:138 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:138-145 | Sources/FoundationEssentials/JSON/JSONScanner.swift:272-279 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:256 — Sources/FoundationEssentials/Locale/Locale_Preferences.swift:256-263 | Sources/FoundationEssentials/Locale/Locale_Preferences.swift:269-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Locale/Locale_Preferences.swift:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/Predicate/Predicate.swift:105 — Sources/FoundationEssentials/Predicate/Predicate.swift:105-112 | Sources/FoundationEssentials/Predicate/Predicate.swift:124-131 — 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/FoundationEssentials/Predicate/Predicate.swift:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FoundationEssentials/Predicate/Predicate.swift:102` calls `available` and `Sources/FoundationEssentials/Predicate/Predicate.swift:121` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:249 — Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:249-256 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:260-267 — 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/FoundationEssentials/PropertyList/PlistEncoder.swift:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:373 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:373-380 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:499-506 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:122 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:122-129 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:139-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:151 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:151-158 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:172-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/URL/URLEncoder.swift:708 — Sources/FoundationEssentials/URL/URLEncoder.swift:708-715 | Sources/FoundationEssentials/URL/URLTemplate_PercentEncoding.swift:94-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/URL/URLEncoder.swift:708` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/Predicate/Predicate+Description.swift:350 — Sources/FoundationEssentials/Predicate/Predicate+Description.swift:350-357 | Sources/FoundationEssentials/Predicate/Predicate+Description.swift:362-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoder.swift:1102 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:1102-1109 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:260-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSONDecoder.swift:1102` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:135 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:135-142 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:138-145 — before extracting anything, compare `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift` and `Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:216 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:216-223 | Sources/FoundationEssentials/JSON/JSONScanner.swift:350-357 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×14
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:18 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:18-30 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:20-31 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/Data/Representations/DataStorage.swift:184 — Sources/FoundationEssentials/Data/Representations/DataStorage.swift:184-195 | Sources/FoundationEssentials/Data/Representations/DataStorage.swift:210-221 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:637 — Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:637-648 | Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:651-662 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/CodableUtilities.swift:595 — Sources/FoundationEssentials/CodableUtilities.swift:595-606 | Sources/FoundationEssentials/CodableUtilities.swift:608-620 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:491 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:491-504 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:478-489 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/TimeZone/TimeZone.swift:327 — Sources/FoundationEssentials/TimeZone/TimeZone.swift:327-342 | Sources/FoundationEssentials/URL/URL.swift:2065-2076 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:330 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:330-343 | Sources/FoundationEssentials/JSON/JSONScanner.swift:440-451 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:1489 — Sources/FoundationEssentials/URL/URL_Impl.swift:1489-1500 | Sources/FoundationEssentials/URL/URL_Swift.swift:912-923 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:329 — Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:329-340 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:350-364 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:992 — Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:992-1003 | Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:1006-1017 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:974 — Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:974-986 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:989-1000 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3258 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3258-3269 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3271-3282 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:306 — Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:306-322 | Sources/FoundationEssentials/FileManager/FileManager+Files.swift:316-327 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:642 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:642-653 | Sources/FoundationEssentials/JSON/JSONEncoder.swift:695-706 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×14
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/Data/DataProtocol.swift:337 — Sources/FoundationEssentials/Data/DataProtocol.swift:337-342 | Sources/FoundationEssentials/Data/DataProtocol.swift:361-366 — 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 (6 lines × 2) Sources/FoundationEssentials/Formatting/Date+HTTPFormatStyle.swift:103 — Sources/FoundationEssentials/Formatting/Date+HTTPFormatStyle.swift:103-108 | Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:492-497 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:951 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:951-956 | Sources/FoundationEssentials/JSON/JSONScanner.swift:923-928 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:951` 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 `ascii` to `"x")` in one and `".")` 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 (6 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1104 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1104-1109 | Sources/FoundationEssentials/JSON/JSONScanner.swift:1021-1026 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoder.swift:794 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:794-800 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:366-371 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoder.swift:802 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:802-807 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:373-378 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:192 — Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:192-197 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:215-221 — 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 (6 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:631 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:631-636 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:670-675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:74 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:74-79 | Sources/FoundationEssentials/JSON/JSONScanner.swift:203-208 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/Predicate/Expressions/Arithmetic.swift:74 — Sources/FoundationEssentials/Predicate/Expressions/Arithmetic.swift:74-79 | Sources/FoundationEssentials/Predicate/Expressions/Comparison.swift:76-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:1139 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:1139-1144 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:330-335 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:85 — Sources/FoundationEssentials/JSON/JSONPrimitive.swift:85-90 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:79-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `mapOffset` to `Int` in one and `XMLPlistMapOffset` 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 (6 lines × 2) Sources/FoundationEssentials/Predicate/Expressions/Arithmetic.swift:81 — Sources/FoundationEssentials/Predicate/Expressions/Arithmetic.swift:81-86 | Sources/FoundationEssentials/Predicate/Expressions/Comparison.swift:83-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:329 — Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:329-334 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:443-448 — 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/FoundationEssentials/JSON/JSONDecoderImpl.swift:329` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×13
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:368 — Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:368-372 | Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:374-381 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:24 — Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:24-28 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:22-26 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:419 — Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:419-423 | Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:425-431 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:276 — Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:276-280 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:521-529 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:958 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:958-962 | Sources/FoundationEssentials/JSON/JSON5Scanner.swift:964-968 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/Predicate/Predicate+Description.swift:395 — Sources/FoundationEssentials/Predicate/Predicate+Description.swift:395-399 | Sources/FoundationEssentials/Predicate/Predicate+Description.swift:406-410 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift:148 — Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift:148-152 | Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift:165-169 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:358 — Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:358-362 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:549-556 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:247 — Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:247-251 | Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:253-257 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:128 — Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:128-132 | Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:144-149 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:28 — Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:28-32 | Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:34-42 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/String/String+Comparison.swift:619 — Sources/FoundationEssentials/String/String+Comparison.swift:619-623 | Sources/FoundationEssentials/String/String+Comparison.swift:644-648 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:191 — Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:191-195 | Sources/FoundationEssentials/Predicate/Expressions/Sequence.swift:230-234 — 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 copy of a member (10 corresponding lines) · ×11
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:42 — Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:42-51 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:40-49 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:394 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:394-403 | Sources/FoundationEssentials/JSON/JSONDecoder.swift:405-415 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedStringProtocol.swift:295 — Sources/FoundationEssentials/AttributedString/AttributedStringProtocol.swift:295-304 | Sources/FoundationEssentials/AttributedString/AttributedStringProtocol.swift:310-321 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift:154 — Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift:154-163 | Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift:171-183 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/Calendar/RecurrenceRule.swift:384 — Sources/FoundationEssentials/Calendar/RecurrenceRule.swift:384-393 | Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:728-737 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/Bytes/RigidBytes.swift:55 — Sources/FoundationEssentials/Bytes/RigidBytes.swift:55-64 | Sources/FoundationEssentials/UUID.swift:37-50 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/URL/URL_Bridge.swift:269 — Sources/FoundationEssentials/URL/URL_Bridge.swift:269-279 | Sources/FoundationEssentials/URL/URL_Bridge.swift:281-290 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:463 — Sources/FoundationEssentials/FileManager/FileManager+Files.swift:463-472 | Sources/FoundationEssentials/FileManager/FileManager+Files.swift:474-486 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) REDACTED:1006 — REDACTED:1006-1015 | REDACTED:1045-1054 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift:1087 — Sources/FoundationEssentials/Calendar/Calendar.swift:1087-1096 | Sources/FoundationEssentials/Calendar/Calendar.swift:1136-1145 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:936 — Sources/FoundationEssentials/URL/URL_Impl.swift:936-945 | Sources/FoundationEssentials/URL/URL_Swift.swift:633-642 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×11
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:197 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:197-205 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:188-196 — before extracting anything, compare `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift` and `Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:470 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:470-478 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:481-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:82 — Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:82-90 | Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:224-232 — 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/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:157 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:157-165 | Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:181-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:157` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1158 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1158-1166 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:308-318 — 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/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:159 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:159-167 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:185-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:159` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:438 — Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:438-446 | Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:141-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:139` calls `Mutex`, `Calendar` and `Sources/FoundationEssentials/URL/URLComponents_ObjC.swift:437` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/URL/URL_Impl.swift:1492 — Sources/FoundationEssentials/URL/URL_Impl.swift:1492-1500 | Sources/FoundationEssentials/URL/URL_Swift.swift:915-923 — 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/FoundationEssentials/URL/URL_Impl.swift:1492` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:511 — Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:511-519 | Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:524-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) Sources/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:35 — Sources/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:35-43 | Sources/FoundationInternationalization/Formatting/Number/IntegerParseStrategy.swift:34-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:34` calls `available` and `Sources/FoundationInternationalization/Formatting/Number/IntegerParseStrategy.swift:32` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:320 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:320-328 | Sources/FoundationEssentials/Calendar/Calendar_Protocol.swift:81-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×10
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:262 — Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:262-273 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:411-422 — 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/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:262` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:294 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:294-305 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:277-288 — before extracting anything, compare `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift` and `Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:294` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:883 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:883-894 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1477-1488 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:883` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:315 — Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:315-326 | Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:375-386 — 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/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:315` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:116 — Sources/FoundationEssentials/Locale/Locale_Preferences.swift:116-127 | Sources/FoundationEssentials/Locale/Locale_Preferences.swift:145-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:117 — Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:117-128 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:189-200 — 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/FoundationEssentials/PropertyList/PlistEncoder.swift:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:387 — Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:387-398 | Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:426-437 — 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/FoundationEssentials/String/StringProtocol+Essentials.swift:387` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/URL/URL_Resolution.swift:180 — Sources/FoundationEssentials/URL/URL_Resolution.swift:180-191 | Sources/FoundationEssentials/URL/URL_Resolution.swift:268-279 — 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/FoundationEssentials/URL/URL_Resolution.swift:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:66 — Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:66-77 | Sources/FoundationInternationalization/Formatting/Number/IntegerParseStrategy.swift:60-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1458 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1458-1469 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1597-1608 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1458` 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 (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:210 — Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:210-219 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:381-390 — 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/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:210` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedSubstring.swift:168 — Sources/FoundationEssentials/AttributedString/AttributedSubstring.swift:168-177 | Sources/FoundationEssentials/AttributedString/DiscontiguousAttributedSubstring.swift:112-121 — 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/FoundationEssentials/AttributedString/AttributedSubstring.swift:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:339 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:339-348 | Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:363-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:322 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:322-331 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:951-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:63 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:63-72 | Sources/FoundationEssentials/JSON/JSONScanner.swift:192-201 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:266 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:266-275 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:253-262 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:232 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:232-241 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:666-675 — 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/FoundationEssentials/PropertyList/BPlistScanner.swift:232` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/String/String+Internals.swift:199 — Sources/FoundationEssentials/String/String+Internals.swift:199-208 | Sources/FoundationEssentials/String/String+Internals.swift:225-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:401 — Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:401-410 | Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:440-449 — 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/FoundationEssentials/String/StringProtocol+Essentials.swift:401` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:52 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:52-61 | Sources/FoundationEssentials/JSON/JSONScanner.swift:181-190 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×9
  • Edited copy of a member (14 corresponding lines) Sources/FoundationEssentials/Span+Utils.swift:162 — Sources/FoundationEssentials/Span+Utils.swift:162-175 | Sources/FoundationEssentials/Span+Utils.swift:229-242 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationInternationalization/TimeZone/TimeZone_ICU.swift:249 — Sources/FoundationInternationalization/TimeZone/TimeZone_ICU.swift:249-263 | Sources/FoundationInternationalization/TimeZone/TimeZone_ICU.swift:266-279 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:466 — Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:466-483 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:485-498 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:181 — Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:181-197 | Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:199-212 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift:382 — Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift:382-395 | Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift:404-418 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:282 — Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:282-295 | Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:298-311 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:751 — Sources/FoundationInternationalization/Locale/Locale_ICU.swift:751-764 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:805-818 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1015 — Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1015-1028 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1046-1059 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:1052 — Sources/FoundationEssentials/Decimal/Decimal+Math.swift:1052-1065 | Sources/FoundationEssentials/Decimal/Decimal+Math.swift:1067-1081 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×8
  • Edited copy of a member (18 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:375 — Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:375-392 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:404-424 — 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/FoundationEssentials/Calendar/Calendar_Gregorian.swift:735 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:735-752 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:926-943 — 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/FoundationEssentials/Predicate/Predicate.swift:104 — Sources/FoundationEssentials/Predicate/Predicate.swift:104-121 | Sources/FoundationEssentials/Predicate/Predicate.swift:123-140 — 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/FoundationEssentials/URL/URL_Impl.swift:271 — Sources/FoundationEssentials/URL/URL_Impl.swift:271-291 | Sources/FoundationEssentials/URL/URL_Swift.swift:235-252 — 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/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:307 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:307-324 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:290-307 — 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/FoundationEssentials/AttributedString/Conversion.swift:151 — Sources/FoundationEssentials/AttributedString/Conversion.swift:151-168 | Sources/FoundationEssentials/AttributedString/Conversion.swift:186-203 — 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/FoundationEssentials/PropertyList/BPlistPrimitive.swift:1096 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:1096-1113 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:310-327 — 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/FoundationEssentials/Calendar/Calendar_Cache.swift:104 — Sources/FoundationEssentials/Calendar/Calendar_Cache.swift:104-123 | Sources/FoundationEssentials/Calendar/Calendar_Cache.swift:141-158 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×8
  • Edited copy of a member (13 corresponding lines) Sources/FoundationEssentials/URL/URL_C+Parsing.swift:63 — Sources/FoundationEssentials/URL/URL_C+Parsing.swift:63-75 | Sources/FoundationEssentials/URL/URL_C+Parsing.swift:77-89 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/FoundationEssentials/JSON/BufferView.swift:318 — Sources/FoundationEssentials/JSON/BufferView.swift:318-330 | Sources/FoundationEssentials/JSON/BufferView.swift:337-349 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/FoundationInternationalization/ICU/ICU+Foundation.swift:125 — Sources/FoundationInternationalization/ICU/ICU+Foundation.swift:125-137 | Sources/FoundationInternationalization/ICU/ICU+Foundation.swift:172-184 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:55 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:55-68 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:70-82 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/FoundationEssentials/JSON/JSONScanner.swift:1062 — Sources/FoundationEssentials/JSON/JSONScanner.swift:1062-1074 | Sources/FoundationEssentials/JSON/JSONScanner.swift:1078-1090 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:920 — Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:920-937 | Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:939-951 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2030 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2030-2042 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:745-758 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/FoundationInternationalization/Formatting/Date/ICUDateFormatter.swift:525 — Sources/FoundationInternationalization/Formatting/Date/ICUDateFormatter.swift:525-537 | Sources/FoundationInternationalization/Formatting/Date/ICUDateFormatter.swift:539-551 — 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 · Duplicated block (5 lines × 3) · ×8
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:336 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:336-340 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3192-3204 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1370-1374 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/CalendarUtility.swift:336` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/JSON/JSONScanner.swift:57 — Sources/FoundationEssentials/JSON/JSONScanner.swift:57-61 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:75-79 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:150-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSONScanner.swift:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:440 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:440-444 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:397-403 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:207-212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:440` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/Predicate/Expressions/StringComparison.swift:58 — Sources/FoundationEssentials/Predicate/Expressions/StringComparison.swift:58-62 | Sources/FoundationInternationalization/Predicate/LocalizedString.swift:63-67 | Sources/FoundationInternationalization/Predicate/LocalizedString.swift:127-131 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/Predicate/Expressions/StringComparison.swift:64 — Sources/FoundationEssentials/Predicate/Expressions/StringComparison.swift:64-68 | Sources/FoundationInternationalization/Predicate/LocalizedString.swift:69-73 | Sources/FoundationInternationalization/Predicate/LocalizedString.swift:133-137 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:62 — Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:62-66 | Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:130-134 | Sources/FoundationEssentials/Predicate/Expressions/Dictionary.swift:57-61 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:68 — Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:68-72 | Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:136-140 | Sources/FoundationEssentials/Predicate/Expressions/Dictionary.swift:63-67 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:159 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:159-163 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:165-169 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:146-150 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×7
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:126 — Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:126-151 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:161-193 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:204-243 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:255-301 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:197 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:197-214 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:99-114 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift:99-114 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:188-205 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:374 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:374-448 | Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:161-249 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:502-615 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:164-216 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1865 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1865-1908 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:563-610 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:764-933 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:939-946 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/CodableUtilities.swift:262 — Sources/FoundationEssentials/CodableUtilities.swift:262-292 | Sources/FoundationEssentials/CodableUtilities.swift:294-330 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:737-761 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:763-793 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:149 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:149-165 | Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:167-192 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:148-167 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:169-196 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FoundationEssentials/ProgressManager/ProgressManager+Interop.swift:310 — Sources/FoundationEssentials/ProgressManager/ProgressManager+Interop.swift:310-344 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:64-103 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:108-150 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:163-204 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 4+ corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:417 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:417-420 | Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:134-137 | Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:139-142 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:132 — Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:132-135 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:137-140 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:142-146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Sources/FoundationEssentials/URL/URL.swift:1679 — Sources/FoundationEssentials/URL/URL.swift:1679-1682 | Sources/FoundationEssentials/URL/URL.swift:1711-1714 | Sources/FoundationEssentials/URL/URL.swift:1754-1757 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Sources/FoundationEssentials/URL/URL.swift:1695 — Sources/FoundationEssentials/URL/URL.swift:1695-1698 | Sources/FoundationEssentials/URL/URL.swift:1726-1729 | Sources/FoundationEssentials/URL/URL.swift:1763-1766 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:936 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:936-939 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:258-261 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:245-248 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:461 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:461-464 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:459-462 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:448-451 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:825 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:825-828 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:175-178 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:162-165 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 3+ corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift:443 — Sources/FoundationEssentials/Calendar/Calendar.swift:443-445 | Sources/FoundationEssentials/Calendar/Calendar.swift:449-452 | Sources/FoundationEssentials/Calendar/Calendar_Cache.swift:160-165 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:79 — Sources/FoundationEssentials/PropertyList/BPlistLegacyDecodingFormat.swift:79-81 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:86-88 | Sources/FoundationEssentials/PropertyList/XMLPlistLegacyDecodingFormat.swift:90-92 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:54 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:54-56 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:51-53 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:49-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Sources/FoundationEssentials/TimeZone/TimeZone.swift:175 — Sources/FoundationEssentials/TimeZone/TimeZone.swift:175-177 | Sources/FoundationEssentials/TimeZone/TimeZone_Autoupdating.swift:54-56 | Sources/FoundationInternationalization/TimeZone/TimeZone_GMTICU.swift:74-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:302 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:302-304 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:300-302 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:289-291 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:298 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:298-300 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:296-298 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:285-287 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:23 — Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:23-25 | Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifier.swift:416-418 | Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift:185-187 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×7
  • Duplicated block (11 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:327 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:327-337 | Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:351-361 — 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/FoundationEssentials/Calendar/Calendar_Chinese.swift:327` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) Sources/FoundationEssentials/FileManager/FileManager+SymbolicLinks.swift:44 — Sources/FoundationEssentials/FileManager/FileManager+SymbolicLinks.swift:44-54 | Sources/FoundationEssentials/FileManager/FileManager+SymbolicLinks.swift:107-117 — 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/FoundationEssentials/FileManager/FileManager+SymbolicLinks.swift:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:182 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:182-192 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:186-196 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:182` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) Sources/FoundationEssentials/JSON/JSONScanner.swift:113 — Sources/FoundationEssentials/JSON/JSONScanner.swift:113-123 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:241-251 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:101 — Sources/FoundationEssentials/Locale/Locale_Preferences.swift:101-111 | Sources/FoundationEssentials/Locale/Locale_Preferences.swift:132-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Locale/Locale_Preferences.swift:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:829 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:829-839 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:911-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1471 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1471-1481 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1591-1601 — 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/FoundationInternationalization/Calendar/Calendar_ICU.swift:1471` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×6
  • Edited copy of a member (21 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:130 — Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:130-153 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:155-178 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:212 — Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:212-234 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:236-256 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Sources/FoundationEssentials/String/String+IO.swift:457 — Sources/FoundationEssentials/String/String+IO.swift:457-477 | Sources/FoundationEssentials/String/String+IO.swift:480-500 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:95 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:95-116 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:97-117 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:131 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:131-153 | Sources/FoundationEssentials/JSON/JSONScanner.swift:267-287 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:750 — Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:750-771 | Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:774-794 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×6
  • Edited copy of a member (22 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:745 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:745-767 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:454-475 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:285 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:285-308 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:316-337 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:326 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:326-347 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:309-330 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Sources/FoundationEssentials/Error/CocoaError+FilePath.swift:178 — Sources/FoundationEssentials/Error/CocoaError+FilePath.swift:178-199 | Sources/FoundationEssentials/Error/CocoaError+FilePath.swift:201-222 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:87 — Sources/FoundationEssentials/FileManager/FileManager+Files.swift:87-108 | Sources/FoundationEssentials/FileManager/FileManager+Files.swift:110-134 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Sources/FoundationInternationalization/Formatting/ByteCountFormatStyle.swift:382 — Sources/FoundationInternationalization/Formatting/ByteCountFormatStyle.swift:382-403 | Sources/FoundationInternationalization/Formatting/Number/NumberAttributedFormat.swift:53-74 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×6
  • Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:214 — Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:214-237 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:239-274 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Sources/FoundationInternationalization/String/KeyPathComparator.swift:110 — Sources/FoundationInternationalization/String/KeyPathComparator.swift:110-133 | Sources/FoundationInternationalization/String/KeyPathComparator.swift:148-171 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:339 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:339-362 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:366-393 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:700 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:700-724 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:726-749 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:394 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:394-417 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:419-447 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:295 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:295-318 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:200-236 — 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 (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:908 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:908-924 | Sources/FoundationEssentials/JSON/JSONScanner.swift:892-908 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:547 — Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:547-563 | Sources/FoundationEssentials/ProgressManager/ProgressReporter.swift:60-77 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Sources/FoundationEssentials/Data/DataProtocol.swift:336 — Sources/FoundationEssentials/Data/DataProtocol.swift:336-352 | Sources/FoundationEssentials/Data/DataProtocol.swift:360-376 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistMap.swift:197 — Sources/FoundationEssentials/PropertyList/XMLPlistMap.swift:197-213 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:454-470 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:576 — Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:576-592 | Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:594-610 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:687 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:687-703 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:447-463 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×6
  • Edited copy of a member (16 corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:130 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:130-147 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:131-146 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:360 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:360-376 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:378-393 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:809 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:809-824 | Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:913-929 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1003 — Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1003-1023 | Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:404-419 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Sources/FoundationEssentials/URL/URL_C+Spans.swift:127 — Sources/FoundationEssentials/URL/URL_C+Spans.swift:127-144 | Sources/FoundationEssentials/URL/URL_C+Spans.swift:146-161 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Sources/FoundationEssentials/ProgressManager/ProgressManager+Properties+Helpers.swift:179 — Sources/FoundationEssentials/ProgressManager/ProgressManager+Properties+Helpers.swift:179-194 | Sources/FoundationEssentials/ProgressManager/ProgressManager+Properties+Helpers.swift:196-211 — 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 copies of one member (3 members, 7+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:364 — Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:364-370 | Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:372-378 | Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:380-386 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:79 — Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:79-85 | Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:87-94 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:56-62 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/FoundationEssentials/Formatting/Date+HTTPFormatStyle.swift:102 — Sources/FoundationEssentials/Formatting/Date+HTTPFormatStyle.swift:102-108 | Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:491-497 | Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1553-1561 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/FoundationEssentials/FileManager/SearchPaths/FileManager+XDGSearchPaths.swift:37 — Sources/FoundationEssentials/FileManager/SearchPaths/FileManager+XDGSearchPaths.swift:37-43 | Sources/FoundationEssentials/FileManager/SearchPaths/FileManager+XDGSearchPaths.swift:46-52 | Sources/FoundationEssentials/FileManager/SearchPaths/FileManager+XDGSearchPaths.swift:55-61 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/FoundationEssentials/Data/Data.swift:613 — Sources/FoundationEssentials/Data/Data.swift:613-619 | Sources/FoundationEssentials/Data/Data.swift:801-807 | Sources/FoundationEssentials/Data/Data.swift:978-984 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:278 — Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:278-287 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:200-206 | Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:98-107 — 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 · Duplicated block (22 lines × 2) · ×6
  • Duplicated block (22 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:117 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:117-138 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:141-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) Sources/FoundationEssentials/Data/Data.swift:408 — Sources/FoundationEssentials/Data/Data.swift:408-429 | Sources/FoundationEssentials/Data/Data.swift:713-734 — 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/FoundationEssentials/Data/Data.swift:408` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:191 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:191-212 | Sources/FoundationEssentials/JSON/JSONScanner.swift:325-346 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:191` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) Sources/FoundationEssentials/JSON/JSONWriter.swift:291 — Sources/FoundationEssentials/JSON/JSONWriter.swift:291-312 | Sources/FoundationEssentials/JSON/JSONWriter.swift:323-344 — 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/FoundationEssentials/JSON/JSONWriter.swift:291` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:898 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:898-919 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:749-770 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:276 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:276-297 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:420-441 — 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/FoundationEssentials/PropertyList/BPlistPrimitive.swift:276` 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 (13 lines × 2) · ×6
  • Duplicated block (13 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:183 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:183-195 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:174-186 — before extracting anything, compare `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift` and `Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) Sources/FoundationEssentials/Calendar/Calendar.swift:157 — Sources/FoundationEssentials/Calendar/Calendar.swift:157-169 | Sources/FoundationEssentials/Calendar/Calendar.swift:190-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar.swift:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1225 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1225-1237 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1329-1341 — 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/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1225` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1049 — Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1049-1061 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1068-1080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1390 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1390-1402 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1510-1522 — 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/FoundationInternationalization/Calendar/Calendar_ICU.swift:1390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:822 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:822-834 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:872-884 — 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.
D3 · God Classes · FunctionTooLong · ×5
  • FunctionTooLong: FileManager+Directories.swift._mkpath_np Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:48 — FunctionTooLong — _mkpath_np runs 367 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 267 over it, 3.67× 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.
  • FunctionTooLong: URL_Resolution.swift.resolveDotSegmentsInPlace Sources/FoundationEssentials/URL/URL_Resolution.swift:71 — FunctionTooLong — resolveDotSegmentsInPlace runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× 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.
  • FunctionTooLong: Data+Writing.swift.writeToFileAux Sources/FoundationEssentials/Data/Data+Writing.swift:456 — FunctionTooLong — writeToFileAux runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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.
  • FunctionTooLong: Data+Reading.swift.readBytesFromFile Sources/FoundationEssentials/Data/Data+Reading.swift:228 — FunctionTooLong — readBytesFromFile runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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.
  • FunctionTooLong: build-list-format-data-impl.swift.pack utils/build-list-format-data-impl.swift:138 — FunctionTooLong — pack runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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 (19 corresponding lines) · ×5
  • Edited copy of a member (19 corresponding lines) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:322 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:322-340 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1356-1374 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Sources/FoundationEssentials/URL/URL_C+Resolution.swift:21 — Sources/FoundationEssentials/URL/URL_C+Resolution.swift:21-54 | Sources/FoundationEssentials/URL/URL_C+Resolution.swift:94-112 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1281 — Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1281-1299 | Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1305-1323 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:1066 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:1066-1084 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:1086-1104 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:511 — Sources/FoundationEssentials/URL/URL_Impl.swift:511-531 | Sources/FoundationEssentials/URL/URL_Impl.swift:545-563 — 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 (23 corresponding lines) · ×5
  • Edited copy of a member (23 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:326 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:326-348 | Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:350-372 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:74 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:74-96 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1595-1625 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:941 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:941-964 | Sources/FoundationEssentials/JSON/JSONEncoder.swift:966-988 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Sources/FoundationEssentials/URL/URL_Parsing.swift:67 — Sources/FoundationEssentials/URL/URL_Parsing.swift:67-90 | Sources/FoundationEssentials/URL/URL_Parsing.swift:95-117 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Sources/FoundationEssentials/String/BidirectionalCollection.swift:38 — Sources/FoundationEssentials/String/BidirectionalCollection.swift:38-60 | Sources/FoundationEssentials/String/BidirectionalCollection.swift:132-155 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) · ×5
  • Edited copies of one member (4 members, 5+ corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:98 — Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:98-102 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:133-137 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:170-174 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:207-211 — 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.
  • Edited copies of one member (4 members, 5+ corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:239 — Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:239-243 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:327-331 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:511-519 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:539-547 — 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.
  • Edited copies of one member (4 members, 5+ corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:1314 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:1314-1318 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:506-510 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:502-506 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:491-495 — 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.
  • Edited copies of one member (4 members, 5+ corresponding lines) Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:114 — Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:114-118 | Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:126-130 | Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:155-159 | Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:161-165 — 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.
  • Edited copies of one member (4 members, 5+ corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:1424 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:1424-1428 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:597-601 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:560-564 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:552-556 — 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 copies of one member (4 members, 6+ corresponding lines) · ×5
  • Edited copies of one member (4 members, 6+ corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:174 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:174-181 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:92-97 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift:92-97 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:167-172 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 6+ corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:1060 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:1060-1065 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:359-365 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:357-363 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:346-352 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 6+ corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:150 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:150-155 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:78-83 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift:78-83 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:153-158 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 6+ corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:157 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:157-162 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:85-90 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift:85-90 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:160-165 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 6+ corresponding lines) Sources/FoundationInternationalization/String/SortDescriptor.swift:510 — Sources/FoundationInternationalization/String/SortDescriptor.swift:510-515 | Sources/FoundationInternationalization/String/SortDescriptor.swift:529-534 | Sources/FoundationInternationalization/String/SortDescriptor.swift:549-556 | Sources/FoundationInternationalization/String/SortDescriptor.swift:571-578 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:769 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:769-773 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:477-481 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:166-170 — 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.
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:604 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:604-608 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:567-571 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:559-563 — 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.
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:60 — Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:60-64 | Sources/FoundationEssentials/PropertyList/BPlistDecodingDocument.swift:70-77 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingDocument.swift:71-78 — 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.
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/FoundationEssentials/URL/URL.swift:772 — Sources/FoundationEssentials/URL/URL.swift:772-776 | Sources/FoundationEssentials/URL/URL.swift:865-869 | Sources/FoundationEssentials/URL/URLComponents.swift:750-756 — 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.
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:197 — Sources/FoundationEssentials/Predicate/Expressions/Collection.swift:197-201 | Sources/FoundationEssentials/Predicate/Expressions/Dictionary.swift:127-132 | Sources/FoundationEssentials/Predicate/Expressions/Sequence.swift:236-240 — 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.
D12 · Dependency Hygiene · Floating branch dependency · ×4
  • Floating branch dependency: swift-foundation — Dependency `swift-foundation` is declared in Benchmarks/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.
  • Floating branch dependency: swift-corelibs-foundation — Dependency `swift-corelibs-foundation` is declared in Benchmarks/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.
  • 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.
  • Floating branch dependency: swift-foundation-icu — Dependency `swift-foundation-icu` 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.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×4
  • Edited copy of a member (26 corresponding lines) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:101 — Sources/FoundationEssentials/Locale/Locale_Preferences.swift:101-130 | Sources/FoundationEssentials/Locale/Locale_Preferences.swift:132-157 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) Sources/FoundationInternationalization/ICU/ICU+Foundation.swift:69 — Sources/FoundationInternationalization/ICU/ICU+Foundation.swift:69-94 | Sources/FoundationInternationalization/ICU/ICU+Foundation.swift:141-168 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:475 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:475-500 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:421-447 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:314 — Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:314-339 | Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:374-404 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×4
  • Edited copy of a member (15 corresponding lines) Sources/FoundationEssentials/Data/Data+Reading.swift:129 — Sources/FoundationEssentials/Data/Data+Reading.swift:129-143 | Sources/FoundationEssentials/Data/Data+Reading.swift:146-166 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) utils/cldr-locale-fallback.swift:195 — utils/cldr-locale-fallback.swift:195-209 | utils/cldr-locale-fallback.swift:338-359 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:184 — Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:184-199 | Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:201-215 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) REDACTED:388 — REDACTED:388-402 | Sources/FoundationInternationalization/URLParser+ICU.swift:195-212 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×4
  • Edited copy of a member (20 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:109 — Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:109-128 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:180-200 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:339 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:339-358 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:400-419 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:667 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:667-687 | Sources/FoundationEssentials/JSON/JSONDecoder.swift:689-708 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Sources/FoundationEssentials/URL/URLEncoder.swift:422 — Sources/FoundationEssentials/URL/URLEncoder.swift:422-441 | Sources/FoundationEssentials/URL/URLEncoder.swift:451-473 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×4
  • Edited copies of one member (4 members, 4+ corresponding lines) Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:106 — Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:106-109 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:111-114 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:137-140 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:142-148 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 4+ corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:648 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:648-651 | Sources/FoundationEssentials/JSON/JSONScanner.swift:54-61 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:72-79 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:147-154 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 4+ corresponding lines) Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:21 — Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:21-24 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:26-29 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:55-58 | Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift:60-66 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 4+ corresponding lines) Sources/FoundationEssentials/JSON/JSONEncoder.swift:1055 — Sources/FoundationEssentials/JSON/JSONEncoder.swift:1055-1058 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:354-357 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:352-355 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:341-344 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×4
  • Duplicated block (16–17 lines × 2) Sources/FoundationEssentials/CodableUtilities.swift:310 — Sources/FoundationEssentials/CodableUtilities.swift:310-326 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:774-789 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16–17 lines × 2) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:96 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:96-112 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:98-113 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16–17 lines × 2) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:213 — Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:213-228 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:237-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–17 lines × 2) Sources/FoundationInternationalization/Formatting/ByteCountFormatStyle.swift:383 — Sources/FoundationInternationalization/Formatting/ByteCountFormatStyle.swift:383-398 | Sources/FoundationInternationalization/Formatting/Number/NumberAttributedFormat.swift:54-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationInternationalization/Formatting/ByteCountFormatStyle.swift:383` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:1068 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:1068-1084 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:1088-1104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:133 — Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:133-149 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:158-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) Sources/FoundationEssentials/String/String+IO.swift:458 — Sources/FoundationEssentials/String/String+IO.swift:458-474 | Sources/FoundationEssentials/String/String+IO.swift:481-497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1489 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1489-1505 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1609-1625 — 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/FoundationInternationalization/Calendar/Calendar_ICU.swift:1489` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1078 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1078-1092 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1105-1119 — 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/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1078` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:386 — Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:386-400 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:413-427 — 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/FoundationEssentials/PropertyList/XMLPlistScanner.swift:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) Sources/FoundationEssentials/String/String+IO.swift:144 — Sources/FoundationEssentials/String/String+IO.swift:144-158 | Sources/FoundationEssentials/String/String+IO.swift:171-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/String/String+IO.swift:144` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:327 — Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:327-341 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:357-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:327` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×3
  • Edited copy of a member (31 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:956 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:956-996 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:557-598 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift:139 — Sources/FoundationEssentials/Calendar/Calendar.swift:139-169 | Sources/FoundationEssentials/Calendar/Calendar.swift:172-202 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) Sources/FoundationEssentials/JSON/JSONWriter.swift:290 — Sources/FoundationEssentials/JSON/JSONWriter.swift:290-320 | Sources/FoundationEssentials/JSON/JSONWriter.swift:322-352 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×3
  • Edited copy of a member (30 corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:882 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:882-911 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:953-982 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:706 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:706-735 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:465-496 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2372 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2372-2401 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1699-1729 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 12+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:583 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:583-594 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:596-611 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:613-627 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) Sources/FoundationEssentials/URL/URLTemplate_Expression.swift:184 — Sources/FoundationEssentials/URL/URLTemplate_Expression.swift:184-195 | Sources/FoundationEssentials/URL/URLTemplate_Expression.swift:197-208 | Sources/FoundationEssentials/URL/URLTemplate_Expression.swift:223-234 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1092 — Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1092-1103 | Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1109-1120 | Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1126-1137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 9+ corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:269 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:269-277 | Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:45-53 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:65-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) Sources/FoundationEssentials/Calendar/RecurrenceRule.swift:394 — Sources/FoundationEssentials/Calendar/RecurrenceRule.swift:394-404 | Sources/FoundationEssentials/Calendar/RecurrenceRule.swift:422-431 | Sources/FoundationInternationalization/Formatting/Number/NumberFormatStyleConfiguration.swift:739-747 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:872 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:872-880 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:1000-1008 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:1010-1018 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1111 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1111-1135 | Sources/FoundationEssentials/JSON/JSONScanner.swift:1029-1053 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:887 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:887-911 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:958-982 — 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/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:887` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) REDACTED:927 — REDACTED:927-951 | REDACTED:1472-1496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:927` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:952` calls `UInt8` and `REDACTED:1498` 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 (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:164 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:164-187 | Sources/FoundationEssentials/JSON/JSONScanner.swift:298-321 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (24 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:810 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:810-833 | Sources/FoundationEssentials/JSON/JSONScanner.swift:768-791 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (24 lines × 2) REDACTED:847 — REDACTED:847-870 | REDACTED:1396-1419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:847` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:168 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:168-185 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:188-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:208 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:208-225 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:228-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) Sources/FoundationEssentials/URL/URL_C+Parsing.swift:23 — Sources/FoundationEssentials/URL/URL_C+Parsing.swift:23-40 | Sources/FoundationEssentials/URL/URL_C+Parsing.swift:44-61 — 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/FoundationEssentials/URL/URL_C+Parsing.swift:23` 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 (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:682 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:682-695 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:698-711 — 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 (14 lines × 2) Sources/FoundationEssentials/String/BidirectionalCollection.swift:41 — Sources/FoundationEssentials/String/BidirectionalCollection.swift:41-54 | Sources/FoundationEssentials/String/BidirectionalCollection.swift:136-149 — 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/FoundationEssentials/String/BidirectionalCollection.swift:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:72 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:72-85 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:65-78 — before extracting anything, compare `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift` and `Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×3
  • Duplicated block (9–10 lines × 2) Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:532 — Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:532-540 | Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:555-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) Sources/FoundationEssentials/URL/URLEncoder.swift:423 — Sources/FoundationEssentials/URL/URLEncoder.swift:423-431 | Sources/FoundationEssentials/URL/URLEncoder.swift:454-463 — 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/FoundationEssentials/URL/URLEncoder.swift:423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) Sources/FoundationEssentials/URL/URL_C+Resolution.swift:69 — Sources/FoundationEssentials/URL/URL_C+Resolution.swift:69-77 | Sources/FoundationEssentials/URL/URL_C+Resolution.swift:81-90 — 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/FoundationEssentials/URL/URL_C+Resolution.swift:69` 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 (7–8 lines × 2) · ×3
  • Duplicated block (7–8 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1108 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1108-1115 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1126-1132 — 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/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7–8 lines × 2) Sources/FoundationInternationalization/String/KeyPathComparator.swift:183 — Sources/FoundationInternationalization/String/KeyPathComparator.swift:183-189 | Sources/FoundationInternationalization/String/KeyPathComparator.swift:227-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) utils/build-date-format-data-impl.swift:127 — utils/build-date-format-data-impl.swift:127-133 | utils/build-list-format-data-impl.swift:188-195 — 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 `utils/build-date-format-data-impl.swift:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:117 — Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:117-122 | Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:124-129 | Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:133-138 — 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/FoundationEssentials/Formatting/FormatParsingUtilities.swift:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:139` calls `quotientAndRemainder` and `Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:123` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) Sources/FoundationEssentials/UUID_Wrappers.swift:93 — Sources/FoundationEssentials/UUID_Wrappers.swift:93-98 | Sources/FoundationEssentials/UUID_Wrappers.swift:105-110 | Sources/FoundationEssentials/UUID_Wrappers.swift:129-134 — 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/FoundationEssentials/UUID_Wrappers.swift:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FoundationEssentials/UUID_Wrappers.swift:99` calls `failWithError`, `CocoaError` and `Sources/FoundationEssentials/UUID_Wrappers.swift:135` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) Sources/FoundationEssentials/Predicate/Expressions/Filter.swift:71 — Sources/FoundationEssentials/Predicate/Expressions/Filter.swift:71-76 | Sources/FoundationEssentials/Predicate/Expressions/Sequence.swift:203-208 | Sources/FoundationEssentials/Predicate/Expressions/Sequence.swift:220-225 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×3
  • Duplicated block (5 lines × 8) Sources/FoundationEssentials/Predicate/Expressions/Conjunction.swift:57 — Sources/FoundationEssentials/Predicate/Expressions/Conjunction.swift:57-61 | Sources/FoundationEssentials/Predicate/Expressions/Disjunction.swift:57-61 | Sources/FoundationEssentials/Predicate/Expressions/Division.swift:137-141 | Sources/FoundationEssentials/Predicate/Expressions/Division.swift:152-156 | Sources/FoundationEssentials/Predicate/Expressions/Division.swift:167-171 | Sources/FoundationEssentials/Predicate/Expressions/Equality.swift:57-61 | Sources/FoundationEssentials/Predicate/Expressions/Inequality.swift:57-61 | Sources/FoundationEssentials/Predicate/Expressions/Optional.swift:165-169 — there are 8 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 8) Sources/FoundationEssentials/Predicate/Expressions/Conjunction.swift:63 — Sources/FoundationEssentials/Predicate/Expressions/Conjunction.swift:63-67 | Sources/FoundationEssentials/Predicate/Expressions/Disjunction.swift:63-67 | Sources/FoundationEssentials/Predicate/Expressions/Division.swift:143-147 | Sources/FoundationEssentials/Predicate/Expressions/Division.swift:158-162 | Sources/FoundationEssentials/Predicate/Expressions/Division.swift:173-177 | Sources/FoundationEssentials/Predicate/Expressions/Equality.swift:63-67 | Sources/FoundationEssentials/Predicate/Expressions/Inequality.swift:63-67 | Sources/FoundationEssentials/Predicate/Expressions/Optional.swift:171-175 — there are 8 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 8) Sources/FoundationEssentials/URL/URL.swift:787 — Sources/FoundationEssentials/URL/URL.swift:787-791 | Sources/FoundationEssentials/URL/URL.swift:803-807 | Sources/FoundationEssentials/URL/URL.swift:820-824 | Sources/FoundationEssentials/URL/URL.swift:834-838 | Sources/FoundationEssentials/URL/URL.swift:1241-1245 | Sources/FoundationEssentials/URL/URL.swift:1261-1265 | Sources/FoundationEssentials/URL/URL.swift:1301-1305 | Sources/FoundationEssentials/URL/URL.swift:1321-1325 — all 8 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.
D1 · Cyclomatic Complexity · _CalendarGregorian.date (cyclomatic 18) · ×2
  • _CalendarGregorian.date (cyclomatic 18) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2902 — _CalendarGregorian.date has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: _CalendarGregorian.maximumRange (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
  • _CalendarGregorian.date (cyclomatic 18) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2968 — _CalendarGregorian.date has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: _CalendarGregorian.maximumRange (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Iterator.next (cyclomatic 17) · ×2
  • Iterator.next (cyclomatic 17) Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift:349 — Iterator.next 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.
  • Iterator.next (cyclomatic 17) Sources/FoundationEssentials/String/String+EndianAdaptorSequence.swift:73 — Iterator.next 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.
D2 · Cognitive Complexity · URL.parse · ×2
  • URL.parse::checkHost (cognitive 26) Sources/FoundationEssentials/URL/URL_Parsing.swift:577 — URL.parse::checkHost has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (26 pts) (nesting depth added 14). 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. This shape REPEATS in the file: one other method here (URL.parse) 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.
  • URL.parse::parseAuthority (cognitive 18) Sources/FoundationEssentials/URL/URL_Parsing.swift:377 — URL.parse::parseAuthority has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (URL.parse) 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 · _CalendarGregorian.date (cognitive 17) · ×2
  • _CalendarGregorian.date (cognitive 17) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2902 — _CalendarGregorian.date has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. 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.
  • _CalendarGregorian.date (cognitive 17) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2968 — _CalendarGregorian.date has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. 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.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×2
  • Edited copy of a member (33 corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:74 — Sources/FoundationEssentials/Decimal/Decimal+Math.swift:74-122 | Sources/FoundationEssentials/Decimal/Decimal+Math.swift:124-191 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) REDACTED:748 — REDACTED:748-780 | REDACTED:1307-1339 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (15 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (15 members, 50+ identical tokens) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:136 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:136-149 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:151-164 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:166-179 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:181-194 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:196-209 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:211-224 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:226-239 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:241-254 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:256-269 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:271-284 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:286-299 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:301-313 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:315-328 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:330-343 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:345-358 — These 15 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 15 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 15 times.
  • Members sharing a duplicated core (15 members, 50+ identical tokens) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:460 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:460-474 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:476-490 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:492-506 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:508-522 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:524-538 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:540-554 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:556-570 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:572-586 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:588-602 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:604-618 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:620-634 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:636-650 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:652-666 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:668-682 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:684-698 — These 15 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 15 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 15 times.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×2
  • Edited copy of a member (38 corresponding lines) Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:373 — Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:373-410 | Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:412-449 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:416 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:416-453 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:360-398 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:776 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:776-812 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:350-383 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:50 — Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:50-83 | Sources/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:46-81 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) Sources/FoundationEssentials/FileManager/FileOperations.swift:1251 — Sources/FoundationEssentials/FileManager/FileOperations.swift:1251-1291 | Sources/FoundationEssentials/FileManager/FileOperations.swift:1293-1320 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:345 — Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:345-372 | Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:406-433 — 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 (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) Sources/FoundationEssentials/URL/URL_Impl.swift:1170 — Sources/FoundationEssentials/URL/URL_Impl.swift:1170-1199 | Sources/FoundationEssentials/URL/URL_Swift.swift:744-770 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1474 — Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1474-1507 | Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1509-1535 — 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 (32 corresponding lines) · ×2
  • Edited copy of a member (32 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:274 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:274-305 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:257-288 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:36 — Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:36-67 | Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:178-209 — 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 (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:70 — Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:70-104 | Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:212-246 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) Sources/FoundationInternationalization/URLParser+ICU.swift:122 — Sources/FoundationInternationalization/URLParser+ICU.swift:122-157 | Sources/FoundationInternationalization/URLParser+ICU.swift:159-193 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 17+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:263 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:263-279 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:261-277 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:250-266 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:80 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:80-96 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:78-94 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:67-83 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 11+ corresponding lines) Sources/FoundationInternationalization/String/KeyPathComparator.swift:182 — Sources/FoundationInternationalization/String/KeyPathComparator.swift:182-192 | Sources/FoundationInternationalization/String/KeyPathComparator.swift:206-217 | Sources/FoundationInternationalization/String/KeyPathComparator.swift:226-236 | Sources/FoundationInternationalization/String/KeyPathComparator.swift:248-259 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:937 — Sources/FoundationInternationalization/Locale/Locale_ICU.swift:937-947 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:951-961 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1003-1013 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1032-1044 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 15+ corresponding lines) Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1171 — Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1171-1185 | Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1188-1202 | Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1205-1219 | Sources/FoundationInternationalization/Formatting/Date/DateFieldSymbol.swift:1222-1236 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:488 — Sources/FoundationInternationalization/Locale/Locale_ICU.swift:488-502 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:510-530 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:617-637 | Sources/FoundationInternationalization/Locale/Locale_ICU.swift:645-665 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) Sources/FoundationEssentials/Data/Data+Base64.swift:427 — Sources/FoundationEssentials/Data/Data+Base64.swift:427-443 | Sources/FoundationEssentials/Data/Data+Base64.swift:445-459 | Sources/FoundationEssentials/Data/Data+Base64.swift:461-479 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:727 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:727-743 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:168-182 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:136-152 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:281 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:281-296 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:279-294 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:268-283 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:98 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:98-113 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:96-111 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:85-100 — 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 copies of one member (3 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:992 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:992-1002 | Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:676-685 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1343-1353 — 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.
  • Edited copies of one member (3 members, 10+ corresponding lines) Sources/FoundationEssentials/JSON/JSONPrimitive+Scope.swift:41 — Sources/FoundationEssentials/JSON/JSONPrimitive+Scope.swift:41-50 | Sources/FoundationEssentials/PropertyList/BPlistPrimitive+Scope.swift:42-51 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive+Scope.swift:37-46 — 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, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) Sources/FoundationEssentials/JSON/JSONDecoder.swift:716 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:716-724 | Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:156-161 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:126-134 — 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.
  • Edited copies of one member (3 members, 6+ corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:153 — Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:153-158 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:160-165 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:167-172 — 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, 3+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 3+ corresponding lines) Sources/FoundationInternationalization/Formatting/Number/Decimal+FormatStyle.swift:847 — Sources/FoundationInternationalization/Formatting/Number/Decimal+FormatStyle.swift:847-849 | Sources/FoundationInternationalization/Formatting/Number/Decimal+FormatStyle.swift:866-868 | Sources/FoundationInternationalization/Formatting/Number/FloatingPointFormatStyle.swift:833-835 | Sources/FoundationInternationalization/Formatting/Number/IntegerFormatStyle.swift:1038-1040 — 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.
  • Edited copies of one member (4 members, 3+ corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:781 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:781-783 | Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:524-526 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2289-2291 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:760-762 — 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 (33 lines × 2) · ×2
  • Duplicated block (33 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:238 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:238-270 | Sources/FoundationEssentials/JSON/JSONScanner.swift:372-404 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:238` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (33 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:272 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:272-304 | Sources/FoundationEssentials/JSON/JSONScanner.swift:406-438 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×2
  • Duplicated block (28 lines × 2) REDACTED:753 — REDACTED:753-780 | REDACTED:1312-1339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:753` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (28 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:962 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:962-989 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:562-589 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:218 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:218-240 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:362-384 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (23 lines × 2) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1447 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1447-1469 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1567-1589 — 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/FoundationInternationalization/Calendar/Calendar_ICU.swift:1447` 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 (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:514 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:514-534 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:499-519 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) Sources/FoundationEssentials/URL/URLComponents.swift:558 — Sources/FoundationEssentials/URL/URLComponents.swift:558-578 | Sources/FoundationEssentials/URL/URLComponents.swift:582-602 — 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/FoundationEssentials/URL/URLComponents.swift:558` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:120 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:120-137 | Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:118-135 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:107-124 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (18 lines × 3) Sources/FoundationEssentials/JSON/JSONScanner.swift:34 — Sources/FoundationEssentials/JSON/JSONScanner.swift:34-51 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:53-70 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:156-173 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (13–14 lines × 4) · ×2
  • Duplicated block (13–14 lines × 4) Sources/FoundationEssentials/CodableUtilities.swift:280 — Sources/FoundationEssentials/CodableUtilities.swift:280-292 | Sources/FoundationEssentials/CodableUtilities.swift:317-330 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:749-761 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:781-793 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/CodableUtilities.swift:280` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–14 lines × 4) Sources/FoundationEssentials/ProgressManager/ProgressManager+Interop.swift:325 — Sources/FoundationEssentials/ProgressManager/ProgressManager+Interop.swift:325-337 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:81-94 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:127-140 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:182-195 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/ProgressManager/ProgressManager+Interop.swift:325` 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–12 lines × 2) · ×2
  • Duplicated block (9–12 lines × 2) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:503 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:503-511 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:747-758 — 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/FoundationEssentials/Calendar/CalendarUtility.swift:503` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9–12 lines × 2) Sources/FoundationEssentials/Data/Data+Reading.swift:238 — Sources/FoundationEssentials/Data/Data+Reading.swift:238-249 | Sources/FoundationEssentials/FileManager/FileManager+Files.swift:608-616 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1005 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1005-1015 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:604-615 — 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/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1005` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:95 — Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:95-105 | Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:115-126 — 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/FoundationEssentials/ProgressManager/ProgressFraction.swift:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:67 — Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:67-75 | Sources/FoundationEssentials/PropertyList/BPlistDecodingDocument.swift:49-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8–9 lines × 2) Sources/FoundationInternationalization/String/KeyPathComparator.swift:207 — Sources/FoundationInternationalization/String/KeyPathComparator.swift:207-214 | Sources/FoundationInternationalization/String/KeyPathComparator.swift:249-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 15) · ×2
  • Duplicated block (6 lines × 15) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:137 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:137-142 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:152-157 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:167-172 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:182-187 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:197-202 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:212-217 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:227-232 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:242-247 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:257-262 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:272-277 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:287-292 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:302-307 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:316-321 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:331-336 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:346-351 — all 15 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 15) Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:461 — Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:461-466 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:477-482 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:493-498 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:509-514 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:525-530 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:541-546 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:557-562 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:573-578 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:589-594 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:605-610 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:621-626 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:637-642 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:653-658 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:669-674 | Sources/FoundationEssentials/PropertyList/PlistDictionaryDecoder.swift:685-690 — all 15 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: _FoundationInternationalizationData (SwiftPM) — _FoundationInternationalizationData (SwiftPM): abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: _FoundationRefs — _FoundationRefs: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
D1 · Cyclomatic Complexity · _CalendarICU._locked_ordinality (cyclomatic 146) · ×1
  • _CalendarICU._locked_ordinality (cyclomatic 146) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:569 — _CalendarICU._locked_ordinality has cyclomatic complexity 146 (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 · _CalendarGregorian._ordinality (cyclomatic 143) · ×1
  • _CalendarGregorian._ordinality (cyclomatic 143) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:945 — _CalendarGregorian._ordinality has cyclomatic complexity 143 (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 · UnicodeLookalikeTable.isLookalikeScalar (cyclomatic 136) · ×1
  • UnicodeLookalikeTable.isLookalikeScalar (cyclomatic 136) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:84 — UnicodeLookalikeTable.isLookalikeScalar has cyclomatic complexity 136 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · UnicodeLookalikeTable.allCharactersAllowedByTLDRules (cyclomatic 94) · ×1
  • UnicodeLookalikeTable.allCharactersAllowedByTLDRules (cyclomatic 94) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:300 — UnicodeLookalikeTable.allCharactersAllowedByTLDRules has cyclomatic complexity 94 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ISO8601FormatStyle.components (cyclomatic 79) · ×1
  • ISO8601FormatStyle.components (cyclomatic 79) Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:352 — ISO8601FormatStyle.components has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarChinese.addingComponents (cyclomatic 76) · ×1
  • _CalendarChinese.addingComponents (cyclomatic 76) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:823 — _CalendarChinese.addingComponents has cyclomatic complexity 76 (threshold 15). Of this number, 62 points are the body's own statements and 14 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 · DatePatternFormatter.appendField (cyclomatic 72) · ×1
  • DatePatternFormatter.appendField (cyclomatic 72) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:355 — DatePatternFormatter.appendField has cyclomatic complexity 72 (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 · _CalendarHebrew.date (cyclomatic 68) · ×1
  • _CalendarHebrew.date (cyclomatic 68) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:764 — _CalendarHebrew.date has cyclomatic complexity 68 (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 · _CalendarGregorian.addAndWrap (cyclomatic 65) · ×1
  • _CalendarGregorian.addAndWrap (cyclomatic 65) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2590 — _CalendarGregorian.addAndWrap has cyclomatic complexity 65 (threshold 15). Of this number, 64 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarICU._locked_dateInterval (cyclomatic 64) · ×1
  • _CalendarICU._locked_dateInterval (cyclomatic 64) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1509 — _CalendarICU._locked_dateInterval has cyclomatic complexity 64 (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 · Calendar._fastPathDateComponents (cyclomatic 63) · ×1
  • Calendar._fastPathDateComponents (cyclomatic 63) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:740 — Calendar._fastPathDateComponents has cyclomatic complexity 63 (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 · _FileManagerImpl.contentsEqual (cyclomatic 59) · ×1
  • _FileManagerImpl.contentsEqual (cyclomatic 59) Sources/FoundationEssentials/FileManager/FileManager+Basics.swift:70 — _FileManagerImpl.contentsEqual has cyclomatic complexity 59 (threshold 15). Of this number, 56 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 · _CalendarGregorian._dateComponents (cyclomatic 57) · ×1
  • _CalendarGregorian._dateComponents (cyclomatic 57) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2109 — _CalendarGregorian._dateComponents has cyclomatic complexity 57 (threshold 15). Of this number, 56 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _StringCompareOptionsIterable._range (cyclomatic 57) · ×1
  • _StringCompareOptionsIterable._range (cyclomatic 57) Sources/FoundationEssentials/String/String+Comparison.swift:245 — _StringCompareOptionsIterable._range has cyclomatic complexity 57 (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 · URL.parse (cyclomatic 53) · ×1
  • URL.parse (cyclomatic 53) Sources/FoundationEssentials/URL/URL_Parsing.swift:537 — URL.parse has cyclomatic complexity 53 (threshold 15). Of this number, 41 points are the body's own statements and 12 belong to 2 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 · _FileOperations.moveFile (cyclomatic 52) · ×1
  • _FileOperations.moveFile (cyclomatic 52) Sources/FoundationEssentials/FileManager/FileOperations.swift:596 — _FileOperations.moveFile has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _StringCompareOptionsIterable._compare (cyclomatic 52) · ×1
  • _StringCompareOptionsIterable._compare (cyclomatic 52) Sources/FoundationEssentials/String/String+Comparison.swift:100 — _StringCompareOptionsIterable._compare has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · URL_Resolution.swift.resolveDotSegmentsInPlace (cyclomatic 52) · ×1
  • URL_Resolution.swift.resolveDotSegmentsInPlace (cyclomatic 52) Sources/FoundationEssentials/URL/URL_Resolution.swift:71 — URL_Resolution.swift.resolveDotSegmentsInPlace has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Calendar.compare (cyclomatic 51) · ×1
  • Calendar.compare (cyclomatic 51) Sources/FoundationEssentials/Calendar/Calendar.swift:859 — Calendar.compare has cyclomatic complexity 51 (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 · Base64._decodeIgnoringErrors (cyclomatic 50) · ×1
  • Base64._decodeIgnoringErrors (cyclomatic 50) Sources/FoundationEssentials/Data/Data+Base64.swift:733 — Base64._decodeIgnoringErrors 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 · _CalendarICU._locked_start (cyclomatic 50) · ×1
  • _CalendarICU._locked_start (cyclomatic 50) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1388 — _CalendarICU._locked_start 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 · _FileManagerImpl.setAttributes (cyclomatic 48) · ×1
  • _FileManagerImpl.setAttributes (cyclomatic 48) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:848 — _FileManagerImpl.setAttributes has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Data+Writing.swift.writeToFileAux (cyclomatic 48) · ×1
  • Data+Writing.swift.writeToFileAux (cyclomatic 48) Sources/FoundationEssentials/Data/Data+Writing.swift:456 — Data+Writing.swift.writeToFileAux has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Decimal._assemble (cyclomatic 46) · ×1
  • Decimal._assemble (cyclomatic 46) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:1141 — Decimal._assemble has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · URL.parse (cyclomatic 45) · ×1
  • URL.parse (cyclomatic 45) Sources/FoundationEssentials/URL/URL_Parsing.swift:285 — URL.parse has cyclomatic complexity 45 (threshold 15). Of this number, 32 points are the body's own statements and 13 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 · Data+Reading.swift.readBytesFromFile (cyclomatic 44) · ×1
  • Data+Reading.swift.readBytesFromFile (cyclomatic 44) Sources/FoundationEssentials/Data/Data+Reading.swift:228 — Data+Reading.swift.readBytesFromFile has cyclomatic complexity 44 (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 · update-date-format-data-impl.swift.parseLocale (cyclomatic 43) · ×1
  • update-date-format-data-impl.swift.parseLocale (cyclomatic 43) utils/update-date-format-data-impl.swift:122 — update-date-format-data-impl.swift.parseLocale has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarHebrew.dateInterval (cyclomatic 41) · ×1
  • _CalendarHebrew.dateInterval (cyclomatic 41) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:371 — _CalendarHebrew.dateInterval has cyclomatic complexity 41 (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 · Calendar._adjustedDateForMismatchedLeapMonthOrDay (cyclomatic 39) · ×1
  • Calendar._adjustedDateForMismatchedLeapMonthOrDay (cyclomatic 39) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:833 — Calendar._adjustedDateForMismatchedLeapMonthOrDay has cyclomatic complexity 39 (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 · Decimal.__decimal (cyclomatic 39) · ×1
  • Decimal.__decimal (cyclomatic 39) Sources/FoundationEssentials/Decimal/Decimal.swift:478 — Decimal.__decimal has cyclomatic complexity 39 (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. This shape REPEATS in the file: one other method here (Decimal.__decimal::consume) 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.
D1 · Cyclomatic Complexity · _FileManagerImpl.createDirectory (cyclomatic 39) · ×1
  • _FileManagerImpl.createDirectory (cyclomatic 39) Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:324 — _FileManagerImpl.createDirectory has cyclomatic complexity 39 (threshold 15). Of this number, 17 points are the body's own statements and 22 belong to 2 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 · Locale.updateFullLocaleString (cyclomatic 39) · ×1
  • Locale.updateFullLocaleString (cyclomatic 39) Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifier.swift:127 — Locale.updateFullLocaleString has cyclomatic complexity 39 (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 · _CalendarChinese.makeDate (cyclomatic 38) · ×1
  • _CalendarChinese.makeDate (cyclomatic 38) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:634 — _CalendarChinese.makeDate has cyclomatic complexity 38 (threshold 15). Of this number, 32 points are the body's own statements and 6 belong to one function item inside it that branches. 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 · RFC3986Parser.parse (cyclomatic 38) · ×1
  • RFC3986Parser.parse (cyclomatic 38) REDACTED:784 — RFC3986Parser.parse has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarGregorian.range (cyclomatic 37) · ×1
  • _CalendarGregorian.range (cyclomatic 37) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:502 — _CalendarGregorian.range has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 belong to one function item inside it that branches. 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _CalendarHebrew.nextMonthDayMatch (cyclomatic 37) · ×1
  • _CalendarHebrew.nextMonthDayMatch (cyclomatic 37) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1042 — _CalendarHebrew.nextMonthDayMatch has cyclomatic complexity 37 (threshold 15). Of this number, 34 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 · _CharacterSet.formUnion (cyclomatic 37) · ×1
  • _CharacterSet.formUnion (cyclomatic 37) Sources/FoundationEssentials/CharacterSet/_CharacterSet+SetAlgebra.swift:98 — _CharacterSet.formUnion has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XMLPlistMapValue.dateValue (cyclomatic 36) · ×1
  • XMLPlistMapValue.dateValue (cyclomatic 36) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:334 — XMLPlistMapValue.dateValue has cyclomatic complexity 36 (threshold 15). Of this number, 33 points are the body's own statements and 3 belong to one function item inside it that branches. 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 · _CalendarFixedMonth.range (cyclomatic 35) · ×1
  • _CalendarFixedMonth.range (cyclomatic 35) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:161 — _CalendarFixedMonth.range has cyclomatic complexity 35 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _CalendarGregorian.add (cyclomatic 35) · ×1
  • _CalendarGregorian.add (cyclomatic 35) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2403 — _CalendarGregorian.add has cyclomatic complexity 35 (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 · TimeZone.tryParseGMTName (cyclomatic 35) · ×1
  • TimeZone.tryParseGMTName (cyclomatic 35) Sources/FoundationEssentials/TimeZone/TimeZone_GMT.swift:159 — TimeZone.tryParseGMTName has cyclomatic complexity 35 (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 · _CalendarGregorian.minMaxRange (cyclomatic 34) · ×1
  • _CalendarGregorian.minMaxRange (cyclomatic 34) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:617 — _CalendarGregorian.minMaxRange has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 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 · DateComponents.isValidDate (cyclomatic 34) · ×1
  • DateComponents.isValidDate (cyclomatic 34) Sources/FoundationEssentials/Calendar/DateComponents.swift:405 — DateComponents.isValidDate has cyclomatic complexity 34 (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 · DateComponents._validate (cyclomatic 34) · ×1
  • DateComponents._validate (cyclomatic 34) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:72 — DateComponents._validate has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarICU._locked_range (cyclomatic 34) · ×1
  • _CalendarICU._locked_range (cyclomatic 34) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:455 — _CalendarICU._locked_range has cyclomatic complexity 34 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _CalendarHebrew.dateComponents (cyclomatic 33) · ×1
  • _CalendarHebrew.dateComponents (cyclomatic 33) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:612 — _CalendarHebrew.dateComponents has cyclomatic complexity 33 (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 · LocalePreferences.apply (cyclomatic 33) · ×1
  • LocalePreferences.apply (cyclomatic 33) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:164 — LocalePreferences.apply has cyclomatic complexity 33 (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 · URL.encode · ×1
  • URL.encode::encode (cyclomatic 33) Sources/FoundationEssentials/URL/URL_Parsing.swift:940 — URL.encode::encode has cyclomatic complexity 33 (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 · JSONPrimitive.decodeEscapedString (cyclomatic 32) · ×1
  • JSONPrimitive.decodeEscapedString (cyclomatic 32) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:315 — JSONPrimitive.decodeEscapedString has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XMLPlistSpanReader.parseDate (cyclomatic 32) · ×1
  • XMLPlistSpanReader.parseDate (cyclomatic 32) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1053 — XMLPlistSpanReader.parseDate has cyclomatic complexity 32 (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 · Calendar.dateAfterMatchingHour (cyclomatic 31) · ×1
  • Calendar.dateAfterMatchingHour (cyclomatic 31) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2137 — Calendar.dateAfterMatchingHour 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 · _CalendarGregorian.difference (cyclomatic 31) · ×1
  • _CalendarGregorian.difference (cyclomatic 31) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3048 — _CalendarGregorian.difference 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 · _FileOperations.removeFile (cyclomatic 31) · ×1
  • _FileOperations.removeFile (cyclomatic 31) Sources/FoundationEssentials/FileManager/FileOperations.swift:332 — _FileOperations.removeFile 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 · __DataStorage.ensureUniqueBufferReference (cyclomatic 31) · ×1
  • __DataStorage.ensureUniqueBufferReference (cyclomatic 31) Sources/FoundationEssentials/Data/Representations/DataStorage.swift:300 — __DataStorage.ensureUniqueBufferReference 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 · AnchoredRelativeFormatStyle.bound (cyclomatic 31) · ×1
  • AnchoredRelativeFormatStyle.bound (cyclomatic 31) Sources/FoundationInternationalization/Formatting/Date/Date+AnchoredRelativeFormatStyle.swift:154 — AnchoredRelativeFormatStyle.bound 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 · _CalendarGregorian.isComponentsInSupportedRange (cyclomatic 30) · ×1
  • _CalendarGregorian.isComponentsInSupportedRange (cyclomatic 30) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1683 — _CalendarGregorian.isComponentsInSupportedRange 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 · _FileOperations._linkOrCopyFile (cyclomatic 30) · ×1
  • _FileOperations._linkOrCopyFile (cyclomatic 30) Sources/FoundationEssentials/FileManager/FileOperations.swift:1114 — _FileOperations._linkOrCopyFile 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 · String+IO.swift.encodingFromDataForExtendedAttribute (cyclomatic 30) · ×1
  • String+IO.swift.encodingFromDataForExtendedAttribute (cyclomatic 30) Sources/FoundationEssentials/String/String+IO.swift:328 — String+IO.swift.encodingFromDataForExtendedAttribute has cyclomatic complexity 30 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · String._unconditionallyBridgeFromObjectiveC (cyclomatic 30) · ×1
  • String._unconditionallyBridgeFromObjectiveC (cyclomatic 30) Sources/FoundationEssentials/String/String+Bridging.swift:59 — String._unconditionallyBridgeFromObjectiveC has cyclomatic complexity 30 (threshold 15). Of this number, 28 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 · Calendar.dateAfterMatchingMonth (cyclomatic 28) · ×1
  • Calendar.dateAfterMatchingMonth (cyclomatic 28) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1649 — Calendar.dateAfterMatchingMonth has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarChinese.ordinality (cyclomatic 28) · ×1
  • _CalendarChinese.ordinality (cyclomatic 28) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:452 — _CalendarChinese.ordinality has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgressFraction.== (cyclomatic 28) · ×1
  • ProgressFraction.== (cyclomatic 28) Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:213 — ProgressFraction.== has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarICU._locked_setToFirstInstant (cyclomatic 28) · ×1
  • _CalendarICU._locked_setToFirstInstant (cyclomatic 28) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1749 — _CalendarICU._locked_setToFirstInstant has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _CalendarICU._locked_add (cyclomatic 28) · ×1
  • _CalendarICU._locked_add (cyclomatic 28) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1910 — _CalendarICU._locked_add has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Calendar._adjustedDateForMismatches (cyclomatic 27) · ×1
  • Calendar._adjustedDateForMismatches (cyclomatic 27) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1172 — Calendar._adjustedDateForMismatches has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarChinese.range (cyclomatic 27) · ×1
  • _CalendarChinese.range (cyclomatic 27) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:374 — _CalendarChinese.range has cyclomatic complexity 27 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _CalendarHebrew.supportsNextDateFastPath (cyclomatic 27) · ×1
  • _CalendarHebrew.supportsNextDateFastPath (cyclomatic 27) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:85 — _CalendarHebrew.supportsNextDateFastPath has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · JSONLegacyDecoderImpl.unwrapFloatingPoint (cyclomatic 27) · ×1
  • JSONLegacyDecoderImpl.unwrapFloatingPoint (cyclomatic 27) Sources/FoundationEssentials/JSON/JSONDecoder.swift:1017 — JSONLegacyDecoderImpl.unwrapFloatingPoint has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XMLPlistMapValue.parseSpecialRealValue (cyclomatic 27) · ×1
  • XMLPlistMapValue.parseSpecialRealValue (cyclomatic 27) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:557 — XMLPlistMapValue.parseSpecialRealValue has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · XMLPlistSpanReader.parseSpecialReal (cyclomatic 27) · ×1
  • XMLPlistSpanReader.parseSpecialReal (cyclomatic 27) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:956 — XMLPlistSpanReader.parseSpecialReal has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Iterator.next (cyclomatic 27) · ×1
  • Iterator.next (cyclomatic 27) Sources/FoundationEssentials/String/String+EndianAdaptorSequence.swift:178 — Iterator.next has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RFC3986Parser.compatibilityParse (cyclomatic 27) · ×1
  • RFC3986Parser.compatibilityParse (cyclomatic 27) REDACTED:1342 — RFC3986Parser.compatibilityParse has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarICU.date (cyclomatic 27) · ×1
  • _CalendarICU.date (cyclomatic 27) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1137 — _CalendarICU.date has cyclomatic complexity 27 (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 · _LocaleICU.weekendRange (cyclomatic 27) · ×1
  • _LocaleICU.weekendRange (cyclomatic 27) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1240 — _LocaleICU.weekendRange has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarGregorian.dateComponents (cyclomatic 26) · ×1
  • _CalendarGregorian.dateComponents (cyclomatic 26) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2044 — _CalendarGregorian.dateComponents has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FormatStyle.format (cyclomatic 26) · ×1
  • FormatStyle.format (cyclomatic 26) Sources/FoundationInternationalization/Formatting/URLFormatStyle.swift:576 — FormatStyle.format has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ProcessInfo.operatingSystemVersionString (cyclomatic 26) · ×1
  • _ProcessInfo.operatingSystemVersionString (cyclomatic 26) Sources/FoundationEssentials/ProcessInfo/ProcessInfo.swift:321 — _ProcessInfo.operatingSystemVersionString has cyclomatic complexity 26 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BuiltInUnicodeScalarSet.appendBitmap (cyclomatic 26) · ×1
  • BuiltInUnicodeScalarSet.appendBitmap (cyclomatic 26) Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift:352 — BuiltInUnicodeScalarSet.appendBitmap has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · URL.schemeFlags (cyclomatic 26) · ×1
  • URL.schemeFlags (cyclomatic 26) Sources/FoundationEssentials/URL/URL_Parsing.swift:719 — URL.schemeFlags has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · RFC3986Parser.parse (cyclomatic 26) · ×1
  • RFC3986Parser.parse (cyclomatic 26) REDACTED:644 — RFC3986Parser.parse has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Duration.bound (cyclomatic 26) · ×1
  • Duration.bound (cyclomatic 26) Sources/FoundationInternationalization/Formatting/Duration+Formatting.swift:35 — Duration.bound has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BidirectionalCollection._getBlock (cyclomatic 26) · ×1
  • BidirectionalCollection._getBlock (cyclomatic 26) Sources/FoundationEssentials/String/StringBlocks.swift:103 — BidirectionalCollection._getBlock has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnsafeBufferPointer._decomposed (cyclomatic 26) · ×1
  • UnsafeBufferPointer._decomposed (cyclomatic 26) Sources/FoundationEssentials/String/String+Internals.swift:278 — UnsafeBufferPointer._decomposed has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 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 · String.init (cyclomatic 26) · ×1
  • String.init (cyclomatic 26) Sources/FoundationEssentials/String/String+IO.swift:70 — String.init has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 2 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 · String.data (cyclomatic 26) · ×1
  • String.data (cyclomatic 26) Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:53 — String.data has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Date.daysBeforeMonth (cyclomatic 25) · ×1
  • Date.daysBeforeMonth (cyclomatic 25) Sources/FoundationEssentials/CodableUtilities.swift:148 — Date.daysBeforeMonth has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarFixedMonth.ordinality (cyclomatic 25) · ×1
  • _CalendarFixedMonth.ordinality (cyclomatic 25) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:253 — _CalendarFixedMonth.ordinality has cyclomatic complexity 25 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _CalendarFixedMonth.rolled (cyclomatic 25) · ×1
  • _CalendarFixedMonth.rolled (cyclomatic 25) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:606 — _CalendarFixedMonth.rolled has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Decimal._addReportingInexact (cyclomatic 25) · ×1
  • Decimal._addReportingInexact (cyclomatic 25) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:267 — Decimal._addReportingInexact has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: UInt128._quotientAndRemainder (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · State.findCurrentTimeZone (cyclomatic 25) · ×1
  • State.findCurrentTimeZone (cyclomatic 25) Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift:123 — State.findCurrentTimeZone has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _URLComponents._uncheckedString (cyclomatic 25) · ×1
  • _URLComponents._uncheckedString (cyclomatic 25) Sources/FoundationEssentials/URL/URLComponents.swift:506 — _URLComponents._uncheckedString has cyclomatic complexity 25 (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 · Calendar._adjustedDate (cyclomatic 24) · ×1
  • Calendar._adjustedDate (cyclomatic 24) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:568 — Calendar._adjustedDate has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Calendar._adjustedDateForMismatchedChineseLeapMonth (cyclomatic 24) · ×1
  • Calendar._adjustedDateForMismatchedChineseLeapMonth (cyclomatic 24) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1011 — Calendar._adjustedDateForMismatchedChineseLeapMonth has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarGregorian.dateInterval (cyclomatic 24) · ×1
  • _CalendarGregorian.dateInterval (cyclomatic 24) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1449 — _CalendarGregorian.dateInterval has cyclomatic complexity 24 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DateComponents.== (cyclomatic 24) · ×1
  • DateComponents.== (cyclomatic 24) Sources/FoundationEssentials/Calendar/DateComponents.swift:496 — DateComponents.== has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _CharacterSet.addNonBMPPlanes (cyclomatic 24) · ×1
  • _CharacterSet.addNonBMPPlanes (cyclomatic 24) Sources/FoundationEssentials/CharacterSet/Annex.swift:185 — _CharacterSet.addNonBMPPlanes has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CharacterSet.== (cyclomatic 24) · ×1
  • _CharacterSet.== (cyclomatic 24) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:359 — _CharacterSet.== has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Decimal._compare (cyclomatic 24) · ×1
  • Decimal._compare (cyclomatic 24) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:630 — Decimal._compare has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: UInt128._quotientAndRemainder (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _FileManagerImpl.attributesOfItem (cyclomatic 24) · ×1
  • _FileManagerImpl.attributesOfItem (cyclomatic 24) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:604 — _FileManagerImpl.attributesOfItem has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FileOperations._copyDirectoryMetadata (cyclomatic 24) · ×1
  • _FileOperations._copyDirectoryMetadata (cyclomatic 24) Sources/FoundationEssentials/FileManager/FileOperations.swift:977 — _FileOperations._copyDirectoryMetadata has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BPlistMetadata.parseTopLevelInfo (cyclomatic 24) · ×1
  • BPlistMetadata.parseTopLevelInfo (cyclomatic 24) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:211 — BPlistMetadata.parseTopLevelInfo has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BPlistScanner.parseTopLevelInfo (cyclomatic 24) · ×1
  • BPlistScanner.parseTopLevelInfo (cyclomatic 24) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:355 — BPlistScanner.parseTopLevelInfo has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _URL.init (cyclomatic 24) · ×1
  • _URL.init (cyclomatic 24) Sources/FoundationEssentials/URL/URL_Impl.swift:174 — _URL.init has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _SwiftURL.appending (cyclomatic 24) · ×1
  • _SwiftURL.appending (cyclomatic 24) Sources/FoundationEssentials/URL/URL_Swift.swift:644 — _SwiftURL.appending has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 2 function items inside it that branch. 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 · _SwiftURL.fillCFURLImpl (cyclomatic 24) · ×1
  • _SwiftURL.fillCFURLImpl (cyclomatic 24) Sources/FoundationEssentials/URL/URL_Swift.swift:1242 — _SwiftURL.fillCFURLImpl has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UTF8Span._decomposed (cyclomatic 24) · ×1
  • UTF8Span._decomposed (cyclomatic 24) Sources/FoundationEssentials/String/String+Internals.swift:414 — UTF8Span._decomposed has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 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 · Calendar._unadjustedDates (cyclomatic 23) · ×1
  • Calendar._unadjustedDates (cyclomatic 23) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:1046 — Calendar._unadjustedDates 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 · _CalendarHebrew.nextMonthWeekdayWeekOfMonthMatch (cyclomatic 23) · ×1
  • _CalendarHebrew.nextMonthWeekdayWeekOfMonthMatch (cyclomatic 23) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1293 — _CalendarHebrew.nextMonthWeekdayWeekOfMonthMatch has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 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 · _CharacterSet.removeNonBMPPlanes (cyclomatic 23) · ×1
  • _CharacterSet.removeNonBMPPlanes (cyclomatic 23) Sources/FoundationEssentials/CharacterSet/Annex.swift:304 — _CharacterSet.removeNonBMPPlanes 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 · _CharacterSet.isEqualAnnex (cyclomatic 23) · ×1
  • _CharacterSet.isEqualAnnex (cyclomatic 23) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:437 — _CharacterSet.isEqualAnnex 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 · XMLPlistScanner.readTag (cyclomatic 23) · ×1
  • XMLPlistScanner.readTag (cyclomatic 23) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:828 — XMLPlistScanner.readTag 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 · BuiltInUnicodeScalarSet.contains (cyclomatic 23) · ×1
  • BuiltInUnicodeScalarSet.contains (cyclomatic 23) Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift:199 — BuiltInUnicodeScalarSet.contains 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. This is NOT this file's highest cyclomatic complexity: BuiltInUnicodeScalarSet._bitmapTableIndex (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _TimeZoneICUResource.init (cyclomatic 23) · ×1
  • _TimeZoneICUResource.init (cyclomatic 23) Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:314 — _TimeZoneICUResource.init has cyclomatic complexity 23 (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 · build-list-format-data-impl.swift.pack (cyclomatic 23) · ×1
  • build-list-format-data-impl.swift.pack (cyclomatic 23) utils/build-list-format-data-impl.swift:138 — build-list-format-data-impl.swift.pack has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 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 · ResolvedDateComponents.init (cyclomatic 22) · ×1
  • ResolvedDateComponents.init (cyclomatic 22) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:114 — ResolvedDateComponents.init has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _CalendarGregorian._firstInstant (cyclomatic 22) · ×1
  • _CalendarGregorian._firstInstant (cyclomatic 22) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:754 — _CalendarGregorian._firstInstant has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _CalendarHebrew.nextMonthWeekdayOrdinalMatch (cyclomatic 22) · ×1
  • _CalendarHebrew.nextMonthWeekdayOrdinalMatch (cyclomatic 22) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1186 — _CalendarHebrew.nextMonthWeekdayOrdinalMatch has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 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 · Decimal.== (cyclomatic 22) · ×1
  • Decimal.== (cyclomatic 22) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:539 — Decimal.== has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Locale.identifier (cyclomatic 22) · ×1
  • Locale.identifier (cyclomatic 22) Sources/FoundationEssentials/Locale/Locale.swift:709 — Locale.identifier has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · XMLPlistScannerEventSource.dispatchOpenTag (cyclomatic 22) · ×1
  • XMLPlistScannerEventSource.dispatchOpenTag (cyclomatic 22) Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:154 — XMLPlistScannerEventSource.dispatchOpenTag has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SwiftURL._makeCFURL (cyclomatic 22) · ×1
  • _SwiftURL._makeCFURL (cyclomatic 22) Sources/FoundationEssentials/URL/URL_Swift.swift:1106 — _SwiftURL._makeCFURL has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Span.containsInvalidPathExtensionScalar (cyclomatic 22) · ×1
  • Span.containsInvalidPathExtensionScalar (cyclomatic 22) Sources/FoundationEssentials/String/Span+Path.swift:98 — Span.containsInvalidPathExtensionScalar has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Guts.enforceAttributeConstraintsAfterMutation (cyclomatic 22) · ×1
  • Guts.enforceAttributeConstraintsAfterMutation (cyclomatic 22) Sources/FoundationEssentials/AttributedString/AttributedStringAttributeConstrainingBehavior.swift:251 — Guts.enforceAttributeConstraintsAfterMutation has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarICU.dateComponents (cyclomatic 22) · ×1
  • _CalendarICU.dateComponents (cyclomatic 22) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1215 — _CalendarICU.dateComponents has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Attributed._format (cyclomatic 22) · ×1
  • Attributed._format (cyclomatic 22) Sources/FoundationInternationalization/Formatting/ByteCountFormatStyle.swift:220 — Attributed._format has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _LocaleICU.init (cyclomatic 22) · ×1
  • _LocaleICU.init (cyclomatic 22) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:183 — _LocaleICU.init has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatePatternFormatter.fill (cyclomatic 22) · ×1
  • DatePatternFormatter.fill (cyclomatic 22) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:181 — DatePatternFormatter.fill has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatePatternFormatter.appendLocalizedGMT (cyclomatic 22) · ×1
  • DatePatternFormatter.appendLocalizedGMT (cyclomatic 22) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:592 — DatePatternFormatter.appendLocalizedGMT has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Signature.createNumberFormatter (cyclomatic 22) · ×1
  • Signature.createNumberFormatter (cyclomatic 22) Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:158 — Signature.createNumberFormatter has cyclomatic complexity 22 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DataLocaleIdentifier.parseBaseName (cyclomatic 22) · ×1
  • DataLocaleIdentifier.parseBaseName (cyclomatic 22) Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift:126 — DataLocaleIdentifier.parseBaseName has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · String._resolvingSymlinksInPath (cyclomatic 22) · ×1
  • String._resolvingSymlinksInPath (cyclomatic 22) Sources/FoundationEssentials/String/String+Path.swift:641 — String._resolvingSymlinksInPath has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Storage.append (cyclomatic 21) · ×1
  • Storage.append (cyclomatic 21) Sources/FoundationEssentials/IndexPath.swift:84 — Storage.append has cyclomatic complexity 21 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _CalendarChinese.dateComponents (cyclomatic 21) · ×1
  • _CalendarChinese.dateComponents (cyclomatic 21) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:714 — _CalendarChinese.dateComponents has cyclomatic complexity 21 (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 · _CalendarFixedMonth.rataDie (cyclomatic 21) · ×1
  • _CalendarFixedMonth.rataDie (cyclomatic 21) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:416 — _CalendarFixedMonth.rataDie has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CalendarHebrew.ordinality (cyclomatic 21) · ×1
  • _CalendarHebrew.ordinality (cyclomatic 21) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:220 — _CalendarHebrew.ordinality has cyclomatic complexity 21 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DateComponents._bridgeToObjectiveC (cyclomatic 21) · ×1
  • DateComponents._bridgeToObjectiveC (cyclomatic 21) Sources/FoundationEssentials/Calendar/DateComponents.swift:736 — DateComponents._bridgeToObjectiveC has cyclomatic complexity 21 (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. This shape REPEATS in the file: one other method here (DateComponents._conditionallyBridgeFromObjectiveC) 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.
D1 · Cyclomatic Complexity · DateComponents._conditionallyBridgeFromObjectiveC (cyclomatic 21) · ×1
  • DateComponents._conditionallyBridgeFromObjectiveC (cyclomatic 21) Sources/FoundationEssentials/Calendar/DateComponents.swift:768 — DateComponents._conditionallyBridgeFromObjectiveC has cyclomatic complexity 21 (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. This shape REPEATS in the file: one other method here (DateComponents._bridgeToObjectiveC) 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.
D1 · Cyclomatic Complexity · JSONDecoderImpl.unwrapFixedWidthInteger (cyclomatic 21) · ×1
  • JSONDecoderImpl.unwrapFixedWidthInteger (cyclomatic 21) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:278 — JSONDecoderImpl.unwrapFixedWidthInteger has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BPlistPrimitive.debugDataTypeDescription (cyclomatic 21) · ×1
  • BPlistPrimitive.debugDataTypeDescription (cyclomatic 21) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:384 — BPlistPrimitive.debugDataTypeDescription has cyclomatic complexity 21 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · XMLPlistScanner.parseString (cyclomatic 21) · ×1
  • XMLPlistScanner.parseString (cyclomatic 21) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1025 — XMLPlistScanner.parseString has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XMLPlistScannerEventSource.recognizeTag (cyclomatic 21) · ×1
  • XMLPlistScannerEventSource.recognizeTag (cyclomatic 21) Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:314 — XMLPlistScannerEventSource.recognizeTag has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _URL.windowsFilePath (cyclomatic 21) · ×1
  • _URL.windowsFilePath (cyclomatic 21) Sources/FoundationEssentials/URL/URL_Impl.swift:638 — _URL.windowsFilePath has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SwiftURL.init (cyclomatic 21) · ×1
  • _SwiftURL.init (cyclomatic 21) Sources/FoundationEssentials/URL/URL_Swift.swift:129 — _SwiftURL.init has cyclomatic complexity 21 (threshold 15). Of this number, 19 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 · BidirectionalCollection._matchesSeparators (cyclomatic 21) · ×1
  • BidirectionalCollection._matchesSeparators (cyclomatic 21) Sources/FoundationEssentials/String/StringBlocks.swift:41 — BidirectionalCollection._matchesSeparators has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Data+Writing.swift.createTemporaryFile (cyclomatic 21) · ×1
  • Data+Writing.swift.createTemporaryFile (cyclomatic 21) Sources/FoundationEssentials/Data/Data+Writing.swift:176 — Data+Writing.swift.createTemporaryFile has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComponentSet.set (cyclomatic 20) · ×1
  • ComponentSet.set (cyclomatic 20) Sources/FoundationEssentials/Calendar/Calendar.swift:256 — ComponentSet.set has cyclomatic complexity 20 (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. This is NOT this file's highest cyclomatic complexity: Calendar._toNSCalendarIdentifier (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CalendarHebrew.nextWeekdayOrdinalMatch (cyclomatic 20) · ×1
  • _CalendarHebrew.nextWeekdayOrdinalMatch (cyclomatic 20) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1240 — _CalendarHebrew.nextWeekdayOrdinalMatch has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 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 · DateComponents.description (cyclomatic 20) · ×1
  • DateComponents.description (cyclomatic 20) Sources/FoundationEssentials/Calendar/DateComponents.swift:559 — DateComponents.description has cyclomatic complexity 20 (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. This shape REPEATS in the file: one other method here (DateComponents.customMirror) 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.
D1 · Cyclomatic Complexity · DateComponents.customMirror (cyclomatic 20) · ×1
  • DateComponents.customMirror (cyclomatic 20) Sources/FoundationEssentials/Calendar/DateComponents.swift:591 — DateComponents.customMirror has cyclomatic complexity 20 (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. This shape REPEATS in the file: one other method here (DateComponents.description) 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.
D1 · Cyclomatic Complexity · Decimal.init (cyclomatic 20) · ×1
  • Decimal.init (cyclomatic 20) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:191 — Decimal.init has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FileOperations._copyRegularFile (cyclomatic 20) · ×1
  • _FileOperations._copyRegularFile (cyclomatic 20) Sources/FoundationEssentials/FileManager/FileOperations.swift:877 — _FileOperations._copyRegularFile 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 · _URLComponents.computedString (cyclomatic 20) · ×1
  • _URLComponents.computedString (cyclomatic 20) Sources/FoundationEssentials/URL/URLComponents.swift:448 — _URLComponents.computedString has cyclomatic complexity 20 (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. This is NOT this file's highest cyclomatic complexity: _URLComponents.rangeOf (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · RFC3986Parser.compatibilityParse (cyclomatic 20) · ×1
  • RFC3986Parser.compatibilityParse (cyclomatic 20) REDACTED:1207 — RFC3986Parser.compatibilityParse 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 · _URL.deletingLastPathComponent (cyclomatic 20) · ×1
  • _URL.deletingLastPathComponent (cyclomatic 20) Sources/FoundationEssentials/URL/URL_Impl.swift:1202 — _URL.deletingLastPathComponent has cyclomatic complexity 20 (threshold 15). 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, 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 · ListFormatterImpl.format (cyclomatic 20) · ×1
  • ListFormatterImpl.format (cyclomatic 20) Sources/FoundationInternationalization/Formatting/ListFormatterImpl.swift:256 — ListFormatterImpl.format has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Calendar_ObjC.swift._fromNSCalendarUnits (cyclomatic 20) · ×1
  • Calendar_ObjC.swift._fromNSCalendarUnits (cyclomatic 20) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:595 — Calendar_ObjC.swift._fromNSCalendarUnits has cyclomatic complexity 20 (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. This is NOT this file's highest cyclomatic complexity: Calendar_ObjC.swift._fromNSCalendarUnit (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BuildDateFormatData.main (cyclomatic 20) · ×1
  • BuildDateFormatData.main (cyclomatic 20) utils/build-date-format-data-impl.swift:156 — BuildDateFormatData.main 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 · _CalendarFixedMonth.dateComponents (cyclomatic 19) · ×1
  • _CalendarFixedMonth.dateComponents (cyclomatic 19) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:474 — _CalendarFixedMonth.dateComponents has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _CalendarGregorian.julianDay (cyclomatic 19) · ×1
  • _CalendarGregorian.julianDay (cyclomatic 19) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1775 — _CalendarGregorian.julianDay 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. This is NOT this file's highest cyclomatic complexity: _CalendarGregorian.maximumRange (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CalendarHebrew.date (cyclomatic 19) · ×1
  • _CalendarHebrew.date (cyclomatic 19) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:563 — _CalendarHebrew.date has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Base64._decode (cyclomatic 19) · ×1
  • Base64._decode (cyclomatic 19) Sources/FoundationEssentials/Data/Data+Base64.swift:505 — Base64._decode 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 · Decimal.compact (cyclomatic 19) · ×1
  • Decimal.compact (cyclomatic 19) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:804 — Decimal.compact has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: UInt128._quotientAndRemainder (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _FileManagerImpl.attributesOfFileSystem (cyclomatic 19) · ×1
  • _FileManagerImpl.attributesOfFileSystem (cyclomatic 19) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:711 — _FileManagerImpl.attributesOfFileSystem has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BufferViewIterator.digits (cyclomatic 19) · ×1
  • BufferViewIterator.digits (cyclomatic 19) Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:50 — BufferViewIterator.digits 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 · LocalePreferences.apply (cyclomatic 19) · ×1
  • LocalePreferences.apply (cyclomatic 19) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:284 — LocalePreferences.apply has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · URLEncoder.percentDecode (cyclomatic 19) · ×1
  • URLEncoder.percentDecode (cyclomatic 19) Sources/FoundationEssentials/URL/URLEncoder.swift:591 — URLEncoder.percentDecode 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 · _URL.appending (cyclomatic 19) · ×1
  • _URL.appending (cyclomatic 19) Sources/FoundationEssentials/URL/URL_Impl.swift:947 — _URL.appending has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · _URLInfo.originalString (cyclomatic 19) · ×1
  • _URLInfo.originalString (cyclomatic 19) REDACTED:442 — _URLInfo.originalString 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 · Components.init (cyclomatic 19) · ×1
  • Components.init (cyclomatic 19) Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:26 — Components.init 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 · OpenStepPlist.swift.getDataBytes (cyclomatic 19) · ×1
  • OpenStepPlist.swift.getDataBytes (cyclomatic 19) Sources/FoundationEssentials/PropertyList/OpenStepPlist.swift:422 — OpenStepPlist.swift.getDataBytes has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 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 · URL_C+File.swift.posixLikePath (cyclomatic 19) · ×1
  • URL_C+File.swift.posixLikePath (cyclomatic 19) Sources/FoundationEssentials/URL/URL_C+File.swift:191 — URL_C+File.swift.posixLikePath has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 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 · _TimeZoneICUResource.binarySearchTransition (cyclomatic 19) · ×1
  • _TimeZoneICUResource.binarySearchTransition (cyclomatic 19) Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:671 — _TimeZoneICUResource.binarySearchTransition 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 · cldr-locale-fallback.swift.icuLocales (cyclomatic 19) · ×1
  • cldr-locale-fallback.swift.icuLocales (cyclomatic 19) utils/cldr-locale-fallback.swift:161 — cldr-locale-fallback.swift.icuLocales has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AttributedString.init (cyclomatic 18) · ×1
  • AttributedString.init (cyclomatic 18) Sources/FoundationEssentials/AttributedString/AttributedStringCodable.swift:333 — AttributedString.init 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 · Calendar.dateAfterMatchingWeekOfMonth (cyclomatic 18) · ×1
  • Calendar.dateAfterMatchingWeekOfMonth (cyclomatic 18) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1751 — Calendar.dateAfterMatchingWeekOfMonth 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 · Calendar.dateAfterMatchingWeekdayOrdinal (cyclomatic 18) · ×1
  • Calendar.dateAfterMatchingWeekdayOrdinal (cyclomatic 18) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1849 — Calendar.dateAfterMatchingWeekdayOrdinal 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 · ComponentSet.highestSetUnit (cyclomatic 18) · ×1
  • ComponentSet.highestSetUnit (cyclomatic 18) Sources/FoundationEssentials/Calendar/Calendar.swift:280 — ComponentSet.highestSetUnit has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Calendar._toNSCalendarIdentifier (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CalendarFixedMonth.date (cyclomatic 18) · ×1
  • _CalendarFixedMonth.date (cyclomatic 18) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:582 — _CalendarFixedMonth.date has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: _CalendarFixedMonth.minimumRange (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CharacterSet.appendBitmap (cyclomatic 18) · ×1
  • _CharacterSet.appendBitmap (cyclomatic 18) Sources/FoundationEssentials/CharacterSet/_CharacterSet+StorageConversionHelpers.swift:142 — _CharacterSet.appendBitmap 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 · FormatStyle.generateFormattedString (cyclomatic 18) · ×1
  • FormatStyle.generateFormattedString (cyclomatic 18) Sources/FoundationInternationalization/Formatting/URLFormatStyle.swift:458 — FormatStyle.generateFormattedString 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 · JSON5Scanner.validateNumber (cyclomatic 18) · ×1
  • JSON5Scanner.validateNumber (cyclomatic 18) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1058 — JSON5Scanner.validateNumber 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 · JSONDecoder.withUTF8Representation (cyclomatic 18) · ×1
  • JSONDecoder.withUTF8Representation (cyclomatic 18) Sources/FoundationEssentials/JSON/JSONDecoder.swift:541 — JSONDecoder.withUTF8Representation has cyclomatic complexity 18 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · JSONPrimitive.makeDecimalLiteral (cyclomatic 18) · ×1
  • JSONPrimitive.makeDecimalLiteral (cyclomatic 18) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:649 — JSONPrimitive.makeDecimalLiteral 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 · URLEncoder.percentDecode (cyclomatic 18) · ×1
  • URLEncoder.percentDecode (cyclomatic 18) Sources/FoundationEssentials/URL/URLEncoder.swift:493 — URLEncoder.percentDecode 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 · _CalendarICU.easyMinMaxRange (cyclomatic 18) · ×1
  • _CalendarICU.easyMinMaxRange (cyclomatic 18) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:255 — _CalendarICU.easyMinMaxRange has cyclomatic complexity 18 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Component.icuFieldCode (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CalendarICU.date (cyclomatic 18) · ×1
  • _CalendarICU.date (cyclomatic 18) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1265 — _CalendarICU.date has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Component.icuFieldCode (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CalendarICU.dateComponents (cyclomatic 18) · ×1
  • _CalendarICU.dateComponents (cyclomatic 18) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1317 — _CalendarICU.dateComponents has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Component.icuFieldCode (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _LocaleICU.pref (cyclomatic 18) · ×1
  • _LocaleICU.pref (cyclomatic 18) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:313 — _LocaleICU.pref has cyclomatic complexity 18 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Locale.legacyKey (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _TimeZoneSingleDSTRule.startDateForRuleInYear (cyclomatic 18) · ×1
  • _TimeZoneSingleDSTRule.startDateForRuleInYear (cyclomatic 18) Sources/FoundationInternationalization/TimeZone/TimeZone_SingleDSTRule.swift:512 — _TimeZoneSingleDSTRule.startDateForRuleInYear 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 · RuleComponents.init (cyclomatic 18) · ×1
  • RuleComponents.init (cyclomatic 18) Sources/FoundationInternationalization/TimeZone/TimeZone_SingleDSTRule.swift:55 — RuleComponents.init 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 · UnitsFormatStyle.interval (cyclomatic 18) · ×1
  • UnitsFormatStyle.interval (cyclomatic 18) Sources/FoundationInternationalization/Formatting/Duration+UnitsFormatStyle.swift:710 — UnitsFormatStyle.interval 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 · DateFieldCollection.updateSchedule (cyclomatic 18) · ×1
  • DateFieldCollection.updateSchedule (cyclomatic 18) Sources/FoundationInternationalization/Formatting/Date/ICUDateFormatter.swift:555 — DateFieldCollection.updateSchedule has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Calendar._matchingDate (cyclomatic 17) · ×1
  • Calendar._matchingDate (cyclomatic 17) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1341 — Calendar._matchingDate 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. This shape REPEATS in the file: 2 other methods here (DateComponents.setUnits, DateComponents.mismatchedUnits) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · DateComponents.setUnits (cyclomatic 17) · ×1
  • DateComponents.setUnits (cyclomatic 17) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:201 — DateComponents.setUnits 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. This shape REPEATS in the file: 2 other methods here (DateComponents.mismatchedUnits, Calendar._matchingDate) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · DateComponents.mismatchedUnits (cyclomatic 17) · ×1
  • DateComponents.mismatchedUnits (cyclomatic 17) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:227 — DateComponents.mismatchedUnits 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. This shape REPEATS in the file: 2 other methods here (DateComponents.setUnits, Calendar._matchingDate) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · Decimal._toString (cyclomatic 17) · ×1
  • Decimal._toString (cyclomatic 17) Sources/FoundationEssentials/Decimal/Decimal.swift:350 — Decimal._toString has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · JSON5Scanner.prevalidateJSONNumber (cyclomatic 17) · ×1
  • JSON5Scanner.prevalidateJSONNumber (cyclomatic 17) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:984 — JSON5Scanner.prevalidateJSONNumber has cyclomatic complexity 17 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · EncodedString.equals (cyclomatic 17) · ×1
  • EncodedString.equals (cyclomatic 17) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:722 — EncodedString.equals 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 · XMLPlistSpanReader.parseEntityReferenceIntoBytes (cyclomatic 17) · ×1
  • XMLPlistSpanReader.parseEntityReferenceIntoBytes (cyclomatic 17) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:866 — XMLPlistSpanReader.parseEntityReferenceIntoBytes 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 · _SwiftURL.absoluteString (cyclomatic 17) · ×1
  • _SwiftURL.absoluteString (cyclomatic 17) Sources/FoundationEssentials/URL/URL_Swift.swift:285 — _SwiftURL.absoluteString 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 · Span.pathExtensionDotIndex (cyclomatic 17) · ×1
  • Span.pathExtensionDotIndex (cyclomatic 17) Sources/FoundationEssentials/String/Span+Path.swift:173 — Span.pathExtensionDotIndex has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · NSCalendar._newCalendarWithIdentifier (cyclomatic 17) · ×1
  • NSCalendar._newCalendarWithIdentifier (cyclomatic 17) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:39 — NSCalendar._newCalendarWithIdentifier 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. This is NOT this file's highest cyclomatic complexity: Calendar_ObjC.swift._fromNSCalendarUnit (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _TimeZoneSingleDSTRule._gmtOffset (cyclomatic 17) · ×1
  • _TimeZoneSingleDSTRule._gmtOffset (cyclomatic 17) Sources/FoundationInternationalization/TimeZone/TimeZone_SingleDSTRule.swift:198 — _TimeZoneSingleDSTRule._gmtOffset has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PredicateQueryRewriter._processFunction (cyclomatic 17) · ×1
  • PredicateQueryRewriter._processFunction (cyclomatic 17) Sources/FoundationMacros/PredicateMacro.swift:741 — PredicateQueryRewriter._processFunction has cyclomatic complexity 17 (threshold 15). Of this number, 15 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. This is NOT this file's highest cyclomatic complexity: PredicateQueryRewriter.visit (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · GenerateDateFormatData.main (cyclomatic 17) · ×1
  • GenerateDateFormatData.main (cyclomatic 17) utils/update-date-format-data-impl.swift:470 — GenerateDateFormatData.main has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Calendar.dateAfterMatchingDay (cyclomatic 16) · ×1
  • Calendar.dateAfterMatchingDay (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2030 — Calendar.dateAfterMatchingDay 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 · _CalendarUtility.orderedDifferenceComponents (cyclomatic 16) · ×1
  • _CalendarUtility.orderedDifferenceComponents (cyclomatic 16) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:322 — _CalendarUtility.orderedDifferenceComponents has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _CalendarFixedMonth.date (cyclomatic 16) · ×1
  • _CalendarFixedMonth.date (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:530 — _CalendarFixedMonth.date 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. This is NOT this file's highest cyclomatic complexity: _CalendarFixedMonth.minimumRange (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CalendarGregorian.dateComponents · ×1
  • _CalendarGregorian.dateComponents::orderedComponents (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3154 — _CalendarGregorian.dateComponents::orderedComponents has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: _CalendarGregorian.maximumRange (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _CalendarHebrew.orderedDiffComponents (cyclomatic 16) · ×1
  • _CalendarHebrew.orderedDiffComponents (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1356 — _CalendarHebrew.orderedDiffComponents has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: _CalendarHebrew.minimumRange (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DateComponents.highestSetUnit (cyclomatic 16) · ×1
  • DateComponents.highestSetUnit (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:157 — DateComponents.highestSetUnit has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (DateComponents.lowestSetUnit) 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.
D1 · Cyclomatic Complexity · DateComponents.lowestSetUnit (cyclomatic 16) · ×1
  • DateComponents.lowestSetUnit (cyclomatic 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:179 — DateComponents.lowestSetUnit has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (DateComponents.highestSetUnit) 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.
D1 · Cyclomatic Complexity · _CharacterSet.remove (cyclomatic 16) · ×1
  • _CharacterSet.remove (cyclomatic 16) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:249 — _CharacterSet.remove 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 · Base64._encodeWithLineBreaks (cyclomatic 16) · ×1
  • Base64._encodeWithLineBreaks (cyclomatic 16) Sources/FoundationEssentials/Data/Data+Base64.swift:214 — Base64._encodeWithLineBreaks 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 · Decimal.__decimal · ×1
  • Decimal.__decimal::consume (cyclomatic 16) Sources/FoundationEssentials/Decimal/Decimal.swift:553 — Decimal.__decimal::consume 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. This shape REPEATS in the file: one other method here (Decimal.__decimal) 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.
D1 · Cyclomatic Complexity · ParseStrategy.validate (cyclomatic 16) · ×1
  • ParseStrategy.validate (cyclomatic 16) Sources/FoundationInternationalization/Formatting/URLParseStrategy.swift:319 — ParseStrategy.validate has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · JSONLegacyDecoderImpl.unwrapDecimal (cyclomatic 16) · ×1
  • JSONLegacyDecoderImpl.unwrapDecimal (cyclomatic 16) Sources/FoundationEssentials/JSON/JSONDecoder.swift:864 — JSONLegacyDecoderImpl.unwrapDecimal 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 · JSONDecoderImpl.unwrapFloatingPoint (cyclomatic 16) · ×1
  • JSONDecoderImpl.unwrapFloatingPoint (cyclomatic 16) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:223 — JSONDecoderImpl.unwrapFloatingPoint has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · __JSONEncoder._directArrayValue (cyclomatic 16) · ×1
  • __JSONEncoder._directArrayValue (cyclomatic 16) Sources/FoundationEssentials/JSON/JSONEncoder.swift:1331 — __JSONEncoder._directArrayValue has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Reference.== (cyclomatic 16) · ×1
  • Reference.== (cyclomatic 16) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:1194 — Reference.== has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · JSONScanner.validateNumber (cyclomatic 16) · ×1
  • JSONScanner.validateNumber (cyclomatic 16) Sources/FoundationEssentials/JSON/JSONScanner.swift:994 — JSONScanner.validateNumber 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. This is NOT this file's highest cyclomatic complexity: JSONError.debugDescription (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ProgressFraction._math (cyclomatic 16) · ×1
  • ProgressFraction._math (cyclomatic 16) Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:83 — ProgressFraction._math 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 · XMLPlistSpanReader.decodeScalar (cyclomatic 16) · ×1
  • XMLPlistSpanReader.decodeScalar (cyclomatic 16) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:647 — XMLPlistSpanReader.decodeScalar 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 · XMLPlistScanner.parseEntityReference (cyclomatic 16) · ×1
  • XMLPlistScanner.parseEntityReference (cyclomatic 16) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1168 — XMLPlistScanner.parseEntityReference 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 · Data+Reading.swift.readBytesFromFileDescriptor (cyclomatic 16) · ×1
  • Data+Reading.swift.readBytesFromFileDescriptor (cyclomatic 16) Sources/FoundationEssentials/Data/Data+Reading.swift:469 — Data+Reading.swift.readBytesFromFileDescriptor 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 · Data+Writing.swift.writeToFileNoAux (cyclomatic 16) · ×1
  • Data+Writing.swift.writeToFileNoAux (cyclomatic 16) Sources/FoundationEssentials/Data/Data+Writing.swift:724 — Data+Writing.swift.writeToFileNoAux has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · String.withNTPathRepresentation (cyclomatic 16) · ×1
  • String.withNTPathRepresentation (cyclomatic 16) Sources/FoundationEssentials/String/String+Internals.swift:31 — String.withNTPathRepresentation has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · String.withContiguousNFCAndOutputBuffer (cyclomatic 16) · ×1
  • String.withContiguousNFCAndOutputBuffer (cyclomatic 16) Sources/FoundationEssentials/URL/URLTemplate_PercentEncoding.swift:123 — String.withContiguousNFCAndOutputBuffer has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D10 · Test Quality · Skipped test · ×1
  • Skipped test: searchPaths_XDGEnvironmentVariables Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:1144 — Skipped — XDG
D12 · Dependency Hygiene · No Package.resolved committed (Benchmarks/Package.swift) · ×1
  • No Package.resolved committed (Benchmarks/Package.swift) — Benchmarks/Package.swift declares 3 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D17 · Explicit Debt · XxxComment · ×1
  • XxxComment Sources/FoundationEssentials/JSON/JSONPrimitive.swift:375 — // \xXX: 2 hex digits, one Latin-1 byte. `\x00` rejected. — 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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment Sources/FoundationEssentials/Data/Representations/Data+LegacyRepresentation.swift:177 — // HACK: The definition of this inline function takes an inout reference to self, giving the optimizer a unique referencing guarantee. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · _CalendarICU._locked_ordinality (cognitive 253) · ×1
  • _CalendarICU._locked_ordinality (cognitive 253) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:569 — _CalendarICU._locked_ordinality has cognitive complexity 253 (threshold 15). Drivers by points: if/else 74 (194 pts), loops 9 (28 pts), match/switch 11 (21 pts), ternaries 3 (10 pts) (nesting depth added 156). 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 · _CalendarGregorian._ordinality (cognitive 240) · ×1
  • _CalendarGregorian._ordinality (cognitive 240) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:945 — _CalendarGregorian._ordinality has cognitive complexity 240 (threshold 15). Drivers by points: if/else 72 (196 pts), match/switch 11 (21 pts), loops 3 (10 pts), ternaries 3 (10 pts), boolean chains 3 (nesting depth added 148). 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 · ISO8601FormatStyle.components (cognitive 162) · ×1
  • ISO8601FormatStyle.components (cognitive 162) Sources/FoundationEssentials/Formatting/DateComponents+ISO8601FormatStyle.swift:352 — ISO8601FormatStyle.components has cognitive complexity 162 (threshold 15). Drivers by points: if/else 52 (110 pts), boolean chains 28, ternaries 7 (19 pts), match/switch 2 (5 pts) (nesting depth added 73). 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 · _StringCompareOptionsIterable._range (cognitive 135) · ×1
  • _StringCompareOptionsIterable._range (cognitive 135) Sources/FoundationEssentials/String/String+Comparison.swift:245 — _StringCompareOptionsIterable._range has cognitive complexity 135 (threshold 15). Drivers by points: if/else 38 (107 pts), boolean chains 18, loops 3 (7 pts), ternaries 2 (3 pts) (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarChinese.addingComponents (cognitive 130) · ×1
  • _CalendarChinese.addingComponents (cognitive 130) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:823 — _CalendarChinese.addingComponents has cognitive complexity 130 (threshold 15). Drivers by points: if/else 43 (76 pts), ternaries 9 (27 pts), boolean chains 20, loops 3 (7 pts) (nesting depth added 55). Of this number, 116 points are the body's own statements and 14 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 · _FileOperations.moveFile (cognitive 130) · ×1
  • _FileOperations.moveFile (cognitive 130) Sources/FoundationEssentials/FileManager/FileOperations.swift:596 — _FileOperations.moveFile has cognitive complexity 130 (threshold 15). Drivers by points: if/else 41 (104 pts), boolean chains 9, error handling 3 (9 pts), loops 2 (8 pts) (nesting depth added 75). 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 · Calendar._adjustedDateForMismatchedLeapMonthOrDay (cognitive 126) · ×1
  • Calendar._adjustedDateForMismatchedLeapMonthOrDay (cognitive 126) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:833 — Calendar._adjustedDateForMismatchedLeapMonthOrDay has cognitive complexity 126 (threshold 15). Drivers by points: if/else 38 (106 pts), ternaries 2 (11 pts), boolean chains 9 (nesting depth added 77). 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 · _StringCompareOptionsIterable._compare (cognitive 113) · ×1
  • _StringCompareOptionsIterable._compare (cognitive 113) Sources/FoundationEssentials/String/String+Comparison.swift:100 — _StringCompareOptionsIterable._compare has cognitive complexity 113 (threshold 15). Drivers by points: if/else 32 (87 pts), boolean chains 20, loops 2 (5 pts), ternaries 1 (nesting depth added 58). 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 · Base64._decodeIgnoringErrors (cognitive 108) · ×1
  • Base64._decodeIgnoringErrors (cognitive 108) Sources/FoundationEssentials/Data/Data+Base64.swift:733 — Base64._decodeIgnoringErrors has cognitive complexity 108 (threshold 15). Drivers by points: if/else 41 (91 pts), boolean chains 11, loops 3 (6 pts) (nesting depth added 53). 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 · _CalendarGregorian._dateComponents (cognitive 105) · ×1
  • _CalendarGregorian._dateComponents (cognitive 105) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2109 — _CalendarGregorian._dateComponents has cognitive complexity 105 (threshold 15). Drivers by points: if/else 34 (64 pts), ternaries 25 (36 pts), boolean chains 5 (nesting depth added 41). Of this number, 103 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 · update-date-format-data-impl.swift.parseLocale (cognitive 103) · ×1
  • update-date-format-data-impl.swift.parseLocale (cognitive 103) utils/update-date-format-data-impl.swift:122 — update-date-format-data-impl.swift.parseLocale has cognitive complexity 103 (threshold 15). Drivers by points: if/else 24 (63 pts), loops 11 (27 pts), boolean chains 4, match/switch 1 (4 pts), ternaries 1 (4 pts), error handling 1 (nesting depth added 61). To reduce it, split the body into named stages: move each independent 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 · _CalendarHebrew.date (cognitive 97) · ×1
  • _CalendarHebrew.date (cognitive 97) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:764 — _CalendarHebrew.date has cognitive complexity 97 (threshold 15). Drivers by points: if/else 36 (57 pts), boolean chains 28, loops 4 (12 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FileManagerImpl.contentsEqual (cognitive 96) · ×1
  • _FileManagerImpl.contentsEqual (cognitive 96) Sources/FoundationEssentials/FileManager/FileManager+Basics.swift:70 — _FileManagerImpl.contentsEqual has cognitive complexity 96 (threshold 15). Drivers by points: if/else 41 (74 pts), boolean chains 14, loops 4 (8 pts) (nesting depth added 37). Of this number, 93 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 · URL_Resolution.swift.resolveDotSegmentsInPlace (cognitive 96) · ×1
  • URL_Resolution.swift.resolveDotSegmentsInPlace (cognitive 96) Sources/FoundationEssentials/URL/URL_Resolution.swift:71 — URL_Resolution.swift.resolveDotSegmentsInPlace has cognitive complexity 96 (threshold 15). Drivers by points: if/else 43 (81 pts), boolean chains 11, match/switch 2 (3 pts), loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarGregorian.addAndWrap (cognitive 94) · ×1
  • _CalendarGregorian.addAndWrap (cognitive 94) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2590 — _CalendarGregorian.addAndWrap has cognitive complexity 94 (threshold 15). Drivers by points: if/else 42 (76 pts), boolean chains 12, match/switch 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 37). Of this number, 92 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 · Decimal._assemble (cognitive 94) · ×1
  • Decimal._assemble (cognitive 94) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:1141 — Decimal._assemble has cognitive complexity 94 (threshold 15). Drivers by points: if/else 37 (77 pts), boolean chains 13, ternaries 4 (nesting depth added 40). To reduce it, split the body into named stages: move each independent 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 · UnicodeLookalikeTable.allCharactersAllowedByTLDRules (cognitive 93) · ×1
  • UnicodeLookalikeTable.allCharactersAllowedByTLDRules (cognitive 93) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:300 — UnicodeLookalikeTable.allCharactersAllowedByTLDRules has cognitive complexity 93 (threshold 15). Drivers by points: boolean chains 78, if/else 15. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Calendar._fastPathDateComponents (cognitive 89) · ×1
  • Calendar._fastPathDateComponents (cognitive 89) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:740 — Calendar._fastPathDateComponents has cognitive complexity 89 (threshold 15). Drivers by points: if/else 32 (52 pts), boolean chains 28, loops 3 (6 pts), match/switch 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent 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 · _FileOperations.removeFile (cognitive 89) · ×1
  • _FileOperations.removeFile (cognitive 89) Sources/FoundationEssentials/FileManager/FileOperations.swift:332 — _FileOperations.removeFile has cognitive complexity 89 (threshold 15). Drivers by points: if/else 28 (83 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 56). 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 · URL.parse (cognitive 86) · ×1
  • URL.parse (cognitive 86) Sources/FoundationEssentials/URL/URL_Parsing.swift:537 — URL.parse has cognitive complexity 86 (threshold 15). Drivers by points: if/else 45 (100 pts), loops 2 (7 pts), boolean chains 6 (nesting depth added 60). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (URL.parse::checkHost) 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 · _CalendarHebrew.nextMonthDayMatch (cognitive 83) · ×1
  • _CalendarHebrew.nextMonthDayMatch (cognitive 83) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1042 — _CalendarHebrew.nextMonthDayMatch has cognitive complexity 83 (threshold 15). Drivers by points: if/else 23 (58 pts), boolean chains 10, loops 4 (10 pts), ternaries 1 (5 pts) (nesting depth added 45). Of this number, 80 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 · URL.encode · ×1
  • URL.encode::encode (cognitive 81) Sources/FoundationEssentials/URL/URL_Parsing.swift:940 — URL.encode::encode has cognitive complexity 81 (threshold 15). Drivers by points: if/else 36 (73 pts), loops 1 (5 pts), boolean chains 3 (nesting depth added 41). 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 · Data+Writing.swift.writeToFileAux (cognitive 79) · ×1
  • Data+Writing.swift.writeToFileAux (cognitive 79) Sources/FoundationEssentials/Data/Data+Writing.swift:456 — Data+Writing.swift.writeToFileAux has cognitive complexity 79 (threshold 15). Drivers by points: if/else 36 (63 pts), boolean chains 9, ternaries 4, error handling 2, match/switch 1 (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 · BuiltInUnicodeScalarSet.appendBitmap (cognitive 76) · ×1
  • BuiltInUnicodeScalarSet.appendBitmap (cognitive 76) Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift:352 — BuiltInUnicodeScalarSet.appendBitmap has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 9 (37 pts), if/else 10 (21 pts), loops 4 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 50). 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 · Calendar.compare (cognitive 75) · ×1
  • Calendar.compare (cognitive 75) Sources/FoundationEssentials/Calendar/Calendar.swift:859 — Calendar.compare has cognitive complexity 75 (threshold 15). Drivers by points: if/else 36 (57 pts), boolean chains 14, ternaries 2, loops 1, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Locale.updateFullLocaleString (cognitive 74) · ×1
  • Locale.updateFullLocaleString (cognitive 74) Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifier.swift:127 — Locale.updateFullLocaleString has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (51 pts), boolean chains 12, loops 2 (6 pts), ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _FileManagerImpl.setAttributes (cognitive 72) · ×1
  • _FileManagerImpl.setAttributes (cognitive 72) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:848 — _FileManagerImpl.setAttributes has cognitive complexity 72 (threshold 15). Drivers by points: if/else 34 (57 pts), boolean chains 15 (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 · DatePatternFormatter.appendField (cognitive 72) · ×1
  • DatePatternFormatter.appendField (cognitive 72) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:355 — DatePatternFormatter.appendField has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 13 (30 pts), if/else 17 (24 pts), match/switch 7 (14 pts), boolean chains 4 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decimal.__decimal (cognitive 71) · ×1
  • Decimal.__decimal (cognitive 71) Sources/FoundationEssentials/Decimal/Decimal.swift:478 — Decimal.__decimal has cognitive complexity 71 (threshold 15). Drivers by points: if/else 34 (65 pts), boolean chains 15, loops 6 (11 pts), ternaries 4 (10 pts), error handling 3 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Decimal.__decimal::consume) 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 · JSONLegacyDecoderImpl.unwrapFloatingPoint (cognitive 71) · ×1
  • JSONLegacyDecoderImpl.unwrapFloatingPoint (cognitive 71) Sources/FoundationEssentials/JSON/JSONDecoder.swift:1017 — JSONLegacyDecoderImpl.unwrapFloatingPoint has cognitive complexity 71 (threshold 15). Drivers by points: if/else 23 (63 pts), boolean chains 8 (nesting depth added 40). Of this number, 70 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · __DataStorage.ensureUniqueBufferReference (cognitive 70) · ×1
  • __DataStorage.ensureUniqueBufferReference (cognitive 70) Sources/FoundationEssentials/Data/Representations/DataStorage.swift:300 — __DataStorage.ensureUniqueBufferReference has cognitive complexity 70 (threshold 15). Drivers by points: if/else 23 (59 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 37). 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 · Data+Reading.swift.readBytesFromFile (cognitive 70) · ×1
  • Data+Reading.swift.readBytesFromFile (cognitive 70) Sources/FoundationEssentials/Data/Data+Reading.swift:228 — Data+Reading.swift.readBytesFromFile has cognitive complexity 70 (threshold 15). Drivers by points: if/else 32 (50 pts), error handling 3 (6 pts), ternaries 4 (6 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent 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 · String._unconditionallyBridgeFromObjectiveC (cognitive 70) · ×1
  • String._unconditionallyBridgeFromObjectiveC (cognitive 70) Sources/FoundationEssentials/String/String+Bridging.swift:59 — String._unconditionallyBridgeFromObjectiveC has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (59 pts), ternaries 2 (7 pts), boolean chains 4 (nesting depth added 38). Of this number, 66 points are the body's own statements and 4 belong to one function item inside it that branches. 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 · _CharacterSet.formUnion (cognitive 68) · ×1
  • _CharacterSet.formUnion (cognitive 68) Sources/FoundationEssentials/CharacterSet/_CharacterSet+SetAlgebra.swift:98 — _CharacterSet.formUnion has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 7, match/switch 2 (5 pts), loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarICU._locked_dateInterval (cognitive 67) · ×1
  • _CalendarICU._locked_dateInterval (cognitive 67) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1509 — _CalendarICU._locked_dateInterval has cognitive complexity 67 (threshold 15). Drivers by points: if/else 27 (63 pts), match/switch 3 (4 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RFC3986Parser.parse (cognitive 66) · ×1
  • RFC3986Parser.parse (cognitive 66) REDACTED:784 — RFC3986Parser.parse has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (50 pts), boolean chains 12, loops 3 (4 pts) (nesting depth added 27). 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 · _FileOperations._copyDirectoryMetadata (cognitive 65) · ×1
  • _FileOperations._copyDirectoryMetadata (cognitive 65) Sources/FoundationEssentials/FileManager/FileOperations.swift:977 — _FileOperations._copyDirectoryMetadata has cognitive complexity 65 (threshold 15). Drivers by points: if/else 16 (53 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 41). 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 · Calendar.dateAfterMatchingMonth (cognitive 64) · ×1
  • Calendar.dateAfterMatchingMonth (cognitive 64) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1649 — Calendar.dateAfterMatchingMonth has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (49 pts), boolean chains 9, loops 2 (6 pts) (nesting depth added 35). 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 · _FileOperations._linkOrCopyFile (cognitive 64) · ×1
  • _FileOperations._linkOrCopyFile (cognitive 64) Sources/FoundationEssentials/FileManager/FileOperations.swift:1114 — _FileOperations._linkOrCopyFile has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (44 pts), loops 3 (5 pts), match/switch 2 (5 pts), error handling 1 (4 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent 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 · _CharacterSet.addNonBMPPlanes (cognitive 63) · ×1
  • _CharacterSet.addNonBMPPlanes (cognitive 63) Sources/FoundationEssentials/CharacterSet/Annex.swift:185 — _CharacterSet.addNonBMPPlanes has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (57 pts), boolean chains 5, loops 1 (nesting depth added 32). 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 · XMLPlistScanner.parseString (cognitive 59) · ×1
  • XMLPlistScanner.parseString (cognitive 59) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1025 — XMLPlistScanner.parseString has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (54 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 35). 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 · _CharacterSet.removeNonBMPPlanes (cognitive 57) · ×1
  • _CharacterSet.removeNonBMPPlanes (cognitive 57) Sources/FoundationEssentials/CharacterSet/Annex.swift:304 — _CharacterSet.removeNonBMPPlanes has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (51 pts), boolean chains 5, loops 1 (nesting depth added 28). 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 · String.data (cognitive 57) · ×1
  • String.data (cognitive 57) Sources/FoundationEssentials/String/StringProtocol+Essentials.swift:53 — String.data has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (38 pts), loops 3 (9 pts), ternaries 3 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 28). 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 · LocalePreferences.apply (cognitive 56) · ×1
  • LocalePreferences.apply (cognitive 56) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:164 — LocalePreferences.apply has cognitive complexity 56 (threshold 15). Drivers by points: if/else 26 (42 pts), loops 4 (10 pts), ternaries 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · String.init (cognitive 56) · ×1
  • String.init (cognitive 56) Sources/FoundationEssentials/String/String+IO.swift:70 — String.init has cognitive complexity 56 (threshold 15). Drivers by points: if/else 30 (52 pts), boolean chains 3, match/switch 1 (nesting depth added 22). Of this number, 47 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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 · _CharacterSet.isEqualAnnex (cognitive 55) · ×1
  • _CharacterSet.isEqualAnnex (cognitive 55) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:437 — _CharacterSet.isEqualAnnex has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (41 pts), ternaries 2 (8 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent 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 · _CalendarICU._locked_start (cognitive 55) · ×1
  • _CalendarICU._locked_start (cognitive 55) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1388 — _CalendarICU._locked_start has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (52 pts), match/switch 2 (3 pts) (nesting depth added 33). 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 · Calendar.dateAfterMatchingHour (cognitive 54) · ×1
  • Calendar.dateAfterMatchingHour (cognitive 54) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2137 — Calendar.dateAfterMatchingHour has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 9, loops 2 (5 pts), ternaries 1 (4 pts) (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 · BidirectionalCollection._getBlock (cognitive 54) · ×1
  • BidirectionalCollection._getBlock (cognitive 54) Sources/FoundationEssentials/String/StringBlocks.swift:103 — BidirectionalCollection._getBlock has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 8, loops 2 (6 pts), ternaries 1 (nesting depth added 25). 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 · _LocaleICU.weekendRange (cognitive 53) · ×1
  • _LocaleICU.weekendRange (cognitive 53) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1240 — _LocaleICU.weekendRange has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 6 (14 pts), boolean chains 5 (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 · BuiltInUnicodeScalarSet.contains (cognitive 52) · ×1
  • BuiltInUnicodeScalarSet.contains (cognitive 52) Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift:199 — BuiltInUnicodeScalarSet.contains has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (36 pts), ternaries 2 (9 pts), boolean chains 6, match/switch 1 (nesting depth added 28). 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 · Iterator.next (cognitive 52) · ×1
  • Iterator.next (cognitive 52) Sources/FoundationEssentials/String/String+EndianAdaptorSequence.swift:178 — Iterator.next has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23 (45 pts), boolean chains 7 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarHebrew.dateInterval (cognitive 51) · ×1
  • _CalendarHebrew.dateInterval (cognitive 51) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:371 — _CalendarHebrew.dateInterval has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 3 (6 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Calendar._adjustedDateForMismatchedChineseLeapMonth (cognitive 50) · ×1
  • Calendar._adjustedDateForMismatchedChineseLeapMonth (cognitive 50) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1011 — Calendar._adjustedDateForMismatchedChineseLeapMonth has cognitive complexity 50 (threshold 15). Drivers by points: if/else 26 (47 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarGregorian.dateComponents (cognitive 50) · ×1
  • _CalendarGregorian.dateComponents (cognitive 50) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3133 — _CalendarGregorian.dateComponents has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (31 pts), ternaries 2 (9 pts), match/switch 2 (6 pts), error handling 1 (3 pts), loops 1 (nesting depth added 21). Of this number, 35 points are the body's own statements and 15 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 · _CalendarGregorian.add (cognitive 49) · ×1
  • _CalendarGregorian.add (cognitive 49) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2403 — _CalendarGregorian.add has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 2, match/switch 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Decimal._addReportingInexact (cognitive 49) · ×1
  • Decimal._addReportingInexact (cognitive 49) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:267 — Decimal._addReportingInexact has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UTF8Span._decomposed (cognitive 49) · ×1
  • UTF8Span._decomposed (cognitive 49) Sources/FoundationEssentials/String/String+Internals.swift:414 — UTF8Span._decomposed has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (41 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 20). Of this number, 38 points are the body's own statements and 11 belong to 2 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 · _LocaleICU.init (cognitive 49) · ×1
  • _LocaleICU.init (cognitive 49) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:183 — _LocaleICU.init has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (43 pts), boolean chains 6 (nesting depth added 22). 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 · _CalendarHebrew.dateComponents (cognitive 48) · ×1
  • _CalendarHebrew.dateComponents (cognitive 48) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:612 — _CalendarHebrew.dateComponents has cognitive complexity 48 (threshold 15). Drivers by points: if/else 25 (41 pts), boolean chains 7 (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 · DateComponents._validate (cognitive 48) · ×1
  • DateComponents._validate (cognitive 48) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:72 — DateComponents._validate has cognitive complexity 48 (threshold 15). Drivers by points: if/else 31 (46 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Calendar.dateAfterMatchingSecond (cognitive 47) · ×1
  • Calendar.dateAfterMatchingSecond (cognitive 47) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2303 — Calendar.dateAfterMatchingSecond has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 2 (8 pts) (nesting depth added 32). 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 · _CalendarChinese.makeDate (cognitive 47) · ×1
  • _CalendarChinese.makeDate (cognitive 47) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:634 — _CalendarChinese.makeDate has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 18 (nesting depth added 7). Of this number, 40 points are the body's own statements and 7 belong to one function item inside it that branches. 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 · _CalendarGregorian.dateComponents (cognitive 46) · ×1
  • _CalendarGregorian.dateComponents (cognitive 46) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2044 — _CalendarGregorian.dateComponents has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 17 (34 pts), if/else 5 (9 pts), boolean chains 2, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RFC3986Parser.parse (cognitive 46) · ×1
  • RFC3986Parser.parse (cognitive 46) REDACTED:644 — RFC3986Parser.parse has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29 (44 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnchoredRelativeFormatStyle.bound (cognitive 46) · ×1
  • AnchoredRelativeFormatStyle.bound (cognitive 46) Sources/FoundationInternationalization/Formatting/Date/Date+AnchoredRelativeFormatStyle.swift:154 — AnchoredRelativeFormatStyle.bound has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 11, ternaries 5 (9 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RFC3986Parser.compatibilityParse (cognitive 45) · ×1
  • RFC3986Parser.compatibilityParse (cognitive 45) REDACTED:1342 — RFC3986Parser.compatibilityParse has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 5, loops 3 (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 · _TimeZoneICUResource.binarySearchTransition (cognitive 45) · ×1
  • _TimeZoneICUResource.binarySearchTransition (cognitive 45) Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:671 — _TimeZoneICUResource.binarySearchTransition has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 4 (18 pts), boolean chains 2, loops 1 (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 · _CalendarGregorian.range (cognitive 44) · ×1
  • _CalendarGregorian.range (cognitive 44) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:502 — _CalendarGregorian.range has cognitive complexity 44 (threshold 15). Drivers by points: match/switch 12 (22 pts), if/else 14 (16 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 14). Of this number, 41 points are the body's own statements and 3 belong to one function item inside it that branches. 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 · JSONPrimitive.decodeEscapedString (cognitive 44) · ×1
  • JSONPrimitive.decodeEscapedString (cognitive 44) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:315 — JSONPrimitive.decodeEscapedString has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistMapValue.dateValue (cognitive 44) · ×1
  • XMLPlistMapValue.dateValue (cognitive 44) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:334 — XMLPlistMapValue.dateValue has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (27 pts), boolean chains 13, ternaries 2 (3 pts), loops 1 (nesting depth added 2). Of this number, 41 points are the body's own statements and 3 belong to one function item inside it that branches. 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 · _CalendarGregorian.isComponentsInSupportedRange (cognitive 43) · ×1
  • _CalendarGregorian.isComponentsInSupportedRange (cognitive 43) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1683 — _CalendarGregorian.isComponentsInSupportedRange has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29 (43 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 · URL.parse (cognitive 43) · ×1
  • URL.parse (cognitive 43) Sources/FoundationEssentials/URL/URL_Parsing.swift:285 — URL.parse has cognitive complexity 43 (threshold 15). Drivers by points: if/else 30 (43 pts), boolean chains 11, loops 4 (6 pts), ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (URL.parse::parseAuthority) 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 · _CalendarICU._locked_add (cognitive 43) · ×1
  • _CalendarICU._locked_add (cognitive 43) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1910 — _CalendarICU._locked_add has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 8, match/switch 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decimal._compare (cognitive 42) · ×1
  • Decimal._compare (cognitive 42) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:630 — Decimal._compare has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 8 (22 pts), if/else 15 (18 pts), match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormatStyle.format (cognitive 42) · ×1
  • FormatStyle.format (cognitive 42) Sources/FoundationInternationalization/Formatting/URLFormatStyle.swift:576 — FormatStyle.format has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 7, match/switch 1 (2 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 · BidirectionalCollection._matchesSeparators (cognitive 42) · ×1
  • BidirectionalCollection._matchesSeparators (cognitive 42) Sources/FoundationEssentials/String/StringBlocks.swift:41 — BidirectionalCollection._matchesSeparators has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 5 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Calendar._adjustedDateForMismatches (cognitive 41) · ×1
  • Calendar._adjustedDateForMismatches (cognitive 41) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1172 — Calendar._adjustedDateForMismatches has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 9 (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 · _CalendarGregorian.difference (cognitive 41) · ×1
  • _CalendarGregorian.difference (cognitive 41) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:3048 — _CalendarGregorian.difference has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 10, ternaries 3 (6 pts), error handling 1 (2 pts), loops 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CharacterSet.insert (cognitive 41) · ×1
  • _CharacterSet.insert (cognitive 41) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:113 — _CharacterSet.insert has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 2 (5 pts), loops 1 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 25). 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 · ProgressFraction.== (cognitive 41) · ×1
  • ProgressFraction.== (cognitive 41) Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:213 — ProgressFraction.== has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 14 (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 · URL_C+File.swift.posixLikePath (cognitive 41) · ×1
  • URL_C+File.swift.posixLikePath (cognitive 41) Sources/FoundationEssentials/URL/URL_C+File.swift:191 — URL_C+File.swift.posixLikePath has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 2 (8 pts), boolean chains 7 (nesting depth added 21). Of this number, 31 points are the body's own statements and 10 belong to one function item inside it that branches. 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 · _CalendarICU._locked_range (cognitive 41) · ×1
  • _CalendarICU._locked_range (cognitive 41) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:455 — _CalendarICU._locked_range has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 12 (22 pts), if/else 14 (16 pts), boolean chains 3 (nesting depth added 12). 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 · _CharacterSet.init (cognitive 40) · ×1
  • _CharacterSet.init (cognitive 40) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:98 — _CharacterSet.init has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 21). 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 · TimeZone.tryParseGMTName (cognitive 40) · ×1
  • TimeZone.tryParseGMTName (cognitive 40) Sources/FoundationEssentials/TimeZone/TimeZone_GMT.swift:159 — TimeZone.tryParseGMTName has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 15 (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 · UnsafeBufferPointer._decomposed (cognitive 40) · ×1
  • UnsafeBufferPointer._decomposed (cognitive 40) Sources/FoundationEssentials/String/String+Internals.swift:278 — UnsafeBufferPointer._decomposed has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 12). Of this number, 35 points are the body's own statements and 5 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 · Data+Writing.swift.createTemporaryFile (cognitive 40) · ×1
  • Data+Writing.swift.createTemporaryFile (cognitive 40) Sources/FoundationEssentials/Data/Data+Writing.swift:176 — Data+Writing.swift.createTemporaryFile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataLocaleIdentifier.parseBaseName (cognitive 40) · ×1
  • DataLocaleIdentifier.parseBaseName (cognitive 40) Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift:126 — DataLocaleIdentifier.parseBaseName has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 7, ternaries 2 (5 pts), loops 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Calendar.dateAfterMatchingWeekOfMonth (cognitive 39) · ×1
  • Calendar.dateAfterMatchingWeekOfMonth (cognitive 39) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1751 — Calendar.dateAfterMatchingWeekOfMonth has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 3 (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 · String._resolvingSymlinksInPath (cognitive 39) · ×1
  • String._resolvingSymlinksInPath (cognitive 39) Sources/FoundationEssentials/String/String+Path.swift:641 — String._resolvingSymlinksInPath has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 2 (6 pts), loops 3 (5 pts), boolean chains 2 (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 · XMLPlistSpanReader.parseDate (cognitive 38) · ×1
  • XMLPlistSpanReader.parseDate (cognitive 38) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1053 — XMLPlistSpanReader.parseDate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 12, ternaries 2, loops 1 (nesting depth added 1). 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 · Calendar.dateAfterMatchingDay (cognitive 37) · ×1
  • Calendar.dateAfterMatchingDay (cognitive 37) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2030 — Calendar.dateAfterMatchingDay has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _CalendarFixedMonth.range (cognitive 37) · ×1
  • _CalendarFixedMonth.range (cognitive 37) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:161 — _CalendarFixedMonth.range has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 12 (21 pts), if/else 13, boolean chains 3 (nesting depth added 9). 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 · State.findCurrentTimeZone (cognitive 37) · ×1
  • State.findCurrentTimeZone (cognitive 37) Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift:123 — State.findCurrentTimeZone has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 11 (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 · Span.containsInvalidPathExtensionScalar (cognitive 37) · ×1
  • Span.containsInvalidPathExtensionScalar (cognitive 37) Sources/FoundationEssentials/String/Span+Path.swift:98 — Span.containsInvalidPathExtensionScalar has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 10, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatePatternFormatter.fill (cognitive 37) · ×1
  • DatePatternFormatter.fill (cognitive 37) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:181 — DatePatternFormatter.fill has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 8, loops 2 (4 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · URLEncoder.percentDecode (cognitive 36) · ×1
  • URLEncoder.percentDecode (cognitive 36) Sources/FoundationEssentials/URL/URLEncoder.swift:591 — URLEncoder.percentDecode has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (6 pts), boolean chains 4 (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 · Calendar._unadjustedDates (cognitive 35) · ×1
  • Calendar._unadjustedDates (cognitive 35) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:1046 — Calendar._unadjustedDates has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 3 (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 · _CharacterSet.remove (cognitive 35) · ×1
  • _CharacterSet.remove (cognitive 35) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:249 — _CharacterSet.remove has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Iterator.next (cognitive 35) · ×1
  • Iterator.next (cognitive 35) Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift:349 — Iterator.next has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 3, loops 1 (nesting depth added 17). 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 · RFC3986Parser.compatibilityParse (cognitive 35) · ×1
  • RFC3986Parser.compatibilityParse (cognitive 35) REDACTED:1207 — RFC3986Parser.compatibilityParse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25 (35 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DateComponents.isValidDate (cognitive 34) · ×1
  • DateComponents.isValidDate (cognitive 34) Sources/FoundationEssentials/Calendar/DateComponents.swift:405 — DateComponents.isValidDate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18, boolean chains 16. 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 · Decimal._toString (cognitive 34) · ×1
  • Decimal._toString (cognitive 34) Sources/FoundationEssentials/Decimal/Decimal.swift:350 — Decimal._toString has cognitive complexity 34 (threshold 15). Drivers by points: loops 8 (22 pts), if/else 6 (7 pts), ternaries 4 (5 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · EncodedString.equals (cognitive 34) · ×1
  • EncodedString.equals (cognitive 34) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:722 — EncodedString.equals has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (10 pts), boolean chains 2, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Iterator.next (cognitive 34) · ×1
  • Iterator.next (cognitive 34) Sources/FoundationEssentials/String/String+EndianAdaptorSequence.swift:73 — Iterator.next has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 3 (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 · _URLInfo.originalString (cognitive 34) · ×1
  • _URLInfo.originalString (cognitive 34) REDACTED:442 — _URLInfo.originalString has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (32 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 · _CalendarICU._locked_setToFirstInstant (cognitive 34) · ×1
  • _CalendarICU._locked_setToFirstInstant (cognitive 34) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1749 — _CalendarICU._locked_setToFirstInstant has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 6 (12 pts), boolean chains 4, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatePatternFormatter.appendLocalizedGMT (cognitive 34) · ×1
  • DatePatternFormatter.appendLocalizedGMT (cognitive 34) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:592 — DatePatternFormatter.appendLocalizedGMT has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, ternaries 2 (5 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarHebrew.nextMonthWeekdayWeekOfMonthMatch (cognitive 33) · ×1
  • _CalendarHebrew.nextMonthWeekdayWeekOfMonthMatch (cognitive 33) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1293 — _CalendarHebrew.nextMonthWeekdayWeekOfMonthMatch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 8, ternaries 2 (3 pts), loops 1 (nesting depth added 10). Of this number, 26 points are the body's own statements and 7 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 · _FileManagerImpl.createDirectory (cognitive 33) · ×1
  • _FileManagerImpl.createDirectory (cognitive 33) Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:324 — _FileManagerImpl.createDirectory has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31 (71 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 42). 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. This shape REPEATS in the file: one other method here (_FileManagerImpl.createDirectory::_createDirectoryRecursively) 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 · Calendar._weekdayComponents (cognitive 32) · ×1
  • Calendar._weekdayComponents (cognitive 32) Sources/FoundationEssentials/Calendar/Calendar_Recurrence.swift:896 — Calendar._weekdayComponents has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2 (6 pts), loops 3 (5 pts), match/switch 1 (2 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 · _CalendarHebrew.nextMonthWeekdayOrdinalMatch (cognitive 32) · ×1
  • _CalendarHebrew.nextMonthWeekdayOrdinalMatch (cognitive 32) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1186 — _CalendarHebrew.nextMonthWeekdayOrdinalMatch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 10). Of this number, 26 points are the body's own statements and 6 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 · JSONScannerEventSource.peekJSON5KeyScalar (cognitive 32) · ×1
  • JSONScannerEventSource.peekJSON5KeyScalar (cognitive 32) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:274 — JSONScannerEventSource.peekJSON5KeyScalar has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenStepPlist.swift.advanceToNonSpace (cognitive 32) · ×1
  • OpenStepPlist.swift.advanceToNonSpace (cognitive 32) Sources/FoundationEssentials/PropertyList/OpenStepPlist.swift:472 — OpenStepPlist.swift.advanceToNonSpace has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (9 pts), match/switch 2 (7 pts), boolean chains 3 (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 · _CalendarHebrew.nextWeekdayOrdinalMatch (cognitive 31) · ×1
  • _CalendarHebrew.nextWeekdayOrdinalMatch (cognitive 31) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1240 — _CalendarHebrew.nextWeekdayOrdinalMatch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 7, loops 1 (nesting depth added 10). Of this number, 25 points are the body's own statements and 6 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 · Guts.enforceAttributeConstraintsAfterMutation (cognitive 31) · ×1
  • Guts.enforceAttributeConstraintsAfterMutation (cognitive 31) Sources/FoundationEssentials/AttributedString/AttributedStringAttributeConstrainingBehavior.swift:251 — Guts.enforceAttributeConstraintsAfterMutation has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 10 (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 · Attributed._format (cognitive 31) · ×1
  • Attributed._format (cognitive 31) Sources/FoundationInternationalization/Formatting/ByteCountFormatStyle.swift:220 — Attributed._format has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 5 (8 pts), loops 3 (5 pts), match/switch 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AttributedString.init (cognitive 30) · ×1
  • AttributedString.init (cognitive 30) Sources/FoundationEssentials/AttributedString/AttributedStringCodable.swift:333 — AttributedString.init has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 6, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Calendar._adjustedDate (cognitive 30) · ×1
  • Calendar._adjustedDate (cognitive 30) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:568 — Calendar._adjustedDate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 11, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · URLEncoder.percentDecode (cognitive 30) · ×1
  • URLEncoder.percentDecode (cognitive 30) Sources/FoundationEssentials/URL/URLEncoder.swift:493 — URLEncoder.percentDecode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _URL.deletingLastPathComponent (cognitive 30) · ×1
  • _URL.deletingLastPathComponent (cognitive 30) Sources/FoundationEssentials/URL/URL_Impl.swift:1202 — _URL.deletingLastPathComponent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 10). Of this number, 28 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 · Duration.bound (cognitive 30) · ×1
  • Duration.bound (cognitive 30) Sources/FoundationInternationalization/Formatting/Duration+Formatting.swift:35 — Duration.bound has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 8 (10 pts), boolean chains 6, match/switch 2 (nesting depth added 9). 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 · _TimeZoneSingleDSTRule.startDateForRuleInYear (cognitive 30) · ×1
  • _TimeZoneSingleDSTRule.startDateForRuleInYear (cognitive 30) Sources/FoundationInternationalization/TimeZone/TimeZone_SingleDSTRule.swift:512 — _TimeZoneSingleDSTRule.startDateForRuleInYear has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (12 pts), boolean chains 4, match/switch 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 · _CalendarChinese.range (cognitive 29) · ×1
  • _CalendarChinese.range (cognitive 29) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:374 — _CalendarChinese.range has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 6 (10 pts), ternaries 1 (2 pts) (nesting depth added 8). 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 · Base64._decode (cognitive 29) · ×1
  • Base64._decode (cognitive 29) Sources/FoundationEssentials/Data/Data+Base64.swift:505 — Base64._decode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _URL.windowsFilePath (cognitive 29) · ×1
  • _URL.windowsFilePath (cognitive 29) Sources/FoundationEssentials/URL/URL_Impl.swift:638 — _URL.windowsFilePath has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenStepPlist.swift.getDataBytes (cognitive 29) · ×1
  • OpenStepPlist.swift.getDataBytes (cognitive 29) Sources/FoundationEssentials/PropertyList/OpenStepPlist.swift:422 — OpenStepPlist.swift.getDataBytes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, loops 1 (nesting depth added 10). Of this number, 18 points are the body's own statements and 11 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 · build-list-format-data-impl.swift.pack (cognitive 29) · ×1
  • build-list-format-data-impl.swift.pack (cognitive 29) utils/build-list-format-data-impl.swift:138 — build-list-format-data-impl.swift.pack has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 10 (12 pts), boolean chains 2, ternaries 1 (nesting depth added 6). Of this number, 21 points are the body's own statements and 8 belong to 2 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 · _CharacterSet.== (cognitive 28) · ×1
  • _CharacterSet.== (cognitive 28) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:359 — _CharacterSet.== has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 7, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FileManagerImpl.createDirectory · ×1
  • _FileManagerImpl.createDirectory::_createDirectoryRecursively (cognitive 28) Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:339 — _FileManagerImpl.createDirectory::_createDirectoryRecursively has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 3 (nesting depth added 17). 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. This shape REPEATS in the file: one other method here (_FileManagerImpl.createDirectory) 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 · BufferViewIterator.digits (cognitive 28) · ×1
  • BufferViewIterator.digits (cognitive 28) Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:50 — BufferViewIterator.digits has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistScannerEventSource.dispatchOpenTag (cognitive 28) · ×1
  • XMLPlistScannerEventSource.dispatchOpenTag (cognitive 28) Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:154 — XMLPlistScannerEventSource.dispatchOpenTag has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 1 (nesting depth added 13). 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 · _TimeZoneICUResource.init (cognitive 28) · ×1
  • _TimeZoneICUResource.init (cognitive 28) Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:314 — _TimeZoneICUResource.init has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Calendar.dateAfterMatchingWeekdayOrdinal (cognitive 27) · ×1
  • Calendar.dateAfterMatchingWeekdayOrdinal (cognitive 27) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1849 — Calendar.dateAfterMatchingWeekdayOrdinal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 3, loops 2 (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 · ResolvedDateComponents.init (cognitive 27) · ×1
  • ResolvedDateComponents.init (cognitive 27) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:114 — ResolvedDateComponents.init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _CalendarHebrew.supportsNextDateFastPath (cognitive 27) · ×1
  • _CalendarHebrew.supportsNextDateFastPath (cognitive 27) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:85 — _CalendarHebrew.supportsNextDateFastPath has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 19, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _CharacterSet.hasMember (cognitive 27) · ×1
  • _CharacterSet.hasMember (cognitive 27) Sources/FoundationEssentials/CharacterSet/_CharacterSet+ImmutableFunctions.swift:26 — _CharacterSet.hasMember has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3 (8 pts), boolean chains 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 · _CharacterSet.appendBitmap (cognitive 27) · ×1
  • _CharacterSet.appendBitmap (cognitive 27) Sources/FoundationEssentials/CharacterSet/_CharacterSet+StorageConversionHelpers.swift:142 — _CharacterSet.appendBitmap has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (10 pts), loops 1 (4 pts), match/switch 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decimal.init (cognitive 27) · ×1
  • Decimal.init (cognitive 27) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:191 — Decimal.init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (6 pts), ternaries 2 (4 pts), match/switch 1 (3 pts), boolean chains 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 · _FileManagerImpl.attributesOfItem (cognitive 27) · ×1
  • _FileManagerImpl.attributesOfItem (cognitive 27) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:604 — _FileManagerImpl.attributesOfItem has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, ternaries 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSON5Scanner.validateNumber (cognitive 27) · ×1
  • JSON5Scanner.validateNumber (cognitive 27) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1058 — JSON5Scanner.validateNumber has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistMapValue.parseSpecialRealValue (cognitive 27) · ×1
  • XMLPlistMapValue.parseSpecialRealValue (cognitive 27) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:557 — XMLPlistMapValue.parseSpecialRealValue has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (13 pts), match/switch 1 (nesting depth added 6). 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 · XMLPlistSpanReader.parseSpecialReal (cognitive 27) · ×1
  • XMLPlistSpanReader.parseSpecialReal (cognitive 27) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:956 — XMLPlistSpanReader.parseSpecialReal has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (13 pts), match/switch 1 (nesting depth added 6). 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 · URL.schemeFlags (cognitive 27) · ×1
  • URL.schemeFlags (cognitive 27) Sources/FoundationEssentials/URL/URL_Parsing.swift:719 — URL.schemeFlags has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (11 pts), 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 · _SwiftURL.appending (cognitive 27) · ×1
  • _SwiftURL.appending (cognitive 27) Sources/FoundationEssentials/URL/URL_Swift.swift:644 — _SwiftURL.appending has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 7, match/switch 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 11 belong to 2 function items inside it that branch. 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 · Data+Reading.swift.readBytesFromFileDescriptor (cognitive 27) · ×1
  • Data+Reading.swift.readBytesFromFileDescriptor (cognitive 27) Sources/FoundationEssentials/Data/Data+Reading.swift:469 — Data+Reading.swift.readBytesFromFileDescriptor has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Data+Writing.swift.writeToFileDescriptorWithProgress (cognitive 27) · ×1
  • Data+Writing.swift.writeToFileDescriptorWithProgress (cognitive 27) Sources/FoundationEssentials/Data/Data+Writing.swift:97 — Data+Writing.swift.writeToFileDescriptorWithProgress has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListFormatterImpl.format (cognitive 27) · ×1
  • ListFormatterImpl.format (cognitive 27) Sources/FoundationInternationalization/Formatting/ListFormatterImpl.swift:256 — ListFormatterImpl.format has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 8, loops 2 (5 pts), match/switch 1 (nesting depth added 9). 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 · _CalendarGregorian.minMaxRange (cognitive 26) · ×1
  • _CalendarGregorian.minMaxRange (cognitive 26) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:617 — _CalendarGregorian.minMaxRange has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 10). Of this number, 19 points are the body's own statements and 7 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 · _FileManagerImpl.attributesOfFileSystem (cognitive 26) · ×1
  • _FileManagerImpl.attributesOfFileSystem (cognitive 26) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:711 — _FileManagerImpl.attributesOfFileSystem has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4, ternaries 1 (nesting depth added 6). Of this number, 25 points are the body's own statements and 1 belongs 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 · JSONLegacyDecoderImpl.unwrapDecimal (cognitive 26) · ×1
  • JSONLegacyDecoderImpl.unwrapDecimal (cognitive 26) Sources/FoundationEssentials/JSON/JSONDecoder.swift:864 — JSONLegacyDecoderImpl.unwrapDecimal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONDecoderImpl.unwrapFloatingPoint (cognitive 26) · ×1
  • JSONDecoderImpl.unwrapFloatingPoint (cognitive 26) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:223 — JSONDecoderImpl.unwrapFloatingPoint has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 16). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · _CalendarICU.date (cognitive 26) · ×1
  • _CalendarICU.date (cognitive 26) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1137 — _CalendarICU.date has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _CalendarFixedMonth.rolled (cognitive 25) · ×1
  • _CalendarFixedMonth.rolled (cognitive 25) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:606 — _CalendarFixedMonth.rolled has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, ternaries 2 (3 pts), match/switch 1 (nesting depth added 9). Of this number, 24 points are the body's own statements and 1 belongs 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 · _CharacterSet.init (cognitive 25) · ×1
  • _CharacterSet.init (cognitive 25) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:213 — _CharacterSet.init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FileOperations._copyRegularFile (cognitive 25) · ×1
  • _FileOperations._copyRegularFile (cognitive 25) Sources/FoundationEssentials/FileManager/FileOperations.swift:877 — _FileOperations._copyRegularFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistScanner.readTag (cognitive 25) · ×1
  • XMLPlistScanner.readTag (cognitive 25) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:828 — XMLPlistScanner.readTag has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 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 · _URLComponents._uncheckedString (cognitive 25) · ×1
  • _URLComponents._uncheckedString (cognitive 25) Sources/FoundationEssentials/URL/URLComponents.swift:506 — _URLComponents._uncheckedString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, boolean chains 7, ternaries 1. 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 · _SwiftURL.fillCFURLImpl (cognitive 25) · ×1
  • _SwiftURL.fillCFURLImpl (cognitive 25) Sources/FoundationEssentials/URL/URL_Swift.swift:1242 — _SwiftURL.fillCFURLImpl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · OutputSpan.append (cognitive 25) · ×1
  • OutputSpan.append (cognitive 25) Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:112 — OutputSpan.append has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (12 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · String+IO.swift.encodingFromDataForExtendedAttribute (cognitive 25) · ×1
  • String+IO.swift.encodingFromDataForExtendedAttribute (cognitive 25) Sources/FoundationEssentials/String/String+IO.swift:328 — String+IO.swift.encodingFromDataForExtendedAttribute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 2 (6 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 · Date.daysBeforeMonth (cognitive 24) · ×1
  • Date.daysBeforeMonth (cognitive 24) Sources/FoundationEssentials/CodableUtilities.swift:148 — Date.daysBeforeMonth has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 1, 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 · Calendar._adjustedComponents (cognitive 24) · ×1
  • Calendar._adjustedComponents (cognitive 24) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:675 — Calendar._adjustedComponents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, 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 · _CalendarChinese.dateComponents (cognitive 24) · ×1
  • _CalendarChinese.dateComponents (cognitive 24) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:714 — _CalendarChinese.dateComponents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Data._computeGoodSubstringShift (cognitive 24) · ×1
  • Data._computeGoodSubstringShift (cognitive 24) Sources/FoundationEssentials/Data/Data+Searching+BoyerMoore.swift:149 — Data._computeGoodSubstringShift has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 6 (10 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decimal.__decimal · ×1
  • Decimal.__decimal::consume (cognitive 24) Sources/FoundationEssentials/Decimal/Decimal.swift:553 — Decimal.__decimal::consume has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 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. This shape REPEATS in the file: one other method here (Decimal.__decimal) 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 · _FileManagerImpl._setCatInfoAttributes (cognitive 24) · ×1
  • _FileManagerImpl._setCatInfoAttributes (cognitive 24) Sources/FoundationEssentials/FileManager/FileManager+Utilities.swift:130 — _FileManagerImpl._setCatInfoAttributes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2 (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 · JSONPrimitive.makeDecimalLiteral (cognitive 24) · ×1
  • JSONPrimitive.makeDecimalLiteral (cognitive 24) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:649 — JSONPrimitive.makeDecimalLiteral has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgressFraction._math (cognitive 24) · ×1
  • ProgressFraction._math (cognitive 24) Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:83 — ProgressFraction._math has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 7 (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 · XMLPlistScannerEventSource.recognizeTag (cognitive 24) · ×1
  • XMLPlistScannerEventSource.recognizeTag (cognitive 24) Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:314 — XMLPlistScannerEventSource.recognizeTag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 pts), 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 · _URL.init (cognitive 24) · ×1
  • _URL.init (cognitive 24) Sources/FoundationEssentials/URL/URL_Impl.swift:174 — _URL.init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, match/switch 2 (3 pts) (nesting depth added 6). Of this number, 22 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 · BidirectionalCollection._range (cognitive 24) · ×1
  • BidirectionalCollection._range (cognitive 24) Sources/FoundationEssentials/String/BidirectionalCollection.swift:77 — BidirectionalCollection._range has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnitsFormatStyle.interval (cognitive 24) · ×1
  • UnitsFormatStyle.interval (cognitive 24) Sources/FoundationInternationalization/Formatting/Duration+UnitsFormatStyle.swift:710 — UnitsFormatStyle.interval has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuildDateFormatData.main (cognitive 24) · ×1
  • BuildDateFormatData.main (cognitive 24) utils/build-date-format-data-impl.swift:156 — BuildDateFormatData.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 6 (7 pts), boolean chains 5, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Calendar.advance (cognitive 23) · ×1
  • Calendar.advance (cognitive 23) Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1365 — Calendar.advance has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarFixedMonth.rataDie (cognitive 23) · ×1
  • _CalendarFixedMonth.rataDie (cognitive 23) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:416 — _CalendarFixedMonth.rataDie has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, match/switch 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 1 belongs 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 · _CalendarGregorian._firstInstant (cognitive 23) · ×1
  • _CalendarGregorian._firstInstant (cognitive 23) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:754 — _CalendarGregorian._firstInstant has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 2 (4 pts), match/switch 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.
D2 · Cognitive Complexity · DateComponents.== (cognitive 23) · ×1
  • DateComponents.== (cognitive 23) Sources/FoundationEssentials/Calendar/DateComponents.swift:496 — DateComponents.== has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 17, if/else 6. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · JSONWriter.serializeObject (cognitive 23) · ×1
  • JSONWriter.serializeObject (cognitive 23) Sources/FoundationEssentials/JSON/JSONWriter.swift:354 — JSONWriter.serializeObject has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3 (8 pts), ternaries 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 4 belong to one function item inside it that branches. 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 · Locale.identifier (cognitive 23) · ×1
  • Locale.identifier (cognitive 23) Sources/FoundationEssentials/Locale/Locale.swift:709 — Locale.identifier has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 7, loops 2 (nesting depth added 1). 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 · BPlistMetadata.parseTopLevelInfo (cognitive 23) · ×1
  • BPlistMetadata.parseTopLevelInfo (cognitive 23) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:211 — BPlistMetadata.parseTopLevelInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 5. 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 · BPlistScanner.parseTopLevelInfo (cognitive 23) · ×1
  • BPlistScanner.parseTopLevelInfo (cognitive 23) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:355 — BPlistScanner.parseTopLevelInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 5. 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 · _URLComponents.computedString (cognitive 23) · ×1
  • _URLComponents.computedString (cognitive 23) Sources/FoundationEssentials/URL/URLComponents.swift:448 — _URLComponents.computedString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 5 (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 · _SwiftURL.init (cognitive 23) · ×1
  • _SwiftURL.init (cognitive 23) Sources/FoundationEssentials/URL/URL_Swift.swift:129 — _SwiftURL.init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 6, match/switch 1 (nesting depth added 4). Of this number, 20 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 · _SwiftURL._makeCFURL (cognitive 23) · ×1
  • _SwiftURL._makeCFURL (cognitive 23) Sources/FoundationEssentials/URL/URL_Swift.swift:1106 — _SwiftURL._makeCFURL has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 6 (nesting depth added 1). 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 · _CalendarICU.dateComponents (cognitive 23) · ×1
  • _CalendarICU.dateComponents (cognitive 23) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1215 — _CalendarICU.dateComponents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, ternaries 2 (4 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Signature.createNumberFormatter (cognitive 23) · ×1
  • Signature.createNumberFormatter (cognitive 23) Sources/FoundationInternationalization/Formatting/Number/ICULegacyNumberFormatter.swift:158 — Signature.createNumberFormatter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 5 (10 pts), error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarFixedMonth.dateComponents (cognitive 22) · ×1
  • _CalendarFixedMonth.dateComponents (cognitive 22) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:474 — _CalendarFixedMonth.dateComponents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _CharacterSet.createCompactBitmapFast (cognitive 22) · ×1
  • _CharacterSet.createCompactBitmapFast (cognitive 22) Sources/FoundationEssentials/CharacterSet/_CharacterSet+StorageCompactBitmap.swift:270 — _CharacterSet.createCompactBitmapFast has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 12). 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 · Base64._encodeWithLineBreaks (cognitive 22) · ×1
  • Base64._encodeWithLineBreaks (cognitive 22) Sources/FoundationEssentials/Data/Data+Base64.swift:214 — Base64._encodeWithLineBreaks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormatStyle.generateFormattedString (cognitive 22) · ×1
  • FormatStyle.generateFormattedString (cognitive 22) Sources/FoundationInternationalization/Formatting/URLFormatStyle.swift:458 — FormatStyle.generateFormattedString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONDecoderImpl.unwrapFixedWidthInteger (cognitive 22) · ×1
  • JSONDecoderImpl.unwrapFixedWidthInteger (cognitive 22) Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift:278 — JSONDecoderImpl.unwrapFixedWidthInteger has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, match/switch 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONScanner.validateNumber (cognitive 22) · ×1
  • JSONScanner.validateNumber (cognitive 22) Sources/FoundationEssentials/JSON/JSONScanner.swift:994 — JSONScanner.validateNumber has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuiltInUnicodeScalarSet.hasMember (cognitive 22) · ×1
  • BuiltInUnicodeScalarSet.hasMember (cognitive 22) Sources/FoundationEssentials/String/BuiltInUnicodeScalarSet.swift:168 — BuiltInUnicodeScalarSet.hasMember has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5 (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 · Runs._slicedRunBoundary (cognitive 22) · ×1
  • Runs._slicedRunBoundary (cognitive 22) Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:515 — Runs._slicedRunBoundary has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 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 · StringProtocol._hasDotDotComponent (cognitive 22) · ×1
  • StringProtocol._hasDotDotComponent (cognitive 22) Sources/FoundationEssentials/String/String+Path.swift:795 — StringProtocol._hasDotDotComponent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleComponents.init (cognitive 22) · ×1
  • RuleComponents.init (cognitive 22) Sources/FoundationInternationalization/TimeZone/TimeZone_SingleDSTRule.swift:55 — RuleComponents.init has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerateDateFormatData.main (cognitive 22) · ×1
  • GenerateDateFormatData.main (cognitive 22) utils/update-date-format-data-impl.swift:470 — GenerateDateFormatData.main has cognitive complexity 22 (threshold 15). Drivers by points: loops 8 (10 pts), if/else 4 (6 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Calendar._adjustedDateForMismatchedHour (cognitive 21) · ×1
  • Calendar._adjustedDateForMismatchedHour (cognitive 21) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:731 — Calendar._adjustedDateForMismatchedHour has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Calendar.bumpedDateUpToNextHigherUnitInComponents (cognitive 21) · ×1
  • Calendar.bumpedDateUpToNextHigherUnitInComponents (cognitive 21) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2452 — Calendar.bumpedDateUpToNextHigherUnitInComponents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decimal.== (cognitive 21) · ×1
  • Decimal.== (cognitive 21) Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift:539 — Decimal.== has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 20, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · XMLPlistScannerEventSource.scanUpToNextTag (cognitive 21) · ×1
  • XMLPlistScannerEventSource.scanUpToNextTag (cognitive 21) Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:364 — XMLPlistScannerEventSource.scanUpToNextTag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (4 pts), match/switch 1 (2 pts), 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 · URLEncoder._percentEncode (cognitive 21) · ×1
  • URLEncoder._percentEncode (cognitive 21) Sources/FoundationEssentials/URL/URLEncoder.swift:70 — URLEncoder._percentEncode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StringProtocol.removingURLPercentEncoding (cognitive 21) · ×1
  • StringProtocol.removingURLPercentEncoding (cognitive 21) REDACTED:1056 — StringProtocol.removingURLPercentEncoding has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenStepPlist.swift.parseQuotedPlistString (cognitive 21) · ×1
  • OpenStepPlist.swift.parseQuotedPlistString (cognitive 21) Sources/FoundationEssentials/PropertyList/OpenStepPlist.swift:213 — OpenStepPlist.swift.parseQuotedPlistString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredicateQueryRewriter._processFunction (cognitive 21) · ×1
  • PredicateQueryRewriter._processFunction (cognitive 21) Sources/FoundationMacros/PredicateMacro.swift:741 — PredicateQueryRewriter._processFunction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, ternaries 3, loops 1 (nesting depth added 4). Of this number, 19 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 · cldr-locale-fallback.swift.icuLocales (cognitive 21) · ×1
  • cldr-locale-fallback.swift.icuLocales (cognitive 21) utils/cldr-locale-fallback.swift:161 — cldr-locale-fallback.swift.icuLocales has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, loops 5 (7 pts), ternaries 1 (2 pts), if/else 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _CalendarUtility.differenceBySearch (cognitive 20) · ×1
  • _CalendarUtility.differenceBySearch (cognitive 20) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:251 — _CalendarUtility.differenceBySearch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 2, ternaries 2 (nesting depth added 7). Of this number, 19 points are the body's own statements and 1 belongs 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 · _CalendarChinese.ordinality (cognitive 20) · ×1
  • _CalendarChinese.ordinality (cognitive 20) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:452 — _CalendarChinese.ordinality has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, match/switch 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 · _CalendarFixedMonth.date (cognitive 20) · ×1
  • _CalendarFixedMonth.date (cognitive 20) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:530 — _CalendarFixedMonth.date has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarHebrew.range (cognitive 20) · ×1
  • _CalendarHebrew.range (cognitive 20) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:164 — _CalendarHebrew.range has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, match/switch 6 (10 pts) (nesting depth added 4). 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 · DateComponents._bridgeToObjectiveC (cognitive 20) · ×1
  • DateComponents._bridgeToObjectiveC (cognitive 20) Sources/FoundationEssentials/Calendar/DateComponents.swift:736 — DateComponents._bridgeToObjectiveC has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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. This shape REPEATS in the file: one other method here (DateComponents._conditionallyBridgeFromObjectiveC) 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 · DateComponents._conditionallyBridgeFromObjectiveC (cognitive 20) · ×1
  • DateComponents._conditionallyBridgeFromObjectiveC (cognitive 20) Sources/FoundationEssentials/Calendar/DateComponents.swift:768 — DateComponents._conditionallyBridgeFromObjectiveC has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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. This shape REPEATS in the file: one other method here (DateComponents._bridgeToObjectiveC) 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 · _CharacterSet.makeCharacterSetCompact (cognitive 20) · ×1
  • _CharacterSet.makeCharacterSetCompact (cognitive 20) Sources/FoundationEssentials/CharacterSet/_CharacterSet+StorageConversionHelpers.swift:68 — _CharacterSet.makeCharacterSetCompact has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), loops 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 · Data._searchBoyerMoore (cognitive 20) · ×1
  • Data._searchBoyerMoore (cognitive 20) Sources/FoundationEssentials/Data/Data+Searching+BoyerMoore.swift:15 — Data._searchBoyerMoore has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 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 · _FileManagerImpl.subpathsOfDirectory (cognitive 20) · ×1
  • _FileManagerImpl.subpathsOfDirectory (cognitive 20) Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:237 — _FileManagerImpl.subpathsOfDirectory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2, match/switch 1 (2 pts), ternaries 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 · XMLPlistSpanReader.parseEntityReferenceIntoBytes (cognitive 20) · ×1
  • XMLPlistSpanReader.parseEntityReferenceIntoBytes (cognitive 20) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:866 — XMLPlistSpanReader.parseEntityReferenceIntoBytes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, ternaries 1 (2 pts), loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SwiftURL.absoluteString (cognitive 20) · ×1
  • _SwiftURL.absoluteString (cognitive 20) Sources/FoundationEssentials/URL/URL_Swift.swift:285 — _SwiftURL.absoluteString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Guts._characterwiseIsEqual (cognitive 20) · ×1
  • Guts._characterwiseIsEqual (cognitive 20) Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift:93 — Guts._characterwiseIsEqual has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListFormatterImpl.shouldWrapBidi (cognitive 20) · ×1
  • ListFormatterImpl.shouldWrapBidi (cognitive 20) Sources/FoundationInternationalization/Formatting/ListFormatterImpl.swift:514 — ListFormatterImpl.shouldWrapBidi has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComponentSet.set (cognitive 19) · ×1
  • ComponentSet.set (cognitive 19) Sources/FoundationEssentials/Calendar/Calendar.swift:256 — ComponentSet.set has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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 · _CalendarGregorian.julianDay (cognitive 19) · ×1
  • _CalendarGregorian.julianDay (cognitive 19) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1775 — _CalendarGregorian.julianDay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (6 pts), match/switch 2 (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 · _CalendarHebrew.date (cognitive 19) · ×1
  • _CalendarHebrew.date (cognitive 19) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:563 — _CalendarHebrew.date has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7 (nesting depth added 1). 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 · DateComponents.description (cognitive 19) · ×1
  • DateComponents.description (cognitive 19) Sources/FoundationEssentials/Calendar/DateComponents.swift:559 — DateComponents.description has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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. This shape REPEATS in the file: one other method here (DateComponents.customMirror) 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 · DateComponents.customMirror (cognitive 19) · ×1
  • DateComponents.customMirror (cognitive 19) Sources/FoundationEssentials/Calendar/DateComponents.swift:591 — DateComponents.customMirror has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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. This shape REPEATS in the file: one other method here (DateComponents.description) 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 · _CharacterSet.description (cognitive 19) · ×1
  • _CharacterSet.description (cognitive 19) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:561 — _CharacterSet.description has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 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 · _FileManagerImpl._setFileProtectionValueForPath (cognitive 19) · ×1
  • _FileManagerImpl._setFileProtectionValueForPath (cognitive 19) Sources/FoundationEssentials/FileManager/FileManager+Utilities.swift:242 — _FileManagerImpl._setFileProtectionValueForPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 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.
D2 · Cognitive Complexity · JSONLegacyDecoderImpl.isTrueZero (cognitive 19) · ×1
  • JSONLegacyDecoderImpl.isTrueZero (cognitive 19) Sources/FoundationEssentials/JSON/JSONDecoder.swift:972 — JSONLegacyDecoderImpl.isTrueZero has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2, loops 1 (nesting depth added 7). Of this number, 17 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 · JSONPrimitive.json5HexLiteral (cognitive 19) · ×1
  • JSONPrimitive.json5HexLiteral (cognitive 19) Sources/FoundationEssentials/JSON/JSONPrimitive.swift:549 — JSONPrimitive.json5HexLiteral has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONScanner.prevalidateJSONNumber (cognitive 19) · ×1
  • JSONScanner.prevalidateJSONNumber (cognitive 19) Sources/FoundationEssentials/JSON/JSONScanner.swift:931 — JSONScanner.prevalidateJSONNumber has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 4 (7 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BPlistDecodingFormat.unwrapFloatingPoint (cognitive 19) · ×1
  • BPlistDecodingFormat.unwrapFloatingPoint (cognitive 19) Sources/FoundationEssentials/PropertyList/BPlistDecodingFormat.swift:124 — BPlistDecodingFormat.unwrapFloatingPoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (3 pts) (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 · XMLPlistMapValue.integerValue (cognitive 19) · ×1
  • XMLPlistMapValue.integerValue (cognitive 19) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:508 — XMLPlistMapValue.integerValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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 · XMLPlistScanner.scanUpToNextValue (cognitive 19) · ×1
  • XMLPlistScanner.scanUpToNextValue (cognitive 19) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:758 — XMLPlistScanner.scanUpToNextValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (4 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistScannerEventSource.scanStringBytes (cognitive 19) · ×1
  • XMLPlistScannerEventSource.scanStringBytes (cognitive 19) Sources/FoundationEssentials/PropertyList/XMLPlistScannerEventSource.swift:258 — XMLPlistScannerEventSource.scanStringBytes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _URL.appending (cognitive 19) · ×1
  • _URL.appending (cognitive 19) Sources/FoundationEssentials/URL/URL_Impl.swift:947 — _URL.appending has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, ternaries 2 (4 pts), match/switch 1 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · _SwiftURL.host (cognitive 19) · ×1
  • _SwiftURL.host (cognitive 19) Sources/FoundationEssentials/URL/URL_Swift.swift:405 — _SwiftURL.host has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4 (nesting depth added 3). 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 (requestedHost). 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 · Data+Reading.swift.shouldMapFileDescriptor (cognitive 19) · ×1
  • Data+Reading.swift.shouldMapFileDescriptor (cognitive 19) Sources/FoundationEssentials/Data/Data+Reading.swift:89 — Data+Reading.swift.shouldMapFileDescriptor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3 (nesting depth added 10). 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 · Data+Writing.swift.writeToFileNoAux (cognitive 19) · ×1
  • Data+Writing.swift.writeToFileNoAux (cognitive 19) Sources/FoundationEssentials/Data/Data+Writing.swift:724 — Data+Writing.swift.writeToFileNoAux has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 3, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _CalendarICU.dateComponents (cognitive 19) · ×1
  • _CalendarICU.dateComponents (cognitive 19) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1317 — _CalendarICU.dateComponents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18 (19 pts) (nesting depth added 1). 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 · DatePatternFormatter.capitalizationUsage (cognitive 19) · ×1
  • DatePatternFormatter.capitalizationUsage (cognitive 19) Sources/FoundationInternationalization/Formatting/Date/DatePatternFormatter.swift:246 — DatePatternFormatter.capitalizationUsage has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (4 pts), match/switch 2 (3 pts), boolean chains 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 · Calendar_ObjC.swift._fromNSCalendarUnits (cognitive 19) · ×1
  • Calendar_ObjC.swift._fromNSCalendarUnits (cognitive 19) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:595 — Calendar_ObjC.swift._fromNSCalendarUnits has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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 · DataLocaleIdentifier.init (cognitive 19) · ×1
  • DataLocaleIdentifier.init (cognitive 19) Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift:32 — DataLocaleIdentifier.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StringPool.init (cognitive 19) · ×1
  • StringPool.init (cognitive 19) utils/build-date-format-data-impl.swift:63 — StringPool.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decimal.compact (cognitive 18) · ×1
  • Decimal.compact (cognitive 18) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:804 — Decimal.compact has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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 · _FileManagerImpl.url (cognitive 18) · ×1
  • _FileManagerImpl.url (cognitive 18) Sources/FoundationEssentials/FileManager/FileManager+Directories.swift:116 — _FileManagerImpl.url has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent 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 · _FileOperations.linkOrCopyFile (cognitive 18) · ×1
  • _FileOperations.linkOrCopyFile (cognitive 18) Sources/FoundationEssentials/FileManager/FileOperations.swift:824 — _FileOperations.linkOrCopyFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 3 (6 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). 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 · JSONScannerEventSource.advanceTopFrame (cognitive 18) · ×1
  • JSONScannerEventSource.advanceTopFrame (cognitive 18) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:73 — JSONScannerEventSource.advanceTopFrame has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalePreferences.apply (cognitive 18) · ×1
  • LocalePreferences.apply (cognitive 18) Sources/FoundationEssentials/Locale/Locale_Preferences.swift:284 — LocalePreferences.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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 · XMLPlistScanner.scanXMLElement (cognitive 18) · ×1
  • XMLPlistScanner.scanXMLElement (cognitive 18) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:912 — XMLPlistScanner.scanXMLElement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (3 pts), 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 · XMLPlistScanner.parseEntityReference (cognitive 18) · ×1
  • XMLPlistScanner.parseEntityReference (cognitive 18) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1168 — XMLPlistScanner.parseEntityReference has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NumberingSystem.validNumberingSystems (cognitive 18) · ×1
  • NumberingSystem.validNumberingSystems (cognitive 18) Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:584 — NumberingSystem.validNumberingSystems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Components.init (cognitive 18) · ×1
  • Components.init (cognitive 18) Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:26 — Components.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileManager+SearchPaths.swift._DarwinSearchPaths (cognitive 18) · ×1
  • FileManager+SearchPaths.swift._DarwinSearchPaths (cognitive 18) Sources/FoundationEssentials/FileManager/SearchPaths/FileManager+SearchPaths.swift:84 — FileManager+SearchPaths.swift._DarwinSearchPaths has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 2 (7 pts), if/else 4 (6 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarICU.date (cognitive 18) · ×1
  • _CalendarICU.date (cognitive 18) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1265 — _CalendarICU.date has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1. 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 · DateFieldCollection.updateSchedule (cognitive 18) · ×1
  • DateFieldCollection.updateSchedule (cognitive 18) Sources/FoundationInternationalization/Formatting/Date/ICUDateFormatter.swift:555 — DateFieldCollection.updateSchedule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 1). 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 · Keywords.regionalBaseName (cognitive 18) · ×1
  • Keywords.regionalBaseName (cognitive 18) Sources/_FoundationInternationalizationData/DateFormatLookup.swift:347 — Keywords.regionalBaseName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComponentSet.highestSetUnit (cognitive 17) · ×1
  • ComponentSet.highestSetUnit (cognitive 17) Sources/FoundationEssentials/Calendar/Calendar.swift:280 — ComponentSet.highestSetUnit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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 · _CalendarUtility.isDateInWeekend (cognitive 17) · ×1
  • _CalendarUtility.isDateInWeekend (cognitive 17) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:74 — _CalendarUtility.isDateInWeekend has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7 (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 · _CalendarChinese.year (cognitive 17) · ×1
  • _CalendarChinese.year (cognitive 17) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:1210 — _CalendarChinese.year has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (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 · _CalendarFixedMonth.date (cognitive 17) · ×1
  • _CalendarFixedMonth.date (cognitive 17) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:582 — _CalendarFixedMonth.date has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, if/else 4. 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _CalendarGregorian.isDateInWeekend (cognitive 17) · ×1
  • _CalendarGregorian.isDateInWeekend (cognitive 17) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1595 — _CalendarGregorian.isDateInWeekend has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7 (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 · _CharacterSet.removeFromBitmap (cognitive 17) · ×1
  • _CharacterSet.removeFromBitmap (cognitive 17) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:374 — _CharacterSet.removeFromBitmap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, 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 · XMLPlistMapValue.dataValue (cognitive 17) · ×1
  • XMLPlistMapValue.dataValue (cognitive 17) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:280 — XMLPlistMapValue.dataValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistPrimitive.decodeInteger (cognitive 17) · ×1
  • XMLPlistPrimitive.decodeInteger (cognitive 17) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:383 — XMLPlistPrimitive.decodeInteger has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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 · XMLPlistSpanReader.decodeScalar (cognitive 17) · ×1
  • XMLPlistSpanReader.decodeScalar (cognitive 17) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:647 — XMLPlistSpanReader.decodeScalar has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent 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 · URLEncoder.addPercentEscapes (cognitive 17) · ×1
  • URLEncoder.addPercentEscapes (cognitive 17) Sources/FoundationEssentials/URL/URLEncoder.swift:190 — URLEncoder.addPercentEscapes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Span.pathExtensionDotIndex (cognitive 17) · ×1
  • Span.pathExtensionDotIndex (cognitive 17) Sources/FoundationEssentials/String/Span+Path.swift:173 — Span.pathExtensionDotIndex has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), loops 3 (nesting depth added 1). To reduce it, split the body into named stages: move each independent 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 · NSCalendar._newCalendarWithIdentifier (cognitive 17) · ×1
  • NSCalendar._newCalendarWithIdentifier (cognitive 17) Sources/FoundationInternationalization/Calendar/Calendar_ObjC.swift:39 — NSCalendar._newCalendarWithIdentifier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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 · Substring._range (cognitive 17) · ×1
  • Substring._range (cognitive 17) Sources/FoundationEssentials/String/String+Comparison.swift:651 — Substring._range has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 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.
D2 · Cognitive Complexity · Data+Writing.swift.createProtectedTemporaryFile (cognitive 17) · ×1
  • Data+Writing.swift.createProtectedTemporaryFile (cognitive 17) Sources/FoundationEssentials/Data/Data+Writing.swift:315 — Data+Writing.swift.createProtectedTemporaryFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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 · URL_Resolution.swift.resolveURLBuffers (cognitive 17) · ×1
  • URL_Resolution.swift.resolveURLBuffers (cognitive 17) Sources/FoundationEssentials/URL/URL_Resolution.swift:388 — URL_Resolution.swift.resolveURLBuffers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LocaleICU.firstDayOfWeek (cognitive 17) · ×1
  • _LocaleICU.firstDayOfWeek (cognitive 17) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:1197 — _LocaleICU.firstDayOfWeek has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (17 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 · _TimeZoneICU.timeZoneNamesFromICU (cognitive 17) · ×1
  • _TimeZoneICU.timeZoneNamesFromICU (cognitive 17) Sources/FoundationInternationalization/TimeZone/TimeZone_ICU.swift:282 — _TimeZoneICU.timeZoneNamesFromICU has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TimeZoneSingleDSTRule.dstTransition (cognitive 17) · ×1
  • _TimeZoneSingleDSTRule.dstTransition (cognitive 17) Sources/FoundationInternationalization/TimeZone/TimeZone_SingleDSTRule.swift:418 — _TimeZoneSingleDSTRule.dstTransition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TimeZoneSingleDSTRule.startDateForRule (cognitive 17) · ×1
  • _TimeZoneSingleDSTRule.startDateForRule (cognitive 17) Sources/FoundationInternationalization/TimeZone/TimeZone_SingleDSTRule.swift:469 — _TimeZoneSingleDSTRule.startDateForRule has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent 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 · String.withNTPathRepresentation (cognitive 17) · ×1
  • String.withNTPathRepresentation (cognitive 17) Sources/FoundationEssentials/String/String+Internals.swift:31 — String.withNTPathRepresentation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 1 (nesting depth added 1). 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 · Calendar._enumerateDates (cognitive 16) · ×1
  • Calendar._enumerateDates (cognitive 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:475 — Calendar._enumerateDates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Calendar._matchingDate (cognitive 16) · ×1
  • Calendar._matchingDate (cognitive 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1341 — Calendar._matchingDate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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. This shape REPEATS in the file: 2 other methods here (DateComponents.setUnits, DateComponents.mismatchedUnits) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · Calendar.dateAfterMatchingQuarter (cognitive 16) · ×1
  • Calendar.dateAfterMatchingQuarter (cognitive 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1537 — Calendar.dateAfterMatchingQuarter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · Calendar.bound (cognitive 16) · ×1
  • Calendar.bound (cognitive 16) Sources/FoundationInternationalization/Formatting/Date/DateFormatStyle.swift:1341 — Calendar.bound has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CalendarFixedMonth.ordinality (cognitive 16) · ×1
  • _CalendarFixedMonth.ordinality (cognitive 16) Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:253 — _CalendarFixedMonth.ordinality has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), match/switch 1 (nesting depth added 7). 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 · DateComponents.setUnits (cognitive 16) · ×1
  • DateComponents.setUnits (cognitive 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:201 — DateComponents.setUnits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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. This shape REPEATS in the file: 2 other methods here (DateComponents.mismatchedUnits, Calendar._matchingDate) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · DateComponents.mismatchedUnits (cognitive 16) · ×1
  • DateComponents.mismatchedUnits (cognitive 16) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:227 — DateComponents.mismatchedUnits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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. This shape REPEATS in the file: 2 other methods here (DateComponents.setUnits, Calendar._matchingDate) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · _FileManagerImpl.destinationOfSymbolicLink (cognitive 16) · ×1
  • _FileManagerImpl.destinationOfSymbolicLink (cognitive 16) Sources/FoundationEssentials/FileManager/FileManager+SymbolicLinks.swift:130 — _FileManagerImpl.destinationOfSymbolicLink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 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 · JSONScannerEventSource.consumeWhitespaceAllowingEOF (cognitive 16) · ×1
  • JSONScannerEventSource.consumeWhitespaceAllowingEOF (cognitive 16) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:444 — JSONScannerEventSource.consumeWhitespaceAllowingEOF has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgressFraction.* (cognitive 16) · ×1
  • ProgressFraction.* (cognitive 16) Sources/FoundationEssentials/ProgressManager/ProgressFraction.swift:141 — ProgressFraction.* has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (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 · XMLPlistSpanReader.parseNumericEntityReference (cognitive 16) · ×1
  • XMLPlistSpanReader.parseNumericEntityReference (cognitive 16) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:915 — XMLPlistSpanReader.parseNumericEntityReference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistSpanReader.decodeBase64 (cognitive 16) · ×1
  • XMLPlistSpanReader.decodeBase64 (cognitive 16) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1136 — XMLPlistSpanReader.decodeBase64 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XMLPlistScanner.parseNumericEntityReference (cognitive 16) · ×1
  • XMLPlistScanner.parseNumericEntityReference (cognitive 16) Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1213 — XMLPlistScanner.parseNumericEntityReference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RFC3986Parser.validate (cognitive 16) · ×1
  • RFC3986Parser.validate (cognitive 16) REDACTED:541 — RFC3986Parser.validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RFC3986Parser.parseAuthority (cognitive 16) · ×1
  • RFC3986Parser.parseAuthority (cognitive 16) REDACTED:925 — RFC3986Parser.parseAuthority has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3 (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 · _URL.appending (cognitive 16) · ×1
  • _URL.appending (cognitive 16) Sources/FoundationEssentials/URL/URL_Impl.swift:1127 — _URL.appending has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, loops 2 (5 pts) (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 · Iterator._specialFind (cognitive 16) · ×1
  • Iterator._specialFind (cognitive 16) Sources/FoundationEssentials/FileManager/SearchPaths/FileManager+DarwinSearchPaths.swift:109 — Iterator._specialFind has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), 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 · PredicateCodableConfiguration._allowType (cognitive 16) · ×1
  • PredicateCodableConfiguration._allowType (cognitive 16) Sources/FoundationEssentials/Predicate/Archiving/PredicateCodableConfiguration.swift:128 — PredicateCodableConfiguration._allowType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FixedWidthInteger._convert (cognitive 16) · ×1
  • FixedWidthInteger._convert (cognitive 16) Sources/FoundationEssentials/Decimal/Decimal+Math.swift:938 — FixedWidthInteger._convert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Guts.enforceAttributeConstraintsBeforeMutation (cognitive 16) · ×1
  • Guts.enforceAttributeConstraintsBeforeMutation (cognitive 16) Sources/FoundationEssentials/AttributedString/AttributedStringAttributeConstrainingBehavior.swift:185 — Guts.enforceAttributeConstraintsBeforeMutation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · Guts.fixScalarConstrainedAttributes (cognitive 16) · ×1
  • Guts.fixScalarConstrainedAttributes (cognitive 16) Sources/FoundationEssentials/AttributedString/AttributedStringAttributeConstrainingBehavior.swift:349 — Guts.fixScalarConstrainedAttributes has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 2 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ISO8601FormatStyle.format (cognitive 16) · ×1
  • ISO8601FormatStyle.format (cognitive 16) Sources/FoundationEssentials/Formatting/Date+ISO8601FormatStyle.swift:327 — ISO8601FormatStyle.format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OpenStepPlist.swift.parseU16Scalar (cognitive 16) · ×1
  • OpenStepPlist.swift.parseU16Scalar (cognitive 16) Sources/FoundationEssentials/PropertyList/OpenStepPlist.swift:317 — OpenStepPlist.swift.parseU16Scalar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LocaleICU.measurementSystem (cognitive 16) · ×1
  • _LocaleICU.measurementSystem (cognitive 16) Sources/FoundationInternationalization/Locale/Locale_ICU.swift:855 — _LocaleICU.measurementSystem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change coupling · ×1
  • Change coupling: Decimal+Compatibility.swift ↔ Decimal+Conformances.swift Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:1 — `Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift` and `Sources/FoundationEssentials/Decimal/Decimal+Conformances.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 5 shared commits counted here, the most recent 3 are `b898bbce` `Decimal`: further performance and correctness improvements (#2131); `af8c8086` `Decimal`: use `UInt128` significand to speed up operations (#2022); `aec5170b` Bin compat: NSDecimalString should accept dictionary in addition to l… — run `git show` on any of them.
D4 · Code Duplication · Near-duplicate member family (4 members, 5 shared lines) · ×1
  • Near-duplicate member family (4 members, 5 shared lines) Sources/FoundationEssentials/URL/URL.swift:787 — Sources/FoundationEssentials/URL/URL.swift:787-794 | Sources/FoundationEssentials/URL/URL.swift:803-810 | Sources/FoundationEssentials/URL/URL.swift:820-827 | Sources/FoundationEssentials/URL/URL.swift:834-841 — These 4 members are variants of one another: a block of 5 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member pair (74 shared lines) · ×1
  • Near-duplicate member pair (74 shared lines) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:211 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:211-312 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:355-456 — These two members are variants of one another: 74 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (71 shared lines) · ×1
  • Near-duplicate member pair (71 shared lines) Sources/FoundationEssentials/CharacterSet/Annex.swift:185 — Sources/FoundationEssentials/CharacterSet/Annex.swift:185-301 | Sources/FoundationEssentials/CharacterSet/Annex.swift:304-405 — These two members are variants of one another: 71 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (64 shared lines) · ×1
  • Near-duplicate member pair (64 shared lines) Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1388 — Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1388-1507 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:1509-1693 — These two members are variants of one another: 64 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1186 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1186-1237 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1293-1341 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (126 corresponding lines) · ×1
  • Edited copy of a member (126 corresponding lines) REDACTED:784 — REDACTED:784-922 | REDACTED:1342-1467 — These two members are one piece of code written twice and then edited apart: 126 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1053 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:1053-1133 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:334-445 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2902 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2902-2966 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2968-3031 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (97 corresponding lines) · ×1
  • Edited copy of a member (97 corresponding lines) REDACTED:644 — REDACTED:644-744 | REDACTED:1207-1303 — These two members are one piece of code written twice and then edited apart: 97 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1058 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:1058-1135 | Sources/FoundationEssentials/JSON/JSONScanner.swift:994-1053 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) REDACTED:925 — REDACTED:925-971 | REDACTED:1470-1510 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:158 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:158-212 | Sources/FoundationEssentials/JSON/JSONScanner.swift:292-346 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:225 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:225-270 | Sources/FoundationEssentials/JSON/JSONScanner.swift:359-404 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar.swift:1486 — Sources/FoundationEssentials/Calendar/Calendar.swift:1486-1543 | Sources/FoundationEssentials/Calendar/Calendar.swift:1545-1604 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:915 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:915-953 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:1213-1253 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:113 — Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:113-175 | Sources/FoundationEssentials/CharacterSet/_CharacterSet+MutableFunctions.swift:249-311 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1573 — Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1573-1609 | Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1611-1647 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:81 — Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:81-108 | Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:397-434 | Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:462-498 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:528 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:528-552 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:576-600 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:624-648 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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 (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:99 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:99-127 | Sources/FoundationEssentials/JSON/JSONScanner.swift:228-263 — 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 copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString.swift:321 — Sources/FoundationEssentials/AttributedString/AttributedString.swift:321-342 | Sources/FoundationEssentials/AttributedString/AttributedSubstring.swift:160-182 | Sources/FoundationEssentials/AttributedString/DiscontiguousAttributedSubstring.swift:103-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:396 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:396-414 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:455-473 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:339-358 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:400-419 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 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 (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:647 — Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:647-671 | Sources/FoundationEssentials/AttributedString/AttributedString+Runs.swift:673-697 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 21+ corresponding lines) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:506 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:506-526 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:554-574 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:602-622 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:650-671 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 24+ corresponding lines) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:333 — Sources/FoundationEssentials/FileManager/FileManager+Files.swift:333-356 | Sources/FoundationEssentials/FileManager/FileManager+Files.swift:367-390 | Sources/FoundationEssentials/FileManager/FileManager+SymbolicLinks.swift:33-57 | Sources/FoundationEssentials/FileManager/FileManager+SymbolicLinks.swift:97-120 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:247 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:247-265 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:267-285 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:287-305 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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 (7 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 15+ corresponding lines) Sources/FoundationEssentials/FileManager/FileOperations.swift:123 — Sources/FoundationEssentials/FileManager/FileOperations.swift:123-139 | Sources/FoundationEssentials/FileManager/FileOperations.swift:175-191 | Sources/FoundationEssentials/FileManager/FileOperations.swift:193-207 | Sources/FoundationEssentials/FileManager/FileOperations.swift:209-225 | Sources/FoundationEssentials/FileManager/FileOperations.swift:227-241 | Sources/FoundationEssentials/FileManager/FileOperations.swift:243-259 | Sources/FoundationEssentials/FileManager/FileOperations.swift:261-275 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:311 — Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:311-330 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:332-351 | Sources/FoundationEssentials/CharacterSet/CharacterSet.swift:353-372 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:471 — Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:471-479 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:481-489 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:491-499 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:501-509 — 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 copies of one member (6 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 18+ corresponding lines) Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:74 — Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:74-95 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:110-130 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:145-167 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:182-204 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:219-236 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:251-273 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:232 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:232-247 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:145-159 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:666-679 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) Sources/FoundationEssentials/URL/URL_C+Encoding.swift:27 — Sources/FoundationEssentials/URL/URL_C+Encoding.swift:27-33 | Sources/FoundationEssentials/URL/URL_C+Encoding.swift:35-41 | Sources/FoundationEssentials/URL/URL_C+Encoding.swift:43-49 | Sources/FoundationEssentials/URL/URL_C+Encoding.swift:51-57 | Sources/FoundationEssentials/URL/URL_C+Encoding.swift:59-65 | Sources/FoundationEssentials/URL/URL_C+Encoding.swift:67-73 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:232 — Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:232-252 | Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:257-278 | Sources/FoundationInternationalization/Locale/Locale+Components_ICU.swift:477-497 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 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 (7 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 5+ corresponding lines) Sources/FoundationEssentials/Data/ContiguousBytes.swift:153 — Sources/FoundationEssentials/Data/ContiguousBytes.swift:153-157 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:185-189 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:212-216 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:240-244 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:268-272 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:296-300 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:328-335 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 10+ corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:22 — Sources/FoundationEssentials/PropertyList/PlistDictionaryEncoder.swift:22-31 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:225-234 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:236-245 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:247-256 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:258-267 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) Sources/FoundationEssentials/URL/URL_Swift.swift:371 — Sources/FoundationEssentials/URL/URL_Swift.swift:371-383 | Sources/FoundationEssentials/URL/URL_Swift.swift:389-399 | Sources/FoundationEssentials/URL/URL_Swift.swift:499-512 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 5+ corresponding lines) Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:64 — Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:64-68 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:70-74 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:76-80 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:82-86 | Sources/FoundationEssentials/PropertyList/XMLPlistDecodingFormat.swift:88-92 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 4+ corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:172 — Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:172-175 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:177-180 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:182-185 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:187-190 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:192-195 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:197-201 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:682 — Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:682-689 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:698-705 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:811-818 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:862-869 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:871-878 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) Sources/FoundationEssentials/Data/Data.swift:469 — Sources/FoundationEssentials/Data/Data.swift:469-478 | Sources/FoundationEssentials/Data/Data.swift:551-560 | Sources/FoundationEssentials/Data/Representations/DataStorage.swift:198-207 | Sources/FoundationEssentials/Data/Representations/DataStorage.swift:224-233 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:228 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:228-234 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:116-123 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift:116-123 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:220-229 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 8+ corresponding lines) Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:483 — Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:483-490 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:497-504 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:549-556 | Sources/FoundationEssentials/PropertyList/PlistDecoderGeneric.swift:558-565 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 5+ corresponding lines) Sources/FoundationInternationalization/String/SortDescriptor.swift:241 — Sources/FoundationInternationalization/String/SortDescriptor.swift:241-245 | Sources/FoundationInternationalization/String/SortDescriptor.swift:247-251 | Sources/FoundationInternationalization/String/SortDescriptor.swift:254-258 | Sources/FoundationInternationalization/String/SortDescriptor.swift:260-264 | Sources/FoundationInternationalization/String/SortDescriptor.swift:266-270 | Sources/FoundationInternationalization/String/SortDescriptor.swift:272-276 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) Sources/FoundationEssentials/AttributedString/FoundationAttributes.swift:394 — Sources/FoundationEssentials/AttributedString/FoundationAttributes.swift:394-401 | Sources/FoundationEssentials/ComparisonResult.swift:59-66 | Sources/FoundationEssentials/UUID.swift:283-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (44–47 lines × 2) · ×1
  • Duplicated block (44–47 lines × 2) Sources/FoundationEssentials/CharacterSet/Annex.swift:186 — Sources/FoundationEssentials/CharacterSet/Annex.swift:186-232 | Sources/FoundationEssentials/CharacterSet/Annex.swift:305-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/CharacterSet/Annex.swift:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) REDACTED:880 — REDACTED:880-922 | REDACTED:1425-1467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:880` 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 (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) Sources/FoundationEssentials/Calendar/Calendar.swift:1504 — Sources/FoundationEssentials/Calendar/Calendar.swift:1504-1541 | Sources/FoundationEssentials/Calendar/Calendar.swift:1563-1600 — 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/FoundationEssentials/Calendar/Calendar.swift:1504` 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:835 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:835-871 | Sources/FoundationEssentials/JSON/JSONScanner.swift:793-829 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (29–35 lines × 2) · ×1
  • Duplicated block (29–35 lines × 2) REDACTED:649 — REDACTED:649-677 | REDACTED:1209-1243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:649` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–30 lines × 4) · ×1
  • Duplicated block (22–30 lines × 4) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:376 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:376-397 | Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:163-184 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:510-539 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:168-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:375` calls `isSupported` and `Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:164` 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 (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:244 — Sources/FoundationEssentials/PropertyList/BPlistPrimitive.swift:244-272 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:388-416 — 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/FoundationEssentials/PropertyList/BPlistPrimitive.swift:244` 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 (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) Sources/FoundationEssentials/String/String+Internals.swift:366 — Sources/FoundationEssentials/String/String+Internals.swift:366-392 | Sources/FoundationEssentials/String/String+Internals.swift:482-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/String/String+Internals.swift:366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–21 lines × 3) · ×1
  • Duplicated block (19–21 lines × 3) Sources/FoundationMacros/PredicateMacro.swift:508 — Sources/FoundationMacros/PredicateMacro.swift:508-528 | Sources/FoundationMacros/PredicateMacro.swift:569-587 | Sources/FoundationMacros/PredicateMacro.swift:622-640 — 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/FoundationMacros/PredicateMacro.swift:508` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) Sources/FoundationEssentials/URL/URLEncoder.swift:241 — Sources/FoundationEssentials/URL/URLEncoder.swift:241-258 | Sources/FoundationEssentials/URL/URLEncoder.swift:507-527 — 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/FoundationEssentials/URL/URLEncoder.swift:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:402 — Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:402-422 | Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:467-486 — 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/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:75 — Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:75-94 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:121-140 | Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:176-195 — 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/FoundationEssentials/ProgressManager/ProgressManager.swift:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:120` calls `access` and `Sources/FoundationEssentials/ProgressManager/ProgressManager.swift:74` 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 (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) Sources/FoundationEssentials/URL/URL_Bridge.swift:307 — Sources/FoundationEssentials/URL/URL_Bridge.swift:307-326 | Sources/FoundationEssentials/URL/URL_Bridge.swift:350-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/URL/URL_Bridge.swift:307` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1994 — Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:1994-2009 | Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2086-2104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2107` calls `_dateComponents`, `component` and `Sources/FoundationEssentials/Calendar/Calendar_Enumerate.swift:2013` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:436 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:436-453 | Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift:380-398 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:436` 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 (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:99 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:99-117 | Sources/FoundationEssentials/JSON/JSONScanner.swift:228-246 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSON5Scanner.swift:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) Sources/FoundationEssentials/CharacterSet/Annex.swift:256 — Sources/FoundationEssentials/CharacterSet/Annex.swift:256-270 | Sources/FoundationEssentials/CharacterSet/Annex.swift:381-397 — 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/FoundationEssentials/CharacterSet/Annex.swift:256` 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 (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) Sources/FoundationEssentials/JSON/JSON5Scanner.swift:35 — Sources/FoundationEssentials/JSON/JSON5Scanner.swift:35-50 | Sources/FoundationEssentials/JSON/JSONScanner.swift:164-179 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:691-704 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSON5Scanner.swift` and `Sources/FoundationEssentials/JSON/JSONScanner.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) Sources/FoundationEssentials/FileManager/FileManager+Files.swift:338 — Sources/FoundationEssentials/FileManager/FileManager+Files.swift:338-353 | Sources/FoundationEssentials/FileManager/FileManager+Files.swift:372-387 — 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/FoundationEssentials/FileManager/FileManager+Files.swift:338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:424 — Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:424-438 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:444-458 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:462-476 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:481-495 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:500-514 — 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/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:424` 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 (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:102 — Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:102-116 | Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:173-187 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift:103-117 — before extracting anything, compare `Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitiveSource.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/JSON/JSONPrimitiveSource.swift:102` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:582 — Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:582-596 | Sources/FoundationEssentials/JSON/JSONScannerEventSource.swift:599-612 — 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 (3–14 lines × 3) · ×1
  • Duplicated block (3–14 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1205 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1205-1218 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1253-1265 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1308-1310 — 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/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1205` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1221 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1221-1233 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1269-1281 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1325-1337 — 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/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:85 — Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:85-96 | Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:402-412 | Sources/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:467-476 — 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/FoundationInternationalization/Formatting/Number/ICUNumberFormatter.swift:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:314 — Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:314-325 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:390-404 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:406-417 — 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/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:314` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) Sources/FoundationEssentials/Calendar/CalendarUtility.swift:75 — Sources/FoundationEssentials/Calendar/CalendarUtility.swift:75-86 | Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1599-1611 — 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/FoundationEssentials/Calendar/CalendarUtility.swift:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1613` calls `timeInDay` and `Sources/FoundationEssentials/Calendar/CalendarUtility.swift:87` 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 (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1187 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1187-1197 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1294-1301 — 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/FoundationEssentials/Calendar/Calendar_Hebrew.swift:1187` 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 (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) Sources/FoundationEssentials/CharacterSet/Annex.swift:284 — Sources/FoundationEssentials/CharacterSet/Annex.swift:284-294 | Sources/FoundationEssentials/CharacterSet/Annex.swift:370-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/CharacterSet/Annex.swift:284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:169 — Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:169-177 | Sources/FoundationEssentials/CharacterSet/_CharacterSet.swift:187-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) Sources/FoundationMacros/PredicateMacro.swift:525 — Sources/FoundationMacros/PredicateMacro.swift:525-534 | Sources/FoundationMacros/PredicateMacro.swift:536-545 | Sources/FoundationMacros/PredicateMacro.swift:547-556 | Sources/FoundationMacros/PredicateMacro.swift:558-567 | Sources/FoundationMacros/PredicateMacro.swift:589-598 | Sources/FoundationMacros/PredicateMacro.swift:600-609 | Sources/FoundationMacros/PredicateMacro.swift:611-620 — all 7 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/FoundationMacros/PredicateMacro.swift:525` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:412 — Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:412-421 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:430-439 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:450-459 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:468-477 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:487-496 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:506-515 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:412` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–10 lines × 5) · ×1
  • Duplicated block (9–10 lines × 5) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:414 — Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:414-423 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:432-441 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:452-461 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:508-517 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:525-533 — 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/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:414` 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 (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:320 — Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:320-328 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:399-407 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:412-421 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:426-439 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:446-459 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:464-477 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:483-496 | Sources/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:502-515 — all 8 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/FoundationInternationalization/URL+UnicodeLookalikeTable.swift:320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:65 — Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:65-73 | Sources/FoundationInternationalization/Formatting/Number/FloatingPointParseStrategy.swift:61-69 | Sources/FoundationInternationalization/Formatting/Number/IntegerParseStrategy.swift:59-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationInternationalization/Formatting/Number/Decimal+ParseStrategy.swift:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:584 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:584-591 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:597-604 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:614-621 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (1–8 lines × 6) · ×1
  • Duplicated block (1–8 lines × 6) Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:372 — Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:372-373 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:374-374 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:781-782 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:783-783 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:805-812 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:837-844 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:805` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–8 lines × 3) · ×1
  • Duplicated block (4–8 lines × 3) Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:123 — Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:123-130 | Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:132-139 | Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:140-143 — 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/FoundationEssentials/Formatting/FormatParsingUtilities.swift:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:130` calls `quotientAndRemainder` and `Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:143` 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:269 — Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:269-275 | Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:45-51 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:65-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Chinese.swift:269` 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 (1–7 lines × 4) · ×1
  • Duplicated block (1–7 lines × 4) Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:973 — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:973-979 | Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:982-982 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:573-579 | Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift:582-582 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:973` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:979` calls `UInt8` and `Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:982` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:200 — Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:200-205 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:100-105 | Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift:100-105 | Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift:191-196 — before extracting anything, compare `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift` and `Sources/FoundationEssentials/AttributedString/AttributedString+UnicodeScalarView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+CharacterView.swift:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:584 — Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:584-588 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:597-601 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:631-635 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:646-650 | Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:670-674 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (3–5 lines × 6) · ×1
  • Duplicated block (3–5 lines × 6) Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:147 — Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:147-151 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:189-193 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:236-238 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:239-243 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:293-295 | Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:297-301 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:147` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:188` calls `applyChanges` and `Sources/FoundationEssentials/AttributedString/AttributedString+AttributeTransformation.swift:146` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–5 lines × 5) · ×1
  • Duplicated block (4–5 lines × 5) Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1887 — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1887-1896 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:571-574 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:831-835 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:881-885 | Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift:940-943 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:1887` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (1–5 lines × 3) · ×1
  • Duplicated block (1–5 lines × 3) Sources/FoundationEssentials/Data/ContiguousBytes.swift:74 — Sources/FoundationEssentials/Data/ContiguousBytes.swift:74-74 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:110-114 | Sources/FoundationEssentials/Data/ContiguousBytes.swift:133-137 — 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/FoundationEssentials/Data/ContiguousBytes.swift:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) Sources/FoundationEssentials/JSON/JSONDecoder.swift:312 — Sources/FoundationEssentials/JSON/JSONDecoder.swift:312-320 | Sources/FoundationEssentials/JSON/JSONEncoder.swift:363-371 | Sources/FoundationEssentials/PropertyList/PlistDecoder.swift:68-76 | Sources/FoundationEssentials/PropertyList/PlistEncoder.swift:68-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) Sources/FoundationEssentials/Calendar/Calendar.swift:1844 — Sources/FoundationEssentials/Calendar/Calendar.swift:1844-1848 | Sources/FoundationEssentials/Date.swift:377-381 | Sources/FoundationEssentials/Decimal/Decimal+Compatibility.swift:38-42 | Sources/FoundationEssentials/TimeZone/TimeZone.swift:370-374 | Sources/FoundationEssentials/URL/URL.swift:2006-2010 | Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:549-553 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `result` to `inout Calendar?` in one and `inout Date?` 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) Sources/FoundationEssentials/Calendar/Calendar.swift:1855 — Sources/FoundationEssentials/Calendar/Calendar.swift:1855-1860 | Sources/FoundationEssentials/Date.swift:388-393 | Sources/FoundationEssentials/TimeZone/TimeZone.swift:381-386 | Sources/FoundationEssentials/URL/URL.swift:2017-2022 | Sources/FoundationInternationalization/Locale/Locale_ObjC.swift:560-565 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:204 — Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:204-208 | Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:330-334 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:191-195 | Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift:317-321 — before extracting anything, compare `Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift` and `Sources/FoundationEssentials/PropertyList/XMLPlistEncodingFormat.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Minor — 120 finding(s)
D10 · Test Quality · No direct assertions · ×50
  • No direct assertions: noBuildConfig Tests/FoundationMacrosTests/BundleMacroTests.swift:24 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: simple Tests/FoundationMacrosTests/BundleMacroTests.swift:34 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: simpleUsingParenthesis Tests/FoundationMacrosTests/BundleMacroTests.swift:47 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: moduleResourceBundle Tests/FoundationMacrosTests/BundleMacroTests.swift:60 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: lookupHelper Tests/FoundationMacrosTests/BundleMacroTests.swift:91 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: simple Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:17 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: implicitReturn Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:34 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: inferredGenerics Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:51 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: shorthandArgumentNames Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:68 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: explicitClosureArgumentTypes Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:85 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: diagnoseMissingTrailingClosure Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:102 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: keyPath Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:145 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: comments Tests/FoundationMacrosTests/PredicateMacroBasicTests.swift:196 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: `subscript` Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:17 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: contains Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:100 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: containsWhere Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:134 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: allSatisfy Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:179 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: filter Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:224 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: startsWith Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:351 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: min Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:390 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: max Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:410 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: localizedStandardContains Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:431 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: localizedStandardCompare Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:467 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: caseInsensitiveCompare Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:521 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: evaluate Tests/FoundationMacrosTests/PredicateMacroFunctionCallTests.swift:539 — No conventional assertion call was detected, and 50 of 50 tests in `FoundationMacrosTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • + 25 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate Sources/FoundationEssentials/Data/Representations/Data+Representation.swift:13 — `!DATA_LEGACY_ABI || hasFeature(Embedded)` appears character-identically in 2 files — Sources/FoundationEssentials/Data/Representations/Data+Representation.swift, Sources/FoundationEssentials/Data/Representations/DataStorage.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/FileManager/FileManager+Files.swift:136 — `!FOUNDATION_FRAMEWORK && !hasFeature(Embedded)` appears character-identically in 6 files — Sources/FoundationEssentials/FileManager/FileManager+Files.swift, Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift, Sources/FoundationInternationalization/Locale/Locale_ICU.swift, Sources/FoundationInternationalization/TimeZone/TimeZone_GMTICU.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift:13 — `!FOUNDATION_FRAMEWORK && canImport(Darwin) && !hasFeature(Embedded)` appears character-identically in 12 files — Sources/FoundationEssentials/Codable/IterativeParsingDriver.swift, Sources/FoundationEssentials/JSON/JSON5Scanner.swift, Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift, Sources/FoundationEssentials/JSON/JSONMapBuildingSink.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Error/ErrorCodes+POSIX.swift:147 — `!os(Windows) && !os(WASI) && !os(Emscripten)` appears character-identically in 2 files — Sources/FoundationEssentials/Error/ErrorCodes+POSIX.swift, Sources/FoundationEssentials/Platform.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/FileManager/FileManager+Files.swift:528 — `!os(Windows) && !os(WASI) && !os(OpenBSD) && !os(Emscripten)` appears character-identically in 2 files — Sources/FoundationEssentials/FileManager/FileManager+Files.swift, Sources/FoundationEssentials/FileManager/FileManager+Utilities.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Data/ContiguousBytes.swift:167 — `DATA_LEGACY_ABI && !hasFeature(Embedded)` appears character-identically in 8 files — Sources/FoundationEssentials/Data/ContiguousBytes.swift, Sources/FoundationEssentials/Data/Data+Bridging.swift, Sources/FoundationEssentials/Data/Data.swift, Sources/FoundationEssentials/Data/Representations/Data+Inline.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Locale/Locale_Cache.swift:262 — `FOUNDATION_FRAMEWORK && !NO_CFPREFERENCES` appears character-identically in 2 files — Sources/FoundationEssentials/Locale/Locale_Cache.swift, Sources/FoundationEssentials/Locale/Locale_Preferences.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/NotificationCenter/AsyncMessage+AsyncSequence.swift:172 — `FOUNDATION_FRAMEWORK && !hasFeature(Embedded)` appears character-identically in 7 files — Sources/FoundationEssentials/NotificationCenter/AsyncMessage+AsyncSequence.swift, Sources/FoundationEssentials/NotificationCenter/NotificationCenter.swift, Sources/FoundationEssentials/NotificationCenter/NotificationCenterMessage.swift, Sources/FoundationEssentials/URL/URL_Bridge.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Calendar/Calendar_Cache.swift:20 — `FOUNDATION_FRAMEWORK || hasFeature(Embedded)` appears character-identically in 7 files — Sources/FoundationEssentials/Calendar/Calendar_Cache.swift, Sources/FoundationEssentials/Locale/Locale_Cache.swift, Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift, Sources/FoundationInternationalization/Formatting/Number/Decimal+FormatStyle.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/AttributedString/AttributedSubstring.swift:165 — `attributes.storage.hasConstrainedAttributes || others.storage.hasConstrainedAttributes` appears character-identically in 2 files — Sources/FoundationEssentials/AttributedString/AttributedSubstring.swift, Sources/FoundationEssentials/AttributedString/DiscontiguousAttributedSubstring.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Data/Representations/Data+LegacyRepresentation.swift:783 — `bounds.lowerBound == 0 && bounds.upperBound == 0` appears character-identically in 2 files — Sources/FoundationEssentials/Data/Representations/Data+LegacyRepresentation.swift, Sources/FoundationEssentials/Data/Representations/Data+Representation.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift:133 — `bounds.lowerBound >= _range.lowerBound && bounds.lowerBound <= _range.upperBound && bounds.upperBound >= _range.lowerBound && bounds.upperBo…` appears character-identically in 2 files — Sources/FoundationEssentials/AttributedString/AttributedString+UTF16View.swift, Sources/FoundationEssentials/AttributedString/AttributedString+UTF8View.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:961 — `buf[1] == UInt8(ascii: "a") || buf[1] == UInt8(ascii: "A")` appears character-identically in 2 files — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift, Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:970 — `buf[1] == UInt8(ascii: "i") || buf[1] == UInt8(ascii: "I")` appears character-identically in 2 files — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift, Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:962 — `buf[2] == UInt8(ascii: "n") || buf[2] == UInt8(ascii: "N")` appears character-identically in 2 files — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift, Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:972 — `buf[3] == UInt8(ascii: "f") || buf[3] == UInt8(ascii: "F")` appears character-identically in 2 files — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift, Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifier.swift:429 — `byte >= UInt8(ascii: "A") && byte <= UInt8(ascii: "Z")` appears character-identically in 2 files — Sources/FoundationInternationalization/Locale/Locale_CanonicalIdentifier.swift, Sources/_FoundationInternationalizationData/DataLocaleIdentifier.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift:691 — `byte1 < 0x21 || (byte1 > 0x7E && byte1 < 0xA1)` appears character-identically in 2 files — Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift, Sources/FoundationEssentials/PropertyList/XMLPlistScanner.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift:481 — `components.contains(.era) || components.contains(.year)` appears character-identically in 2 files — Sources/FoundationEssentials/Calendar/Calendar_FixedMonth.swift, Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Calendar/CalendarUtility.swift:451 — `components.contains(.hour) || components.contains(.minute) || components.contains(.second) || components.contains(.nanosecond)` appears character-identically in 2 files — Sources/FoundationEssentials/Calendar/CalendarUtility.swift, Sources/FoundationEssentials/Calendar/Calendar_Hebrew.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2076 — `components.contains(.isLeapMonth) || components.contains(.month)` appears character-identically in 2 files — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift, Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/JSON/JSONDecoder.swift:1103 — `count == b.count && Platform.memcmp(ptr, b.baseAddress!, b.count) == 0` appears character-identically in 2 files — Sources/FoundationEssentials/JSON/JSONDecoder.swift, Sources/FoundationEssentials/JSON/JSONDecoderImpl.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift:2396 — `diff > 0 && date >= nextDSTTransition && date < (nextDSTTransition + Double(diff))` appears character-identically in 2 files — Sources/FoundationEssentials/Calendar/Calendar_Gregorian.swift, Sources/FoundationInternationalization/Calendar/Calendar_ICU.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/CodableUtilities.swift:278 — `digit >= _0 && digit < numericalUpperBound` appears character-identically in 2 files — Sources/FoundationEssentials/CodableUtilities.swift, Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/FoundationEssentials/CodableUtilities.swift:313 — `digit >= _A && digit < uppercaseUpperBound` appears character-identically in 2 files — Sources/FoundationEssentials/CodableUtilities.swift, Sources/FoundationEssentials/PropertyList/XMLPlistPrimitive.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.
  • + 15 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned file · ×17
  • Orphaned file Sources/FoundationEssentials/Formatting/DiscreteFormatStyle.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationInternationalization/Formatting/Date/Date+AnchoredRelativeFormatStyle.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRuns.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/Data/Data+Searching+BoyerMoore.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/WinSDK+Extensions.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/URL/URLTemplate_Expression.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/URL/URLTemplate_PercentEncoding.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/URL/URLTemplate.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file utils/update-iana-charset-names-impl.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRunsSlice.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/URL/URLTemplate_Substitution.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationInternationalization/Duration+Utils.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/String/String+Encoding+Names.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/URL/URLTemplate_Value.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationInternationalization/Formatting/Date/Date+ComponentsFormatStyle+Stub.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRun.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Sources/FoundationInternationalization/Formatting/Number/BinaryInteger+FormatStyle.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 6 significant file(s) lose their only recent owner: Sources/FoundationMacros/PredicateMacro.swift, Sources/FoundationEssentials/AttributedString/AttributedString+Runs+AttributeSlices.swift, Sources/FoundationEssentials/AttributedString/AttributeScope.swift, Sources/FoundationEssentials/String/StringEncodingMappingData.swift, Sources/FoundationEssentials/AttributedString/Collection Stdlib Defaults.swift, Sources/FoundationInternationalization/RangeExpression.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 5 significant file(s) lose their only recent owner: Sources/FoundationEssentials/URL/URL_Resolution.swift, Sources/FoundationEssentials/URL/URL_C+Encoding.swift, Sources/FoundationEssentials/URL/URL_Validation.swift, Sources/FoundationEssentials/URL/URL_C+Spans.swift, Sources/FoundationEssentials/URL/URL_C+Resolution.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: utils/build-list-format-data-impl.swift, Sources/_FoundationInternationalizationData/ListFormatLookup.swift, Benchmarks/Benchmarks/Formatting/BenchmarkListFormat.swift, utils/list-format-data-schema.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: Sources/FoundationEssentials/TimeZone/TimeZone_GMT.swift, Benchmarks/Benchmarks/Internationalization/BenchmarkTimeZone.swift, Benchmarks/Benchmarks/Internationalization/BenchmarkLocale.swift. Pair on, review, or document these before any departure.
D10 · Test Quality · Test project verifies nothing · ×1
  • Test project verifies nothing: FoundationMacrosTests Tests/FoundationMacrosTests/BundleMacroTests.swift:24 — No conventional assertion call was detected in 50 of 50 tests in `FoundationMacrosTests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 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 (21 single-owned of 360 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; 360 of the 406 production source files in this repository met that bar). They are anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (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/FoundationEssentials/Calendar/CalendarUtility.swift, Sources/FoundationEssentials/UUID_Wrappers.swift, Sources/FoundationEssentials/String/BidirectionalCollection.swift.
D21 · Naming Consistency · `emitAsciiStringScalar` spells `Ascii` where 30 names in the project spell it `ASCII` · ×1
  • `emitAsciiStringScalar` spells `Ascii` where 30 names in the project spell it `ASCII` Sources/FoundationEssentials/PropertyList/BPlistPrimitiveSource.swift:137 — 30 of 32 names in project FoundationEssentials spell the token `ASCII` (30 of 32; unit: names in project FoundationEssentials containing `ASCII`). Peers: FormatParsingUtilities.swift.isASCIIDigit (Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:23); Writer.append(isASCII) (Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:986); BPlistScanner.scanASCIIStringRegion (Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:529); BPlistScanner.scanASCIIString (Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:596); BPlistScanner.scanASCIIStringRegion (Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:613). Rename to `emitASCIIStringScalar`. [rule N6]
D21 · Naming Consistency · `hexToAscii` spells `Ascii` where 30 names in the project spell it `ASCII` · ×1
  • `hexToAscii` spells `Ascii` where 30 names in the project spell it `ASCII` REDACTED:976 — 30 of 32 names in project FoundationEssentials spell the token `ASCII` (30 of 32; unit: names in project FoundationEssentials containing `ASCII`). Peers: FormatParsingUtilities.swift.isASCIIDigit (Sources/FoundationEssentials/Formatting/FormatParsingUtilities.swift:23); Writer.append(isASCII) (Sources/FoundationEssentials/PropertyList/BPlistEncodingFormat.swift:986); BPlistScanner.scanASCIIStringRegion (Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:529); BPlistScanner.scanASCIIString (Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:596); BPlistScanner.scanASCIIStringRegion (Sources/FoundationEssentials/PropertyList/BPlistScanner.swift:613). Rename to `hexToASCII`. [rule N6]
D21 · Naming Consistency · `timezoneLocalizedGmtOffset` spells `Gmt` where 29 names in the project spell it `GMT` · ×1
  • `timezoneLocalizedGmtOffset` spells `Gmt` where 29 names in the project spell it `GMT` Sources/FoundationInternationalization/ICU/ICU+Enums.swift:192 — 29 of 30 names in project FoundationEssentials spell the token `GMT` (29 of 30; unit: names in project FoundationEssentials containing `GMT`). Peers: TimeZone.init(secondsFromGMT) (Sources/FoundationEssentials/TimeZone/TimeZone.swift:63); TimeZone.secondsFromGMT (Sources/FoundationEssentials/TimeZone/TimeZone.swift:166); TimeZone.fixedOffsetFromGMT (Sources/FoundationEssentials/TimeZone/TimeZone.swift:171); _TimeZoneAutoupdating.init(secondsFromGMT) (Sources/FoundationEssentials/TimeZone/TimeZone_Autoupdating.swift:18); _TimeZoneAutoupdating.secondsFromGMT (Sources/FoundationEssentials/TimeZone/TimeZone_Autoupdating.swift:30). Rename to `timezoneLocalizedGMTOffset`. [rule N6]
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 17 of 360 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (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; 360 of the 406 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: Sources/FoundationEssentials/Formatting/DiscreteFormatStyle.swift, Sources/FoundationInternationalization/Formatting/Date/Date+AnchoredRelativeFormatStyle.swift, Sources/FoundationEssentials/AttributedString/AttributedString+_InternalRuns.swift, Sources/FoundationEssentials/WinSDK+Extensions.swift, Sources/FoundationEssentials/URL/URLTemplate_Expression.swift, Sources/FoundationEssentials/URL/URLTemplate_PercentEncoding.swift, Sources/FoundationEssentials/URL/URLTemplate.swift, utils/update-iana-charset-names-impl.swift (and 9 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:7 — 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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch Sources/FoundationInternationalization/TimeZone/TimeZone_ICUResource.swift:488 — `daylightSavingTimeOffset` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Minor — 29 finding(s)
D10 · Test Quality · Skipped (documented) · ×28
  • Skipped (documented): overflowingAdd Tests/FoundationEssentialsTests/ChineseFamilyCalendarTests.swift:158 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): zeroSizeFileReadsEntireContents Tests/FoundationEssentialsTests/DataIOTests.swift:213 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): overflowingAdd Tests/FoundationEssentialsTests/FixedMonthCalendarTests.swift:324 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): pathAPIsResolveAgainstBase Tests/FoundationEssentialsTests/URLTests.swift:179 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): pathComponentsPercentEncodedSlash Tests/FoundationEssentialsTests/URLTests.swift:484 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): rootlessPath Tests/FoundationEssentialsTests/URLTests.swift:506 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): appendingPathComponentFileCases Tests/FoundationEssentialsTests/URLTests.swift:1126 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): appendingPathComponentNonFileCases Tests/FoundationEssentialsTests/URLTests.swift:1548 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): appendingPathComponentCheckFilesystem Tests/FoundationEssentialsTests/URLTests.swift:2415 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): hostPartialIPLiteralIsRejected Tests/FoundationEssentialsTests/URLTests.swift:2956 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): componentsRangeCombinations Tests/FoundationEssentialsTests/URLTests.swift:3274 — Skipped with a documented reason — a deferral, not lazy debt: Disabled in automated testing - enable manually when needed
  • Skipped (documented): dataRepresentationRoundTrip Tests/FoundationEssentialsTests/URLTests.swift:4577 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): chineseYearlessBirthdays Tests/FoundationInternationalizationTests/CalendarTests.swift:491 — Skipped with a documented reason — a deferral, not lazy debt: Disabled until timeout issue is resolved
  • Skipped (documented): allKnownTimeZones Tests/FoundationInternationalizationTests/TimeZoneTests.swift:492 — Skipped with a documented reason — a deferral, not lazy debt: This test takes a long time to run because it tests all known timezones.
  • Skipped (documented): fileAccessAtPath Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:782 — Skipped with a documented reason — a deferral, not lazy debt: This test is not available when running as the root user - root users can always access anything
  • Skipped (documented): fileExtendedAttributes Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:833 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): booleanFileAttributes Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:885 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): standardizingPathAutomount Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:974 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): resolveSymlinksViaGetAttrList Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:986 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): windowsLongPathSupport Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:1256 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): localizedGMTZero Tests/FoundationInternationalizationTests/Formatting/DatePatternFormattingTests.swift:376 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): appleNames Tests/FoundationInternationalizationTests/Formatting/DatePatternFormattingTests.swift:495 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): longAbbreviatedNameCounts Tests/FoundationInternationalizationTests/Formatting/DatePatternFormattingTests.swift:543 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): longNoonCounts Tests/FoundationInternationalizationTests/Formatting/DatePatternFormattingTests.swift:593 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • Skipped (documented): appleAliases Tests/FoundationInternationalizationTests/Formatting/DatePatternFormattingTests.swift:606 — Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
  • + 3 more in this group — see findings.md.
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: 11 declaration(s) across 2 `Package.swift` manifest(s), against 0 committed pin(s). 5 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-61de3774cb174ad6b296fbeae9668562/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-61de3774cb174ad6b296fbeae9668562/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 .11artifacts/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 183 file(s) — `Benchmarks/Benchmarks/Base64/Base64.swift`, `Benchmarks/Benchmarks/Predicates/BenchmarkPredicates.swift`, `Sources/FoundationEssentials/AttributedString/AttributedString+Guts.swift`, `Sources/FoundationEssentials/AttributedString/AttributedString.swift`, `Sources/FoundationEssentials/AttributedString/AttributedStringAttributeConstrainingBehavior.swift`, … (+178 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files).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 01a1dc45-244e-71ac-88d0-b834e3fda559 · 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