Skip to content

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

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 and nothing the shell draws or does changes.

  • 5 unused imports (2 in Sources, 3 in tests)
  • EDXRegionBridge.apply(_:to:from:state:), package-level and called by nothing (the room drives the session through select, deleteSelected and the row callbacks)
  • EDXSession.loadPins(_:), package-level and called by nothing
  • EDSNumberFormat.signed, EDXRoomFormat.progressBarWidth, and the private inMixNow and selectable of the maps tile

Periphery findings: 25 before, 14 after. What is left is not dead code:

  • 9: the fields of MetalImageView.AppliedState, which Equatable compares to decide a redraw
  • 2: the fields of RowIdentity, which Hashable reads
  • 2: isAnchor and upper in EDXMapsBlock, inputs that are assigned and not read yet
  • 1: dropTargeted in ShellWindow, a false positive: it is used through its binding ($dropTargeted)

How it was checked

  • swift test -c release --parallel: 316 tests, 0 failures, 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 and docs before it went
  • Not driven on screen: no view body changed, so there is no screenshot

🤖 Generated with Claude Code

Code that nothing reaches, found with Periphery (--retain-public). No public API changes; nothing the shell draws or does changes.

- 5 unused imports (2 in Sources, 3 in tests)
- EDXRegionBridge.apply(_:to:from:state:), package-level and called by nothing (the room drives the session through select, deleteSelected and the row callbacks)
- EDXSession.loadPins(_:), package-level and called by nothing
- EDSNumberFormat.signed, EDXRoomFormat.progressBarWidth, and the private inMixNow and selectable of the maps tile

Periphery: 25 findings before, 14 after; the rest are fields Equatable and Hashable read, two unread inputs and one false positive (a State used through its binding).

Done: the dead-code pass for this repo, 316 tests 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 fac21f0 into main Nov 6, 2026
6 checks passed
@Paullo9
Paullo9 deleted the refactor/dead-code-2026-11 branch November 6, 2026 13:24
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