其他分享
首页 > 其他分享> > 代码规范性检查

代码规范性检查

作者:互联网

原文链接:http://www.cnblogs.com/lingear/p/5996046.html
  1. [主要] A method/constructor shouldnt explicitly throw java.lang.Exception 方法或构造方法不应该显式的抛Exception
    •   It is unclear which exceptions that can be thrown from the methods. It might be difficult to document and understand the vague interfaces. Use either a class derived from RuntimeException or a checked exception.
  2. [主要] Avoid really long methods. 
    •   Violations of this rule usually indicate that the method is doing too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code.
  3. Throwing 'Throwable' is not allowed 1
  4. Method length is xx lines (max allowed is 50). 64
  5. Avoid unused method parameters such as 'xxxx' 8
  6. Class Xxxxx should be declared as final 1
    •   Checks that class which has only private constructors is declared as final.
  7. xxxx must be non-null but is marked as nullable 11

    •   This parameter is always used in a way that requires it to be nonnull, but the parameter is explicitly annotated as being Nullable. Either the use of the parameter or the annotation is wrong.
  8.  

    Overridable method 'setIsRestart' called during object construction 3

 

转载于:https://www.cnblogs.com/lingear/p/5996046.html

标签:www,methods,Avoid,检查,规范性,代码,explicitly,parameter,method
来源: https://blog.csdn.net/weixin_30363817/article/details/99563422