Skip to content

refactor: remove unused imports and unreachable code (Periphery pass) - #90

Merged
Paullo9 merged 1 commit into
mainfrom
refactor/dead-code-2026-11
Nov 6, 2026
Merged

Paullo9 merged 1 commit into
mainfrom
refactor/dead-code-2026-11

Conversation

@Paullo9

@Paullo9 Paullo9 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul

What and why

Removes code that nothing reaches, found with Periphery (--retain-public, the weekly scan's own command). No public API changes, no behaviour changes, no fixture or tolerance is touched.

  • 18 unused imports
  • the three package-level bundled(in:) loaders of BoteSalvatCrossSection, KrauseFluorescenceYield and MassAbsorptionTable: the tables are loaded through QuantificationTables, nothing called these
  • package-level leftovers nothing reads: KFactorSource.brownPowell (an alias of .computed), ProposalRules.Rule.title, EnergyAxis.units, CountingInterval.width, Continuum.coefficientCount, BoteSalvatCrossSection.shellNames
  • the unread references / edges arguments of the private EELSMLLS.failed
  • test leftovers: CalRow, an unused axis constant, sdNet

Periphery findings: 114 before, 82 after. What is left is not dead code:

  • 56: stored fields of the test fixture structs, filled by JSONDecoder from the pinned files
  • 22: package-level stored fields of fit and quantification results that are assigned and not read yet (for example the deviance and KKT residual of PoissonMLFit). Whether a result should carry them is a design question, not dead code
  • 4: FitSettings.defaultUpperLimitKeV (the doc comments of FitRange point to it and it carries the rule's rationale), the method argument of PooledQuantifier.geometry, and two test helper arguments (as: is there for type inference)

Checklist

  • tools/test.sh --parallel: 0 failures, no new warnings (full suite with the parity tests, on the Mac)
  • No new compiler warning; SwiftLint 0.65.1 --strict and SwiftFormat 0.64.4 --lint pass
  • Every removed symbol was searched for in Sources, Tests, docs and tools before it went
  • A test that fails without the change: not applicable, nothing observable changes

🤖 Generated with Claude Code

Code that nothing reaches, found with Periphery (--retain-public). No public API, behaviour, fixture or tolerance changes.

- 18 unused imports
- the three package-level bundled(in:) loaders of BoteSalvatCrossSection, KrauseFluorescenceYield and MassAbsorptionTable: the tables are loaded through QuantificationTables, nothing called these
- package-level leftovers nothing reads: KFactorSource.brownPowell (an alias of .computed), ProposalRules.Rule.title, EnergyAxis.units, CountingInterval.width, Continuum.coefficientCount, BoteSalvatCrossSection.shellNames
- the unread references / edges arguments of the private EELSMLLS.failed
- test leftovers: CalRow, an unused axis constant, sdNet

Periphery: 114 findings before, 82 after; the rest are fixture fields, GPU parameter blocks, public API or documented.

Done: the dead-code pass for this repo, full test suite green. Next: a PR check against a Periphery baseline so new dead code is caught.

Co-Authored-By: Claude <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Nov 6, 2026
@Paullo9
Paullo9 enabled auto-merge (squash) November 6, 2026 12:50
@Paullo9
Paullo9 merged commit 3bc9757 into main Nov 6, 2026
7 checks passed
@Paullo9
Paullo9 deleted the refactor/dead-code-2026-11 branch November 6, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant