Search Unity

Feedback Improve high code stripping

Discussion in 'Editor & General Support' started by Hertzole, Sep 27, 2020.

  1. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    422
    Hi

    I'm a big fan of the high code stripping but I wish it was a bit more aggressive in some ways to save even more. Since there's no longer a place to post suggestions, I'll post it here in the hopes someone may see it and comment on if they can be implemented or not (and hopefully why they can't in that case)

    1. Remove called empty methods
    I know it's a bad thing to leave empty methods but it may happen from time to time. Like when preparing code in some way but you end up never using it and you forget about it. It would be nice to have these empty methods that are not overridable (but still called!) removed.

    2. Remove fields that are assigned but never used
    If the analyzers in visual studio can detect when something is assigned but never used I suspect you would be able to do the same. Sometimes I forget about some field somewhere deep within the code when refactoring and it would be nice to have them cleaned up, even if they are assigned.

    3. Remove Unity editor specific calls in MonoBehaviours
    I usually wrap all my OnDrawGizmos, OnValidate, etc in a #if UNITY_EDITOR define and that is fine, but it would be so much nicer if the code stripping could remove this automatically. They are never called in a standalone build, at least as far as I'm aware, so why should they be included?

    EDIT: Added third request.
     
    Last edited: Sep 27, 2020