StanfordBDHG / .github

Collection of default community health files, GitHub Action workflows, templates
https://biodesigndigitalhealth.stanford.edu
3 stars 2 forks source link

Static Code Analyzer for Unused Code #74

Open PSchmiedmayer opened 2 months ago

PSchmiedmayer commented 2 months ago

Problem

Some of the Spezi-based applications contain a decent amount of dead code as students or inexperienced developers forget to remove functions, unused views, and leftover dependencies/import statements.

Solution

We should use a tool that provides a static code analyzer for unused code and ideally integrate this in a PR workflow. For languages like Swift, periphery might be a great solution.

Additional context

It might be great to see/investigate if periphery starts to support SPM/Xcode build plugins as a great way to integrate this right in the build workflow locally as well: https://github.com/peripheryapp/periphery/issues/600

Code of Conduct

PSchmiedmayer commented 2 months ago

Periphery also introduced a nice formatter for GitHub Actions: https://github.com/peripheryapp/periphery/pull/746; a very nice integration!