TogetherEC 6.3审计功能简单中文注解

Together 6.3 for Eclipse 3.0这个插件非常有用。我花了点时间看了Audits功能的docs,没有全部翻译,做了一些简单的中文注解。贴上来跟大家共享一下。这些条款中有一些对我们的设计、编码很有指导作用。

Arrays and References 数组和引用
Accessing null Reference (ANR) 访问空引用
Array Index is Out of Range (AIOR) 数组下标超出范围
Array Length is Negative (ALN) 数组长度是负数
Array Length is Too Large (ALTL) 数组长度太大
Maybe Accessing Null Reference (MANR) 可能访问空引用
Maybe Array Index is Out of Range (MAIOR) 数组下标可能超出范围
Maybe Array Length is Negative (MALN) 数组长度可能是负数

Branches and Loops 分支和循环
Case Label is Unselectable (CLU) 该case分支不可能被执行
Infinite Loop (IL) 检测出无限循环
Infinite Recursion (IR) 检测出无限递归
Label is Not Used (LNU) 未被使用的标签
Loop Body is Executed Exactly Once (LBEEO) 循环体实际只被执行一次
Loop Body is Never Executed (LBNE) 循环体实际不会被执行
Statement is Unreachable (SU) 永远不可能被执行的语句

Coding Style 代码风格
switch Statement Should Include the Default Case (SSSIDC) switch语句应该包含default的情况
Accessing static Members by the Descendant Class Name (ASMDCN) 不应该通过子类访问父类的静态成员(属于哪个类就直接用哪个类)
Accessing static Member through Object (ASMO) 不应该通过对象来访问静态成员(直接使用类)
Assignment to Formal Parameter (AFP) 对形参赋值(可能是错误的,考虑使用临时变量)
Complex Assignment (CA) 复杂的赋值
Complex Initialization or Update Clause in for Loop (CIUCFL) 在循环里进行复杂的初始化或更新子语句
Declare List and Set Variables with the type of their interface (DLSV) 尽量使用List和Set接口来定义变量,而不是具体类型
Long File (LF) 尽量避免文件太长(SUN约定不要超过2000行)
Multiple Statements on One Line (MSOL) 避免一行书写多个语句
Negation Operator in if Statement (NOIS) 尽量不在if语句里使用非操作(交换if else的位置代替)
Non-final Static Attribute (NFSA) 尽量将静态属性设成final
Numerical Literal in Code (NLC) 不要直接使用数字,用命名常量代替
Operator ? : Should Not Be Used (OSNBU) 尽量不使用?操作符
Parenthesize Conditional expression in Operator ? : (PCO) 在?操作时用括号将条件表达式括起
Place Constants on the Same Side of comparisons (PCSS) 将常量放置在比较符的同一侧
Place Declaration at the Beginning of Block (PDBB) 将声明放置在语句块的开始处
Provide Incremental in for Statement (PIFS) 应该在for语句里提供增量(否则不要使用for语句)
Referencing Implementation Package (RIP) 引用了实现包(应该尽量使用接口包)
Restricted Class Declaration (RCD) 封闭的类声明(导致外部无法访问)
String Literal (SL) 字符串硬编码(尽量使用资源文件)
Temporary Variable is Used for Several Purposes (TVUSP) 临时变量被用于多种目的(尽量做到目的明确)
Use this Explicitly to access class members (UTE) 使用this明白表示使用的是类成员
Use Abbreviated Assignment Operator (UAAO) 尽可能的使用简写的赋值操作(如用a += i代替a = a + i)

Critical Errors 关键性错误
Command Query Separation 查询方法(不改变状态)与命令方法(改变状态)没有分开(要表达准确)
Hiding Inherited Attribute 子类重新定义了父类的属性(使用了同一属性名)
Hiding Inherited Static Method 子类重新定义了父类的静态方法(使用了同一方法名)
Inaccessible Matching Cons

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值