Is there a quick way to find all the commented-out code across Java files in Eclipse? Any option in Search, perhaps, or any add-on that can do this?
It should be able to find only code which is commented out, but not ordinary comments.
The Eclipse search dialog box allows you to search for files that contain a literal or a character pattern in the entire workspace, a set of projects, a specific project or folders selects in the package explorer view. Clicking on the Search menu and selecting Search or File or Java. Clicking Ctrl + H.
By default, Eclipse's editor will not display line numbers, it's no good for debugging. Here's a tip to show you how to turn on the “display line numbers” feature in Eclipse. In Eclipse IDE, select “Windows” > “Preference” > “General” > “Editors” > “Text Editors” , check on the “Show line numbers” option. See result.
Sonar can do it: http://www.sonarsource.org/commented-out-code-eradication-with-sonar/
In Eclipse, I just do a file search with the regular expression checkbox turned on:
(/\*.*;.*\*/)|(//.*;)
It will find semicolons in
// These;
and /* these; */
Works for me.
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