Detecting deadcode in your project

twitter logo github logo ・1 min read

Our frontend stack is using react (webpack) and after one year, our codebase becomes quite huge. My company is a startup, you know as startup we might change our flow quite often, it leads to a lot of code are not used anymore and we want to clean them as much as possible. After spending few weeks to research, I found several approaches to attack that problem, therefore, I wrote this blog
https://medium.com/@MQuy90/wtf-is-deadcode-elimination-how-to-do-it-by-yourself-d1e1e26b0ed0

What do you think about those approaches?
What do you use to detect deadcode in your project?

twitter logo DISCUSS (2)
markdown guide
 

Another option: tests code coverage. It won't tell you about the dead imports but if you look at the code coverage report and a file has a low coverage it's either an untested section or dead code :-)

 

agree, that could be one of approaches for deadcode 👍🏻

Classic DEV Post from Apr 1

Tell me about a time you messed up

So I brought down the site for a little while this morning. Now I'm interested ...

Minh Quy profile image

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️