You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using Periphery for a while in multiple projects, and recently there has been concern about whether Periphery takes storyboards/xibs (Interface Builder files in general) into account when considering whether properties/functions/classes are being used or not.
I couldn't find this information clear anywhere in the README nor in Issues of this repo, so I decided to test on my own to confirm (even though I kinda know that it worked based on past experience), and indeed I confirmed that it treats IB files safely, as such:
If there's a class (e.g. MyViewController) that gets referenced in a storyboard or xib, its IBOutlets and IBActions won't be marked as unused, regardless of whether they're being used or not.
If the class is not being referenced in any xib/storyboard and is not referenced anywhere else, the entire class gets marked as unused (as opposed to only its functions/properties)
So I'd like to invite @ileitch (or any other major contributor who has enough knowledge about the inner workings of the tool) to officially document how Periphery handles those references and make it official for future readers, as this could be a deal breaker for adoption! And perhaps, while at it, clarify why Periphery chooses to take the "safe way" instead of the "clever way" when dealing with IB files? That is: if an IB references a class, and that class has a truly unused IBAction (for instance), why it doesn't mark that function as unused? It's not being referenced anywhere. Is this a technical limitation (i.e. we can't do anything about it), or a shortcut that was taken in the past?
Looking forward to hearing from core maintainers of this tool, as I'm curious to learn more about it! 😊
Thanks for this amazing tool! ❤️
The text was updated successfully, but these errors were encountered:
If there's a class (e.g. MyViewController) that gets referenced in a storyboard or xib, its IBOutlets and IBActions won't be marked as unused, regardless of whether they're being used or not.
You are correct, this is the current behavior.
clarify why Periphery chooses to take the "safe way" instead of the "clever way" when dealing with IB files?
It is a deliberate choice that Periphery should never produce false-positive results. Because we have not yet implemented full xib parsing, Periphery retains all members on the type to avoid false positives.
I'm closing this as a duplicate of #212, as my intention is for connections in xibs to only retain the members they reference.
Hi! 👋
I've been using Periphery for a while in multiple projects, and recently there has been concern about whether Periphery takes storyboards/xibs (Interface Builder files in general) into account when considering whether properties/functions/classes are being used or not.
I couldn't find this information clear anywhere in the README nor in Issues of this repo, so I decided to test on my own to confirm (even though I kinda know that it worked based on past experience), and indeed I confirmed that it treats IB files safely, as such:
So I'd like to invite @ileitch (or any other major contributor who has enough knowledge about the inner workings of the tool) to officially document how Periphery handles those references and make it official for future readers, as this could be a deal breaker for adoption! And perhaps, while at it, clarify why Periphery chooses to take the "safe way" instead of the "clever way" when dealing with IB files? That is: if an IB references a class, and that class has a truly unused IBAction (for instance), why it doesn't mark that function as unused? It's not being referenced anywhere. Is this a technical limitation (i.e. we can't do anything about it), or a shortcut that was taken in the past?
Looking forward to hearing from core maintainers of this tool, as I'm curious to learn more about it! 😊
Thanks for this amazing tool! ❤️
The text was updated successfully, but these errors were encountered: