I've run SonarQube analysis on my Android/Java project and it resulted, among others, with issues:
Sections of code should not be "commented out"
If SonarQube is able to identify them, is it possible to automatically commented out code in Android Studio? I can't just remove all comments, because there are also some that are legit.
I have 500+ of them and don't want to do it manually. Any ideas?
IntelliJ IDEA To create a line comment, do the following: Place the cursor on a line of code . Select Code→Comment with Line Comment ... Select Code→Comment with Block Comment again in order to uncomment a block of code . MyFirstCIass.java Created IDEA. User: bburd Date: 7/14/12
By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again. This lets you complete:
IntelliJ IDEA can generate methods that delegate behavior to the fields or methods of your class. This approach makes it possible to give access to the data of a field or method without directly exposing this field or method. On the Code menu, click Generate Alt+Insert.
You can narrow down the suggestions list by typing any part of a word (even characters from somewhere in the middle) or invoking code completion after a dot separator. IntelliJ IDEA will show suggestions that include the characters you've entered in any positions.
There is no general solution for issues reported by SonarQube since SonarQube only finds problems, it doesn't offer a way to fix them.
In this particular case of commented out code, the same check is available directly in IntelliJ.
This inspection now lists the occurrences, and the Problems tool window offers you to fix all of them at once.
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