checkstyle对检查代码规范问题的总结,虽然还不够只能,但已经比较强大。
1.Cyclomatic Complexity is X (max allowed is X).
2.Nested if-else depth is X (max allowed is X).
3.Line matches the illegal pattern 'X'.
4.Must have at least one statement
5.Empty statement
6.Literal Strings should be compared using equals(), not 'X'.
7.switch without "default" clause.
8.Found duplicate of X lines in X, starting from line X
9.Assignment of parameter 'X' is not allowed.
10.'X' is a magic number.
11.Missing a Javadoc comment.
12.Expected X tag for 'X'.
13.Name 'X' must match pattern 'X'.
14.其他的都比较好理解。对于类,方法长度的控制,注释中各参数的说明等。
而对于圈复杂度过高,判断较复杂(if -elseif -elseif ...,switch case较多的判断)修改时还没有合适的方式。