Repository navigation
Remove dead code - #95
Merged
Merged
Conversation
Found with a Periphery 3.8 scan of the app and test targets, each candidate checked with git grep (incl. Info.plist, xcstrings, pbxproj). No behavior changes. - 30 unused semantic colors and their ShapeStyle accessors - TagView's never-drawn borderColor and its unread size preference; SnackbarState.Status.color - unused constants (Animation, Strings.no/close/open/instructions/role/ createShop), Font.uiLargeTitle and UIFont+Extensions.swift - shopLimitCount from SessionControllerProtocol (SessionController keeps it; it marks the permissions as loaded) - the unused id parameter of the shopkeeper update chain - unused dependencies: sessionController of ItemTagDetail/ItemTagList/ ShopBasicSettings view models, itemTagRepository of ShopSettings - ShopDetailView's unused shop parameters, ShopDetailViewModel.isLoggedIn - ItemTagRepository.isEmpty, Shopkeeper's private copy init, the JSONAPIResource subscripts, Keychain's string helpers - the KeychainStore.store debug log and commented-out code - stale Localizable.xcstrings keys, .swiftlint.yml leftovers - unused test fixtures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
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.
Phase 3 (dead-code removal). Candidates came from a Periphery 3.8 scan of the app and test targets, built into a separate DerivedData. Each one was then checked with
git grep, including string-based uses in Info.plist, the xcstrings catalogs and the pbxproj. Nothing here changes behavior.Removed
Unused semantic colors (30), each with its ShapeStyle accessor. These are the same 26 that the paid edition removed in #114 of NativeAppTemplate-iOS, plus the background and foreground colors for the personal and current-account tags. Free has no such tags. The 10-step palette scales are left whole.
TagView:
borderColorwas passed by both tags but never drawn, and the size preference measured aheightthat was never read.SnackbarState.Status.coloris also gone.Unused constants:
NativeAppTemplateConstants.Animation;Strings.no/close/open/instructions/role/createShop;Font.uiLargeTitle;UIFont+Extensions.swift(the file and its 4 pbxproj entries).shopLimitCountinSessionControllerProtocol, NullSessionController and TestSessionController. Nothing read it through the protocol.SessionControllerkeeps its own property, because itsshopkeeperdidSet andfetchPermissionsuse it to tell that the permissions are loaded.Unused parameters:
idonUpdateShopkeeperRequest,SignUpsService.updateShopkeeperandSignUpRepository(Protocol).update. The PATCH path is/shopkeeper_auth, and the id was never in the path or the body.shoponShopDetailView.header/shopDetailView.Unused view-model dependencies:
sessionControlleronItemTagDetailViewModel,ItemTagListViewModelandShopBasicSettingsViewModel;itemTagRepositoryonShopSettingsViewModel.They were stored and never read. The call sites and tests are updated to match.
Other unused members:
ShopDetailViewModel.isLoggedIn;ItemTagRepository(Protocol).isEmptyand its test doubles;init(shopkeeper:);JSONAPIResourcesubscripts;Keychain.string(for:)andKeychain.set(_: String, for:);TestSignUpRepository.lastUpdateId;Noise: the
KeychainStore.storedebug log, the commented-outTips.showAllTipsForTesting(), and a commented-out typealias inGetShopDetailRequest.Localizable.xcstrings: removed
Close,Create Shop,Instructions,No,OpenandRole. I checked this by comparing the catalog against every key in the app target's.stringsdataafter building. No code key is missing from the catalog..swiftlint.yml: removed the
excludedpaths, which sit outsideincluded: NativeAppTemplate, and the unusedidentifier_nameexceptionsby/db.Checked and left alone
Idled/Completedcatalog keys are stale, butLocalizationTest.japaneseSpotCheckuses them as glossary anchors, so they stay.fetchPermissionswrites the unchanged shopkeeper back to the keychain. This isn't a no-op:Keychain.setrunsSecItemUpdatewithkSecAttrAccessibleAfterFirstUnlock, so it re-applies the accessibility attribute to items from older versions. A write failure also setspermissionState = .error. Left as is.DataCacheUpdate,EntityRelationshipand the adapters'relationships/cacheUpdateparameters, plusJSONAPIResource.entityID/parent/metaandJSONAPIRelationship.meta/links. This is a whole unused relationship-cache layer that is shared with the paid edition. Removing it changes theEntityAdaptersignature in both repos, so it's better done as one paired refactor.ItemTag.shopNameis assign-only, but the adapter requiresshop_name. Removing it would change parsing.xxl/xxxxland CornerRadiusxlare part of the documented design scale. The protocolinitrequirements on the repository protocols are a project convention.ScrollToTopIDfields (used through Hashable), the preview'svisible, and redundantpublic(accessibility only).SampleCode.xcconfig: the pbxproj setsSAMPLE_CODE_DISAMBIGUATORitself;docs/imagesthat no file references (nfc.gif,overview_*.png,screenshots_nfc.png;social-preview.*is for the GitHub settings). These may be linked from outside, so they stay.Checks
make lint: SwiftLint 0 violations, SwiftFormat 0/136 files to format.withKnownIssue).POST /shopkeeper_auth/sign_in,GET …/permissionsandGET …/shopsfrom the phone, all 200, so local network access survived the reinstall. The app stays running.🤖 Generated with Claude Code
https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH