# peripheryapp/periphery

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/peripheryapp-periphery).**

6,145 stars · 230 forks · Swift · MIT

## Links

- GitHub: https://github.com/peripheryapp/periphery
- awesome-repositories: https://awesome-repositories.com/repository/peripheryapp-periphery.md

## Description

Periphery is a static analysis tool and dead code detector for Swift projects. It identifies unreferenced classes, structs, functions, and properties, and serves as an API surface optimizer to find public declarations that can be restricted to internal access.

The tool includes specialized scanning for Interface Builder files, such as storyboards and XIBs, to ensure UI-connected members are not incorrectly flagged as unused. It also provides automated code removal to eliminate identified dead code and unused parameters directly from source files.

Its analysis capabilities cover the detection of redundant protocols, unused enum cases, unnecessary imports, and assign-only properties. The system manages technical debt through baseline comparison filtering and supports mixed-language projects by preserving symbols exposed to the Objective-C runtime.

Periphery integrates with build systems and CI pipelines using YAML-based configuration and can export analysis results in multiple industry standard formats.

## Tags

### Development Tools & Productivity

- [Dead Code Cleanup](https://awesome-repositories.com/f/development-tools-productivity/swift-linters/dead-code-cleanup.md) — Statically analyzes Swift projects to identify unreferenced classes, structs, functions, and properties.
- [Unused Code Identification](https://awesome-repositories.com/f/development-tools-productivity/dependency-analysis-tools/code-dependency-analysis/unused-code-identification.md) — Uses binary index store data to identify unused code without requiring a full project rebuild. ([source](https://github.com/peripheryapp/periphery#readme))
- [Swift Linters](https://awesome-repositories.com/f/development-tools-productivity/swift-linters.md) — Provides static analysis of Swift project graphs to find redundant declarations and unused imports.
- [Compiler Index Store Integration](https://awesome-repositories.com/f/development-tools-productivity/symbol-indexing/compiler-index-store-integration.md) — Processes binary index stores from the Swift compiler to efficiently determine symbol usage.
- [Dead Code Removal](https://awesome-repositories.com/f/development-tools-productivity/dead-code-elimination/automatic-export-removal/dead-code-removal.md) — Automatically removes identified dead code and unused parameters directly from Swift source files. ([source](https://github.com/peripheryapp/periphery/blob/master/CHANGELOG.md))

### Data & Databases

- [Call Graph Traversals](https://awesome-repositories.com/f/data-databases/graph-traversal/call-graph-traversals.md) — Identifies unreferenced symbols by building and traversing a dependency graph of declarations and their call sites.

### Programming Languages & Runtimes

- [Interface Builder Parsing](https://awesome-repositories.com/f/programming-languages-runtimes/interface-builder-parsing.md) — Scans Storyboard and XIB files to ensure UI-connected members are not incorrectly flagged as unused.
- [Redundant Accessibility Detection](https://awesome-repositories.com/f/programming-languages-runtimes/redundant-accessibility-detection.md) — Identifies declarations marked public that are never referenced from outside their home module. ([source](https://github.com/peripheryapp/periphery#readme))
- [Interface Builder Analyzers](https://awesome-repositories.com/f/programming-languages-runtimes/interface-builder-analyzers.md) — Parses XIB and storyboard files to ensure UI-connected members are not incorrectly flagged as unused.
- [Mixed-Language Project Support](https://awesome-repositories.com/f/programming-languages-runtimes/mixed-language-project-support.md) — Retains declarations accessible to the runtime to prevent false positives in multi-language codebases. ([source](https://github.com/peripheryapp/periphery/blob/master/README.md))
- [Assign-Only Property Detection](https://awesome-repositories.com/f/programming-languages-runtimes/primary-constructors/constructor-parameter-properties/read-only-properties/assign-only-property-detection.md) — Identifies properties that are assigned values but never read, including those in structs with synthesized initializers. ([source](https://github.com/peripheryapp/periphery/blob/master/CHANGELOG.md))
- [Redundant Protocol Detection](https://awesome-repositories.com/f/programming-languages-runtimes/redundant-protocol-detection.md) — Identifies protocols that are conformed to but never used as existential types or for generic specialization. ([source](https://github.com/peripheryapp/periphery#readme))
- [Runtime Interop Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-interop-analysis.md) — Preserves symbols exposed to the Objective-C runtime to prevent false positives in mixed-language projects.
- [Synthesized Code Handling](https://awesome-repositories.com/f/programming-languages-runtimes/synthesized-code-handling.md) — Preserves properties on types with compiler-generated code to avoid marking synthesized members as unused. ([source](https://github.com/peripheryapp/periphery/blob/master/README.md))
- [Unused Enum Case Detection](https://awesome-repositories.com/f/programming-languages-runtimes/unused-enum-case-detection.md) — Identifies individual cases within non-raw-representable enumerations that are never referenced. ([source](https://github.com/peripheryapp/periphery#readme))
- [Unused Import Detection](https://awesome-repositories.com/f/programming-languages-runtimes/unused-import-detection.md) — Identifies import statements that are not required by any declaration in the source file. ([source](https://github.com/peripheryapp/periphery/blob/master/CHANGELOG.md))
- [Unused Parameter Detection](https://awesome-repositories.com/f/programming-languages-runtimes/unused-parameter-detection.md) — Identifies parameters in functions, protocols, and overridden methods that are never accessed. ([source](https://github.com/peripheryapp/periphery#readme))

### Software Engineering & Architecture

- [Accessibility Level Analysis](https://awesome-repositories.com/f/software-engineering-architecture/accessibility-level-analysis.md) — Swift Unused Code Detector identifies public declarations that can be made private because they are only used internally. ([source](https://github.com/peripheryapp/periphery/blob/master/CHANGELOG.md))
- [API Surface Reduction](https://awesome-repositories.com/f/software-engineering-architecture/swift-api-design-guidelines/api-surface-reduction.md) — Identifies public declarations that can be restricted to internal access to optimize the module's API surface.

### Testing & Quality Assurance

- [Baseline-Based Debt Management](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/code-quality-tools/code-quality-analyzers/baseline-based-debt-management.md) — Provides a mechanism to track known unused code in a baseline file to isolate new regressions from legacy debt.

### Part of an Awesome List

- [General Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/general-utilities.md) — Identifies unused code in Swift projects.
