When your application is getting bigger, it is difficult to know what parts are being used for the current use cases. It is likely there are pieces of code, needed at the beginning, no required anymore. These parts of the software are still working fine, tested with the corresponding unit tests, but not actually needed.
What is the best way to handle this scenario? Is there any standard way to detect this code to mark it as deprecated and remove it in next releases?
EDITED: I mostly work with Javascript in the backend side