Skip to content

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

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 this changes

Removes code that nothing reaches, found with Periphery (--retain-public, the weekly scan's own command). No public API changes, no reader returns a different byte, no fixture is touched.

  • 6 unused imports (2 in Sources, 4 in tests)
  • DM4ImageObject.elementCount and VeloxEventStore.storageBytes, package-level computed properties nothing reads
  • arguments private functions never read, with what their callers passed: preferredDetector of VeloxEMDReader.readScanImage, memory of scalarDataset in BraggVectorsEMD, path of checkParents and makeGroups in HDF5AppendWriter
  • the path field of the private VeloxSpectrumRead, assigned and never read

Periphery findings: 24 before, 12 after. What is left is not dead code:

  • 9: stored fields of the test fixture structs, filled by JSONDecoder from the pinned files
  • 1: DM4EDSSpectrumImage.object, part of the synthesized ==
  • 1: h5open in the table of loaded libhdf5 symbols
  • 1: the context argument of the H5atclose callback in the exit probe (the C signature needs it)

Why

Housekeeping after the release: less code to read and to keep compiling, and a shorter weekly scan.

Checks

  • swift test passes: tools/test.sh (release, the full suite with the parity tests, warning-checked) on the Mac
  • New or changed behaviour has a test that fails without the change: not applicable, nothing observable changes
  • Numbers a reader returns are compared with RosettaSciIO (no loosened tolerance): the parity suite is unchanged and green
  • Documentation: nothing public changed; SwiftLint 0.65.1 --strict and SwiftFormat 0.64.4 --lint pass

🤖 Generated with Claude Code

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

- 6 unused imports (2 in Sources, 4 in tests)
- DM4ImageObject.elementCount and VeloxEventStore.storageBytes, package-level computed properties nothing reads
- arguments private functions never read, with what their callers passed: preferredDetector of VeloxEMDReader.readScanImage, memory of scalarDataset in BraggVectorsEMD, path of checkParents and makeGroups in HDF5AppendWriter
- the path field of the private VeloxSpectrumRead, assigned and never read

Periphery: 24 findings before, 12 after; the rest are fixture fields, a field of a synthesized ==, the libhdf5 symbol table and a C callback argument.

Done: the dead-code pass for this repo, tools/test.sh 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:51
@Paullo9
Paullo9 merged commit fb3441b into main Nov 6, 2026
7 checks passed
@Paullo9
Paullo9 deleted the refactor/dead-code-2026-11 branch November 6, 2026 13:23
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