Is there a way to scan for ununsed public or protected methods?

The 'Find Code Issues' option can find unused private methods. Is there an option even if a workaround or a hack to find unused public or protected methods? I understand these methods can be consumed by external clients and that's why R# doesn't look for them.

In my case all my clients are my own and I have the source. If I can get a list of these methods, I can then inspect them by other means and find out if they are truly unused. Some of these methods might have the wrong visibilty declaration. For example a public method should really be private as it's intended to be used in the same class only but the developer incorrectly made it public.

1 comment

Hello abdu,

Actually, 'Find code issues' feature can list unused public and protected
members as well. You just need to turn on Solution-wide analysis for your
solution first (under ReSharper -> Options -> Code Inspection -> Settings).
Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

The 'Find Code Issues' option can find unused private methods. Is
there an option even if a workaround or a hack to find unused public
or protected methods? I understand these methods can be consumed by
external clients and that's why R# doesn't look for them.

In my case all my clients are my own and I have the source. If I can
get a list of these methods, I can then inspect them by other means
and find out if they are truly unused. Some of these methods might
have the wrong visibilty declaration. For example a public method
should really be private as it's intended to be used in the same class
only but the developer incorrectly made it public.

---
Original message URL:
http://devnet.jetbrains.net/message/5317948#5317948



0

Please sign in to leave a comment.