Android optimization clears Invalid code UCDetector and androiducdetector
Optimized clearing of unused code UCDetector in android
Http://www.ucdetector.org/index.html
UCDetector is an eclipse tool that can review unused, redundant, and variable-less code in a program.
Note:
Manual judgment is required for reflection, xml injection configuration, third-party engineering applications, jar package calls, etc.
We recommend that you search for the eclipse global search shortcut key (windows: ctrl + G, mac: control + G) somewhere else before deleting the class)
The version I used is org. ucdetector_1.10.0.jar.
: Http://download.csdn.net/detail/aaawqqq/8851445
(1) Installation
Put the downloaded jar package in the eclipse folder and place it in the \ eclipse \ dropins folder. Then restart eclipse.
:
(2) Run and use
After the installation is complete, open eclipse
The procedure is as follows: Right-click the project, select UCDetector, select Detect unnecessary code, and wait for running.
(If the project is relatively large, the running time may be a little long)
:
(3) running results
The running result report is generated in the ucdetector_reports folder of the workspace opened by eclipse.
The ucdetector_reports folder contains two files.
The running result is also displayed in problem of eclipse.
:
(4) Screening
To facilitate searching and classifying results in problem
Select inverted triangle> pop-up window> Group By> Type
:
(5) Optimization
Find the corresponding class as prompted to delete it
For example, the class BaseActivity
:
Double-click entries in problem to enter the corresponding class:
(6) End
Pay attention to the use of plug-ins:
Manual judgment is required for reflection, xml injection configuration, third-party engineering applications, jar package calls, etc.
We recommend that you search for the eclipse global search shortcut key (windows: ctrl + G, mac: control + G) somewhere else before deleting the class)
Attached references:
Lint classification and Common Errors
Http://mikewang.blog.51cto.com/3826268/1003276
44 JAVA code quality management tools:
Http://blog.csdn.net/qbg19881206/article/details/8757026
Attach the beast and wish everyone a daily Improvement
// Please wait until then // zookeeper // zookeeper without any bugs! // Zookeeper has been completed before // zookeeper has been executed before being executed ┛ ┗ ┻ ┛
Next article: optimize the use of Android lint in Android resource files
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.