Android Studio Analye Inspect Code

Missing contentDescription attribute on image
--添加属性,辅助有障碍人士使用。android:contentDescription="@null"

Gradle Dynamic version Avoid using + in version numbers;
--在Project Structure-Dependencies中添加指定版本的Library

Android Lint: Performance
Handler reference leaks
--静态、弱引用
Obsolete SDK_INT Version Check
--去除检查。因为minSdkVersion(或周围已知的API级别)已经至少与检查的版本一样高

Android Lint:Usability
Missing inputTyper or hint
--给EditTest添加inputType
app is not indexable by google search
--给主activity添加VIEW action

Performance issues
String concatenation as argument to 'StringBuilder.append()' call 
--用append()替换+


Probable bugs
Statement with empty body
--按要求改
Constant conditions & exceptions
--删除不需要的判断
Condition 'isPrintLog' is always 'true'
--添加ConstantConditions注解

Error handling
empty catch block
--添加catch内容

class structure
Field Can Be Local 
--字段能被设置成 局部变量 缩小其生命周期

Imports
Unused import
--删除无用的import

Declaration redundancy
Actual method parameter is the same constant
--删除方法参数形参
Declaration access can be weaker
--调小访问修饰符
Declaration can have final modifier
--添加final修饰符
Empty method - Method only calls its super
--删除不需要的重载方法
Redundant throws clause - The declared exception 'Exception' is never thrown
--删除不需要的throw exception
Unused declaration
--删除不需要的定义。分析结论有模糊的地方,处理复杂
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值