Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOS Analysis Toolkit

Static analysis helpers for CocoaPods + .xcworkspace iOS projects.

Run Periphery dead-code detection end-to-end (with the workspace gotchas already handled), turn raw output into readable HTML/markdown, and generate a live Sourcery map of every type in the codebase.

License: MIT Swift Tools Platform


Why this exists

Problem What this toolkit does
Periphery “succeeds” with empty output on CocoaPods workspaces Cleans caches, reinstalls Pods if needed, tries multiple invocation strategies
Raw CSV/logs nobody reads HTML report with priorities + cleanup suggestions
Build noise mixed into findings Filters and categorizes real file:line:column hits
No up-to-date architecture snapshot Sourcery template → markdown of every type, property, method

What’s inside

ios-analysis-toolkit/
├── periphery-analysis-toolkit/     # Periphery runners + report scripts
│   ├── run_periphery_analysis.sh
│   ├── analyze_periphery_results.sh
│   ├── extract_real_results.sh
│   ├── inspect_csv_format.sh
│   └── periphery.yml.example
└── sourcery-project-structure/     # Sourcery config + Structure.stencil
    ├── Sourcery.yml
    └── Templates/Structure.stencil
Component Role
periphery-analysis-toolkit End-to-end Periphery runs + HTML/markdown reporting
sourcery-project-structure Markdown overview of every type from Swift’s AST

Quick start — Periphery

Requirements: Xcode, CocoaPods, Periphery.

cd periphery-analysis-toolkit

# Configure (env or edit the script top):
export PROJECT_DIR="/path/to/MyApp"
export WORKSPACE="MyApp.xcworkspace"
export SCHEME="MyApp"
export TARGET="MyApp"

./run_periphery_analysis.sh

# Optional hygiene + reports
./inspect_csv_format.sh PeripheryAnalysis/periphery_minimal_*.txt
./extract_real_results.sh PeripheryAnalysis/periphery_minimal_*.txt
./analyze_periphery_results.sh AnalysisResults/periphery_clean_results_*.csv

What run_periphery_analysis.sh does:

  1. Clears Periphery / Xcode caches that often go stale
  2. Reinstalls CocoaPods if Pods.xcodeproj is missing
  3. Writes a tuned .periphery.yml (codesigning / arch gotchas avoided)
  4. Test-builds, then tries several Periphery modes until one yields output
  5. Emits a markdown summary of the run

Copy periphery.yml.example as a starting config for your app.


Quick start — Sourcery project structure

Requirements: Sourcery (brew install sourcery).

cd sourcery-project-structure
# Copy Sourcery.yml into your app root and set `sources` to your Swift folders
sourcery --config Sourcery.yml
# → Output/PROJECT_STRUCTURE.md

Each type gets a section: kind, protocols, properties, methods — useful as a living architecture cheat-sheet or input to other docs tooling.


Typical Periphery workflow

run_periphery_analysis.sh
        │
        ▼
inspect_csv_format.sh     ← is this real findings or build log noise?
        │
        ▼
extract_real_results.sh   ← file:line:column only, by type / hot files
        │
        ▼
analyze_periphery_results.sh  ← prioritized HTML report

Requirements

Piece Needs
Periphery toolkit Xcode, CocoaPods, Periphery CLI
Sourcery structure Sourcery CLI
Shell scripts bash, standard Unix tools

License

MIT — Copyright (c) 2021–2026 Juan Carlos Correa Arango

Author

Juan Correa (@serenoj)

Related repos

Repo Relation
ios-helper-tools Sourcery mock templates for unit tests
ios-build-scripts CI build / test / distribute scripts

About

Run Periphery dead-code analysis on CocoaPods iOS workspaces and generate Sourcery markdown maps of your Swift types — with reports you can actually read.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages