In Android Studio v2.2.2, Code Cleanup feature available under Analyze
option.
Analyze >> Code Cleanup
What this option exactly do with code ?
Please explain in details.
When you clean up your code using 'Android Studio', It start inspecting code defined rules.
For list of defined rules check, File -> Settings -> Editor -> Inspection. (For Mac, Android Studio -> Preferences -> Editor -> Inspection) Here you can find all rules like,
After inspection of code, Android Studio will remove such code from your files that is not necessary. It is called cleaning up code.
There are many plugins available for it. As Android Studio support by default, You can format and clean your code using this feature.