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.
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.
Code cleanup refers to the act of writing code so that it cleans up leftover data structures and other unwanted materials from memory and the filesystem. It is sometimes treated as a synonym of refactoring code, which involves making the source code itself easier to understand, maintain, and modify.
You can also run code cleanup across your entire project or solution. Right-click on the project or solution name in Solution Explorer, select Analyze and Code Cleanup, and then select Run Code Cleanup.
Code cleanup helps apply formatting rules and many other code style preferences in a bulk mode for the desired scope. Most of your code style preferences are taken into account when JetBrains Rider produces new code with code completion and code generation features, applies code templates and performs refactorings.
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.
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