Repository navigation
refactor: remove unused imports and unreachable code (Periphery pass) - #79
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.DM4ImageObject.elementCountandVeloxEventStore.storageBytes, package-level computed properties nothing readspreferredDetectorofVeloxEMDReader.readScanImage,memoryofscalarDatasetinBraggVectorsEMD,pathofcheckParentsandmakeGroupsinHDF5AppendWriterpathfield of the privateVeloxSpectrumRead, assigned and never readPeriphery findings: 24 before, 12 after. What is left is not dead code:
JSONDecoderfrom the pinned filesDM4EDSSpectrumImage.object, part of the synthesized==h5openin the table of loaded libhdf5 symbolscontextargument of theH5atclosecallback 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 testpasses:tools/test.sh(release, the full suite with the parity tests, warning-checked) on the Mac--strictand SwiftFormat 0.64.4--lintpass🤖 Generated with Claude Code