I need a tool I can run that will show me a list of unused methods, variables, properties, and classes. CSS classes would be an added bonus.
I heard FXCop can do this? or NDepend or something?
It is currently not possible to detect unused public methods in VSCode (you can check for updates here). However, if it's a private method, you can mark it as private and VSCode is able to look for whether it is used or not within the scope (although do remember: methods used in the HTML template are public).
“You should be constantly looking to improve your codebase, including removing dead code.” “If you have those processes in place, you should be constantly looking to improve your codebase, including removing dead code,” he said.
Look at ReSharper.
Code Analysis in VSTS will generate warnings about this during the build process. You can set it up to treat Warnings As Errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With