sonar:默認的掃描規則

http://www.javashuo.com/article/p-eiwmubrj-h.htmlhtml

https://note.youdao.com/ynoteshare1/index.html?id=3c1e6a08a21ada4dfe0123281637e299&type=notejava

 http://www.javashuo.com/article/p-eiwmubrj-h.htmlweb

 

 

 

文本版:正則表達式

soanr規則java版            
啓禁用狀態    規則    規則內容    禁用緣由
啓用    ".equals()" should not be used to test the values of "Atomic" classes    equals()方法不該該用在原子類型的數據上(如:AtomicInteger, AtomicLong, AtomicBoolean).    
啓用    "=+" should not be used instead of "+="    "=+"不能夠替代 「+=」.    
啓用    "==" and "!=" should not be used when "equals" is overridden    若是繼承自對象的 equals method沒有被重寫,則使用等號"==操做符和equals方法來比較兩個對象是等價的,不然不能用等號操做符.    
啓用    "@CheckForNull" or "@Nullable" should not be used on primitive types    "@CheckForNull" 或者 "@Nullable" 註解不該該用於基本類型(byte, short, int, long, float, double, boolean, char).    
啓用    "@Controller" classes that use "@SessionAttributes" must call "setComplete" on their "SessionStatus" objects    使用了「@SessionAttributes」註解的「@Controller」類必須在其「SessionStatus」對象上調用「setComplete」.    
啓用    "@Deprecated" code should not be used    被@Deprecated 註解標註的代碼不該該被使用.    
啓用    "@EnableAutoConfiguration" should be fine-uned    @EnableAutoConfiguration」缺點是它可能加載和配置應用程序永遠不會使用的bean,所以會消耗比實際須要更多的CPU和RAM。@EnableAutoConfiguration應該配置爲排除應用程序不須要的全部bean.    
啓用    "@Import"s should be preferred to "@ComponentScan"s    因爲@ComponentScan會減慢項目啓動的速度,應該選擇顯式引入jar包的「@Import」註解,而不是「@ComponentScan」註解.    
啓用    "@NonNull" values should not be set to null    @NonNull註解修飾的字段不能被賦爲null, 標記爲@NotNull、@NonNull或@NonNull的字段、參數和返回值一般在使用前不檢查空值。將這些值中的一個設置爲null,或者在構造函數中沒有設置這樣的類fieldin,可能會在運行時致使nullpointerexception.    
啓用    "@Override" should be used on overriding and implementing methods    在重寫和實現方法時,須要添加"@Override"註解.    
啓用    "@RequestMapping" methods should be "public"    "@RequestMapping"註解應該用來修飾public方法/類.    
啓用    "@RequestMapping" methods should specify HTTP method    @RequestMapping應該顯式的指定HTTP請求的類型.    
啓用    "@SpringBootApplication" and "@ComponentScan" should not be used in the default package    "@SpringBootApplication" 和 "@ComponentScan" 註解不該該在默認包中使用.    
啓用    "action" mappings should not have too many "forward" entries    action映射不該該有太多的「forward」實體.    
啓用    "Arrays.stream" should be used for primitive arrays    流應該被用在基本類型數組上.    
啓用    "Bean Validation" (JSR 380) should be properly configured    "Bean Validation" (JSR 380)應該被正確的配置,未添加@Valid 註解時,Bean Validation 校驗將不會生效.    
啓用    "BigDecimal(double)" should not be used    因爲精度的緣由,BigDecimal(double) 類型不該該被使用,每每會使用valueof()方法將double類型數據進行轉化.    
啓用    "catch" clauses should do more than rethrow    catch 捕獲到異常以後,不該該僅僅只是拋出異常    
啓用    "Class.forName()" should not load JDBC 4.0+ drivers    「Class.forName()」不該該加載JDBC 4.0+驅動程序    
啓用    "clone" should not be overridden    clone()方法不該該被重寫,重寫可能致使淺克隆的問題    
啓用    "Cloneables" should implement "clone"    Cloneables 接口須要實現 clone()方法    
啓用    "close()" calls should not be redundant    不該該有多餘的close()方法的調用    
啓用    "collect" should be used with "Streams" instead of "list::add"    使用 Streams 時,應該用 collect,由於collect 的進程是並行且安全的    
啓用    "Collections.EMPTY_LIST", "EMPTY_MAP", and "EMPTY_SET" should not be used    由於"Collections.EMPTY_LIST", "EMPTY_MAP", and "EMPTY_SET"會返回默認的集合,會致使對於返回值判null的步驟缺失的問題,不推薦使用    
啓用    "compareTo" results should not be checked for specific values    「compareTo」結果不該檢查特定值,一般檢查>0或者<0    
啓用    "compareTo" should not be overloaded    compareTo 參數個數不該該超出聲明的個數    
啓用    "compareTo" should not return "Integer.MIN_VALUE"    compareTo 的返回值不能是Integer.MIN_VALUE    
啓用    "DateUtils.truncate" from Apache Commons Lang library should not be used    Apache Commons Lang 的日期截取方法 DateUtils.truncate() 不會四捨五入,不該該被使用    
啓用    "default" clauses should be last    switch中 default應該被放在最後    
啓用    "DefaultMessageListenerContainer" instances should not drop messages during restarts    DefaultMessageListenerContainer實例不該該在重啓期間刪除消息    
啓用    "deleteOnExit" should not be used    java程序執行結束後,有本身的回收機制,不須要用deleteOnExit回收臨時文件    
啓用    "Double.longBitsToDouble" should not be used for "int"    int類型的數據轉換爲lone double 會存在精度問題,不該該這樣使用    
啓用    "entrySet()" should be iterated when both the key and value are needed    在須要獲取map中的鍵值對key和value時,應該用entryset()方法    
啓用    "enum" fields should not be publicly mutable    集合類型的值不該該是可變的    
啓用    "equals" method overrides should accept "Object" parameters    重載的equals方法,應該能接受object類型的參數    
啓用    "equals" method parameters should not be marked "@Nonnull"    equals方法的參數不該該被@Nonnull註解修飾,equals()方法能夠接受爲null的數據    
啓用    "equals" methods should be symmetric and work for subclasses    equals方法能夠應用於子類,由於"=="操做符須要保證兩端數據的對稱性,但父類不是子類的實例    
啓用    "equals(Object obj)" and "hashCode()" should be overridden in pairs    equals(Object obj)和hashCode()應該成對出現    
啓用    "equals(Object obj)" should be overridden along with the "compareTo(T obj)" method    equals(Object obj)和compareTo(T obj)應該一塊兒重寫    
啓用    "equals(Object obj)" should test argument type    由於equals方法能接受泛型參數,因此須要對於傳遞的參數類型進行驗證    
是    "Exception" should not be caught when not required by called methods    當調用的方法不須要捕獲異常時,不該該捕獲到異常(主要針對於運行時異常和檢查異常)    運行時若是異常應該能正常捕獲到,並提醒開發人員調整
啓用    "Externalizable" classes should have no-arguments constructors    Externalizable 類須要有無參構造函數    
啓用    "File.createTempFile" should not be used to create a directory    File.createTempFile 不夠安全,不該該用於建立新的目錄    
啓用    "final" classes should not have "protected" members    final 類是不可被繼承的,不該該有protected 類型的元素    
啓用    "finalize" should not set fields to "null"    finalize 修飾的空間不該該被置爲null    
啓用    "for" loop increment clauses should modify the loops' counters    循環增量子句應該修改計數器    
啓用    "for" loop stop conditions should be invariant    循環中止的條件應該是不可變的    
啓用    "getClass" should not be used for synchronization    getClass方法不該該被用在synchronization 修飾的方法中    
啓用    "hashCode" and "toString" should not be called on array instances    array 實例中不該該使用 hashCode 和 toString 方法    
啓用    "HostnameVerifier.verify" should not always return true    HostnameVerifier.verify 不該該一直返回 true    
啓用    "HttpOnly" should be set on cookies    應該在 cookies 中設置 HttpOnly 屬性,能夠有效地防止XSS攻擊    
啓用    "HttpSecurity" URL patterns should be correctly ordered    用HttpSecurity 方法配置url 應該按照必定的聲明順序    
啓用    "HttpServletRequest.getRequestedSessionId()" should not be used    不該該使用 HttpServletRequest.getRequestedSessionId() 方法獲取 sessionId    
啓用    "if ... else if" constructs should end with "else" clauses    if ... else if 結構應該以 else 語句結束    
啓用    "indexOf" checks should not be for positive numbers    indexOf()方法結果判斷不該該僅針對於正數    
啓用    "indexOf" checks should use a start position    indexOfF方法應該傳入起始地址參數    
啓用    "instanceof" operators that always return "true" or "false" should be removed    若是 instanceof 操做符的結果一直返回true或者false,那麼相關的調用語句應該被刪除    
啓用    "Integer.toHexString" should not be used to build hexadecimal strings    Integer.toHexString方法不該該用於構建16進制字符串    
啓用    "InterruptedException" should not be ignored    不該該忽略InterruptedException(方法阻塞)報錯    
啓用    "iterator" should not return "this"    iterator()方法不該該返回this    
啓用    "Iterator.hasNext()" should not call "Iterator.next()"    Iterator.hasNext()是判斷是否有下一個元素,但並不會改變指針指向,而next()會改變指針指向,若是沒有下一個元素,會直接報空指針異常    
啓用    "Iterator.next()" methods should throw "NoSuchElementException"    Iterator.next() 方法應該拋出 NoSuchElementException 異常    
啓用    "java.lang.Error" should not be extended    java.lang.Error 不該該被繼承    
啓用    "java.nio.Files#delete" should be preferred    由於java.nio.Files#delete會拋異常並說明異常的緣由,因此在刪除文件時應優先考慮java.nio.Files#delete方法    
啓用    "java.time" classes should be used for dates and times    獲取日期或者時間,應該使用java.time方法    
啓用    "javax.crypto.NullCipher" should not be used for anything other than testing    javax.crypto.NullCipher 應該只用於測試    
啓用    "Lock" objects should not be "synchronized"    被鎖定的對象不該該被 synchronized 修飾    
啓用    "main" should not "throw" anything    main方法不該該拋出任何異常    
啓用    "Map.get" and value test should be replaced with single method call    須要同時獲取map的鍵值對時,應該使用單個的獲取方法    
啓用    "notifyAll" should be used    應該使用notifyAll方法喚醒全部休眠的進程    
啓用    "null" should not be used with "Optional"    Optional修飾的對象不該該被賦值爲null    
啓用    "Object.finalize()" should remain protected (versus public) when overriding    Object.finalize() 方法應該只有垃圾回收器才能夠調用    
啓用    "Object.wait(...)" and "Condition.await(...)" should be called inside a "while" loop    「Object.wait(…)」和「condition .wait(…)」應該在while循環中調用    
啓用    "Object.wait(...)" should never be called on objects that implement "java.util.concurrent.locks.Condition"    實現「java.util.concurrent.locks.Condition」的對 象不該該調用「Object.wait(…)」方法    
啓用    "Preconditions" and logging arguments should not require evaluation    「先決條件」和日誌參數不該該須要計算,換言之,在調用"Preconditions" 和 logging 方法時,參數應該是可肯定的    
啓用    "PreparedStatement" and "ResultSet" methods should be called with valid indices    應該使用有效的索引(>0)調用「PreparedStatement」和「ResultSet」方法,由於「PreparedStatement」和「ResultSet」方法的索引都是從1開始    
啓用    "private" methods called only by inner classes should be moved to those classes    只由內部類調用的「私有」方法應該放到這些類裏    
啓用    "public static" fields should be constant    「公共靜態」字段應該是常量    
是    "Random" objects should be reused    應該重用「隨機」對象    隨機數種子在建立一個random對象的時候生成,相同 的隨機數種子,產生相同隨機數的概率很是高
啓用    "read" and "readLine" return values should be used    「read」和「readLine」返回值應該被使用    
啓用    "read(byte[],int,int)" should be overridden    read(byte[],int,int)方法應該被重載    
啓用    "readObject" should not be "synchronized"    readObject 方法不該該被 同步修飾符(synchronized)修飾    
啓用    "readResolve" methods should be inheritable    「readResolve」方法應該是可繼承的,由於readResolve()容許在反序列化期間對於對象的狀態進行微調    
啓用    "ResultSet.isLast()" should not be used    不該該使用「ResultSet.isLast()」方法,由於.isLast()方法會將指針的指向移動到下一個元素上,從而可能致使空指針,而.next()方法則是先判斷下一個元素是否存在    
啓用    "runFinalizersOnExit" should not be called    不該該調用「runFinalizersOnExit」,由於runFinalizersOnExit()方法可能致使正在被其餘進程調用的對象被終止,是不安全的    
啓用    "ScheduledThreadPoolExecutor" should not have 0 core threads    ScheduledThreadPoolExecutor(任務調度進程池)的大小和 corePoolSize的一致,因此 核心進程的個數不能爲0    
啓用    "SecureRandom" seeds should not be predictable    「安全隨機數」種子不該該是可預測的    
啓用    "Serializable" inner classes of non-serializable classes should be "static"    序列化/反序列化方法應該是被static修飾符修飾的    
啓用    "SingleConnectionFactory" instances should be set to "reconnectOnException"    「SingleConnectionFactory」實例應該設置爲「reconnectOnException」,由於在不啓用reconnectOnException設置的狀況下使用SingleConnectionFactory將 在鏈接出錯時沒法自動恢復鏈接    
啓用    "StandardCharsets" constants should be preferred    應該首先考慮標準字符集(ISO_8859_一、US_ASCII、UTF_16 、UTF_16BE 、UTF_16LE 、UTF_8)    
啓用    "static" members should be accessed statically    靜態常量應該被靜態訪問    
啓用    "Stream" call chains should be simplified when possible    流的方法調用應當儘量的簡潔    
啓用    "Stream.peek" should be used with caution    .peek()方法主要用於debug,並且僅在對流內元素進行操做時,peek()纔會被調用,因此在使用時須要謹慎    
啓用    "StringBuilder" and "StringBuffer" should not be instantiated with a character    "StringBuilder" 和 "StringBuffer"不該該被單個字符實例化    
啓用    "super.finalize()" should be called at the end of "Object.finalize()" implementations    super.finalize()應該在Object.finalize()方法中最後一行被調用,防止系統資源衝突    
啓用    "switch" statements should have "default" clauses    switch()方法中須要用 default子句,控制除了case之外的其餘場景    
啓用    "switch" statements should have at least 3 "case" clauses    switch()方法至少須要有3個 case子句,case子句<=2的場景,用if...else便可    
啓用    "switch" statements should not contain non-case labels    「switch」語句不該該包含無case關鍵字的列舉狀況    
啓用    "switch" statements should not have too many "case" clauses    switch語句不該該包含太多(>30)的case子句,子句太多時,用map的性能會更高    
啓用    "Thread.run()" should not be called directly    Thread.run()方法不該該被直接調用,由於Thread.run()方法會致使代碼在當前進程中被執行    
啓用    "Thread.sleep" should not be used in tests    Thread.sleep()方法不該該在測試過程當中被調用    
啓用    "ThreadGroup" should not be used    ThreadGroup()不該該被調用    
啓用    "ThreadLocal.withInitial" should be preferred    應優先考慮ThreadLocal.withInitial()方法    
啓用    "Threads" should not be used where "Runnables" are expected    「線程」不該該使用在預期「可運行項」的地方    
啓用    "throws" declarations should not be superfluous    「throws」聲明不該該拋出多個異常    
啓用    "toArray" should be passed an array of the proper type    在沒有參數的狀況下,.toArray()方法將會返回一個 object,若用.toArray()方法來轉換固定類型的數組,須要將正確類型的參數傳入    
啓用    "toString()" and "clone()" methods should not return null    "toString()" 和 "clone()"方法,不該該返回null    
啓用    "toString()" should never be called on a String object    在String對象上不該該調用「toString()」    
啓用    "URL.hashCode" and "URL.equals" should be avoided    url的equals和hashCode方法均可能觸發名稱服務(一般是DNS)查找來解析主機名或IP地址。根據配置和網絡狀態,這可能須要很長時間,應該避免調用"URL.hashCode" 和 "URL.equals"    
啓用    "volatile" variables should not be used with compound operators    對被volatile修飾的變量不該該進行復合型操做符運 算(應該只進行原子運算)    
啓用    "wait" should not be called when multiple locks are held    當持有多個鎖時,不該調用「wait」    
啓用    "wait", "notify" and "notifyAll" should only be called when a lock is obviously held on an object    「wait」、「notify」和「notifyAll」只應在對象上明顯持有鎖時(如被synchronized修飾)調用    
啓用    "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held    若是在當前線程持有鎖時調用thread .sleep(…),可能會致使性能和可伸縮性問題,或者更糟的狀況是死鎖。因此當鎖被持有時,應該使用「wait(…)」而不是「Thread.sleep(…)」方法    
啓用    "write(byte[],int,int)" should be overridden    當直接子類化java.io.OutputStream 或者 java.io.FilterOutputStream時,由於不能每次傳遞一個byte的數據,「write(byte[],int,int)」方法應該被重寫    
啓用    "writeObject" should not be the only "synchronized" code in a class    「writeObject」不該該是類中惟一的「synchronized」修飾符修飾的方法    
啓用    A "for" loop update clause should move the counter in the right direction    「for」循環更新子句應該將計數器移動到正確的方向    
啓用    A "while" loop should be used instead of a "for" loop    當for循環中只定義了條件表達式,而且缺乏初始化和增量表達式時,應該使用while循環來增長可讀性    
啓用    A conditionally executed single line should be denoted by indentation    有if條件執行的單行應該用縮進表示(未添加{}時)    
啓用    A field should not duplicate the name of its containing class    字段不該重複其包含的類的名稱    
是    Abstract classes without fields should be converted to interfaces    沒有字段的抽象類應該轉換爲接口    接口是爲了暴露給外部,內部抽象類被繼承便可
啓用    Abstract methods should not be redundant    抽象方法不該該是多餘的    
啓用    Accessing Android external storage is security-sensitive    訪問Android外部存儲是安全敏感的    
啓用    AES encryption algorithm should be used with secured mode    AES加密算法應採用安全模式(ECB模式並不安全,不建議用ECB進行組合)    
啓用    All branches in a conditional structure should not have exactly the same implementation    條件結構(if...else/switch等)中不建議有相同操做的分支    
啓用    An iteration on a Collection should be performed on the type handled by the Collection    對集合的迭代應該是對集合所處理的類型執行    
啓用    Annotation repetitions should not be wrapped    不該該重複包裝註解    
啓用    Anonymous inner classes containing only one method should become lambdas    只包含一個方法的匿名內部類應該成爲lambdas    
啓用    Array designators "[]" should be located after the type in method signatures    數組指示符「[]」應該位於方法簽名中的類型以後    
啓用    Array designators "[]" should be on the type, not the variable    數組指示符「[]」應該位於類型後,而不是變量後    
啓用    Arrays should not be created for varargs parameters    不該該爲不定長參數參數建立數組    
啓用    Assertion arguments should be passed in the correct order    應該按照正確的順序傳遞斷言參數    
啓用    Assertions should be complete    斷言應該是完整的    
啓用    Asserts should not be used to check the parameters of a public method    斷言不該用於檢查公共方法的參數    
啓用    Assignments should not be made from within sub啓用expressions    不該該在子表達式中進行賦值    
啓用    Assignments should not be redundant    任務不該該是多餘的    
啓用    Authentication should not rely on insecure "PasswordEncoder"    身份驗證不該該依賴於不安全的「密碼編碼器」    
是    Basic authentication should not be used    不該該使用Basic身份認證方式    Basic 身份認證方式是當前最經常使用的方式,Base64編碼加密後,配合username+password能夠知足一般的需求
啓用    Blocks should be synchronized on "private final" fields    塊應該在「private final」修飾的字段上同步    
啓用    Boolean checks should not be inverted    不該該使用反轉布爾操做    
啓用    Boolean expressions should not be gratuitous    布爾表達式不該該是徹底不變的(應該有改變其值的操做)    
啓用    Boolean literals should not be redundant    不該該進行無心義的布爾計算(如表達式和true/false判等、表達式反轉等)    
啓用    Boxing and unboxing should not be immediately reversed    裝箱(建立int/Integer類型值的對象)和拆箱(將對象中原始值解出來)不該連續操做    
啓用    Broadcasting intents is security-sensitive    廣播意圖是不安全的    
啓用    Case insensitive string comparisons should be made without intermediate upper or lower casing    不區分大小寫的字符串比較應該在沒有中間大小寫轉化的狀況下進行    
啓用    Catches should be combined    相同代碼塊的Catches 異常操做應該合併    
啓用    Changing or bypassing accessibility is security啓用sensitive    更改或繞過可訪問性檢查是不安全的    
啓用    Child class fields should not shadow parent class fields    子類不該該有和父類的字段名相同的字段    
啓用    Child class methods named for parent class methods should be overrides    子類中重寫的與父類方法命名一致的方法,static修飾符等也要和父類保持一致    
啓用    Class names should comply with a naming convention    類名應該符合命名約定    
啓用    Class names should not shadow interfaces or superclasses    類名不該和他實現的接口或父類命名相同    
啓用    Class variable fields should not have public accessibility    類變量字段應該是私有的    
啓用    Classes extending java.lang.Thread should override the "run" method    擴展的 java.lang 線程應該是有重載的run()方法    
啓用    Classes from "sun.*" packages should not be used    "sun.*" packages 不該該被使用,幾乎老是由應該使用的Java API類包裝    
啓用    Classes named like "Exception" should extend "Exception" or a subclass    像「Exception」這樣命名的類應該繼承了 「Exception」或其子類,不然不符合清晰、交流式的命名規範    
啓用    Classes should not access their own subclasses during initialization    類在初始化期間不該該訪問它們本身的子類    
啓用    Classes should not be compared by name    類不該該按名稱進行比較    
啓用    Classes should not be empty    類不該該是空的    
啓用    Classes that override "clone" should be "Cloneable" and call "super.clone()"    重載了clone()方法的類應該是實現 Cloneable接口的,而且調用了 super.clone()方法    
啓用    Classes with only "static" methods should not be instantiated    只有靜態方法的類不該該被實例化    
啓用    Cognitive Complexity of methods should not be too high    方法的功能複雜度不該太高    
啓用    Collapsible "if" statements should be merged    應該合併沒有需分層的「if」語句    
啓用    Collection sizes and array length comparisons should make sense    集合大小和數組長度比較應該是有意義的    
啓用    Collection.isEmpty() should be used to test for emptiness    應該使用Collection.isEmpty()來判斷是否爲空    
啓用    Collections should not be passed as arguments to their own methods    集合不該該做爲參數傳遞給它們本身的方法    
啓用    Composed "@RequestMapping" variants should be preferred    應該首選組合的「@RequestMapping」變體(@GetMapping、@PostMapping)    
啓用    Conditionally executed blocks should be reachable    條件執行的塊應該都是能夠訪問(不能致使死鎖)    
啓用    Conditionals should start on new lines    條件句應該重新行開始(if...else.../if..else if.../if...)    
是    Configuring loggers is security-sensitive    配置日誌記錄器是不安全的    
啓用    Constant names should comply with a naming convention    常量名稱應該符合命名約定    
啓用    Constants should not be defined in interfaces    常量不該該在接口中定義    
啓用    Constructors should not be used to instantiate "String", "BigInteger", "BigDecimal" and primitive-wrapper classes    構造函數不該該用於實例化「String」、「BigInteger」、「BigDecimal」和原子類包裝    
啓用    Consumed Stream pipelines should not be reused    使用的流管道不該重用    
是    Controlling permissions is security-sensitive    權限控制是不安全的    有權限劃分控制,才能知足不一樣的用戶權限的不一樣,從而抵禦黑客攻擊
啓用    Cookie domains should be as narrow as possible    Cookie域設置應該儘量的詳細    
啓用    Creating cookies without the "secure" flag is security-sensitive    建立沒有「secure」標誌的cookie是不安全的    
啓用    Credentials should not be hard-coded    憑證不該該直接賦值(須要經過調用方法等方式去獲取)    
啓用    Cryptographic keys should not be too short    祕鑰不該該過短(對於Blowfish算法,密鑰至少128位長,對於RSA算法,密鑰至少2048位長。)    
啓用    Cryptographic RSA algorithms should always incorporate OAEP (Optimal Asymmetric Encryption Padding)    密碼RSA算法應該始終包含OAEP(最佳非對稱加密填充)    
啓用    Custom serialization method signatures should meet requirements    自定義序列化方法簽名應知足要求(做用域的限制等)    
啓用    Databases should be password啓用protected    數據庫應該有密碼保護    
啓用    Dead stores should be removed    死存儲的變量代碼應該被移除    
啓用    Declarations should use Java collection interfaces such as "List" rather than specific implementation classes such as "LinkedList"    類中字段聲明應該使用Java集合接口,如「List」「Set」    
啓用    Default EJB interceptors should be declared in "ejb-jar.xml"    缺省EJB攔截器應該在「EJB 啓用jar.xml」中聲明。    
啓用    Defined filters should be used    已定義的過濾器應該被調用    
啓用    Delivering code in production with debug features activated is security-sensitive    在生產環境中交付被激活的調試特性的代碼是不安全的    
啓用    Dependencies should not have "system" scope    依賴聲明中不該該包含system scope    
啓用    Deprecated "${pom}" properties should not be used    棄用的${pom}特性不該該再被使用    
啓用    Deprecated code should be removed    棄用的代碼應該被刪除    
啓用    Deprecated elements should have both the annotation and the Javadoc tag    被棄用的代碼塊應該添加@Deprecated註解以及標籤    
啓用    Deserializing objects from an untrusted source is security-sensitive    從不可信源反序列化對象是不安全的    
啓用    Deserializing with XMLDecoder is security-sensitive    反序列化XMLDecoder對象是不安全的    
啓用    Disabling Spring Security's CSRF protection is security-sensitive    禁用spring的跨域資源共享(CSRF)保護是不安全的    
啓用    Dissimilar primitive wrappers should not be used with the ternary operator without explicit casting    在沒有顯式強制轉換的狀況下,不該該將不一樣的基本類型與三元運算符一塊兒使用    
啓用    Double Brace Initialization should not be used    不該該使用雙花括號初始化    
啓用    Double-checked locking should not be used    不該該使用雙重檢查鎖定    
啓用    Empty arrays and collections should be returned instead of null    須要返回數組/集合的方法,應該返回空數組/集合,而不是null    
啓用    Empty statements should be removed    應該刪除空語句(如僅一個;)    
是    Enabling Cross-Origin Resource Sharing is security-sensitive    啓用跨域資源共享是不安全的    
啓用    Encrypting data is security-sensitive    (不具有隨機性的)加密數據是不安全的    
啓用    Enumeration should not be implemented    枚舉不該該像其餘接口同樣被實現,而複製後的迭代器是能夠被實現的    
啓用    Exception classes should be immutable    異常類應該是不可變的    
啓用    Exception should not be created without being thrown    建立的異常應該被拋出    
啓用    Exception types should not be tested using "instanceof" in catch blocks    不該該在 catch代碼塊中用instanceof對異常的類型進行判斷處理    
是    Exceptions should be either logged or rethrown but not both    異常應該被記錄或者拋出,但不能同時被記錄和拋出    存在經過日誌將異常打印,同時讓異常被其餘的進行捕獲的場景
啓用    Exceptions should not be thrown from servlet methods    不該該從servlet方法中拋出異常    
啓用    Exceptions should not be thrown in finally blocks    不該該在 finally中拋出異常    
啓用    Execution of the Garbage Collector should be triggered only by the JVM    垃圾回收器只能由JVM觸發    
啓用    Expanding archive files is security-sensitive    展開歸檔文檔是不安全的(應該驗證歸檔文件展開的路徑;不該展開到能夠展開存檔文件的根目錄以外;應用程序應該控制擴展數據的大小,以免成爲Zip炸彈攻擊的受害者)    
啓用    Expressions used in "assert" should not produce side effects    「斷言」中使用的表達式不該該須要計算(因爲assert語句在默認狀況下不被執行(斷言必須使用JVM標誌啓用),永遠不該該依賴於他們的解決方案來評估正確程序功能所需的任何邏輯。)    
啓用    Factory method injection should be used in "@Configuration" classes    當在@Configuration修飾的類中使用@Autowired時,依賴關係須要在類實例化前獲得解決,這可能會致使bean的早期初始化出問題,或者致使上下文查找不該該找到bean的位置。爲了不這個棘手的問題並優化上下文加載的方式,應該儘量晚地請求依賴項。這意味着對於僅在單個@Bean方法中使用的依賴項,使用參數注入而不是字段注入。    
啓用    Field names should comply with a naming convention    字段名應該符合命名約定(正則表達式)    
啓用    Fields in a "Serializable" class should either be transient or serializable    「可序列化」類中的字段應該是可轉換的或可序列化的    
啓用    Fields in non-serializable classes should not be "transient"    不可序列化的類中的字段不該該被"transient"關鍵字修飾    
啓用    Files opened in append mode should not be used with ObjectOutputStream    在append 模式下打開的文件不該該和ObjectOutputStream一塊兒使用    
啓用    Formatting SQL queries is security-sensitive    格式化SQL查詢是不安全的    
啓用    Future keywords should not be used as names    關鍵字不該該用做名稱,可能沒法被解析    
啓用    Generic exceptions should never be thrown    永遠不該該拋出泛型異常    
是    Generic wildcard types should not be used in return parameters    方法返回的參數類型不該該是泛型    能夠對於子類繼承的父類A和子類A1自己進行相同的操做,可是返回的類型不一樣,此處須要返回參數爲泛型
啓用    Getters and setters should access the expected fields    getter和setter方法應該訪問預期的字段    
啓用    Getters and setters should be synchronized in pairs    getter和setter應該成對同步    
啓用    Hashing data is security-sensitive    哈希數據是不安全的(爲了安全目的,只使用目前已知較強的哈希算法。徹底避免在安全上下文中使用MD5和SHA1之類的算法。)    
啓用    Hibernate should not update database schemas    Hibernate不該該更新數據庫模式(hibernate.hbm2ddl.auto只有在validate時纔可使用,不然可能致使數據庫的模式被更改)    
啓用    Identical expressions should not be used on both sides of a binary operator    不該該在二元操做符的兩邊使用相同的表達式    
啓用    IllegalMonitorStateException should not be caught    不該該捕獲非法的monitorstateexception異常    
啓用    Inappropriate "Collection" calls should not be made    不該該作不合適的Collection方法調用(當提供給Collection.remove()/Collection.contains()方法的對象的實際類型與集合實例化的declaredon類型不一致時,這些方法老是返回false或null)    
啓用    Inappropriate regular expressions should not be used    不該該使用不合適的正則表達式    
啓用    Inheritance tree of classes should not be too deep    類的繼承樹不該該太深(限制5層)    
啓用    Inner class calls to super class methods should be unambiguous    對超類方法的內部類的調用應該是明確的    
啓用    InputSteam.read() implementation should not return a signed byte    InputSteam.read()的實現不該該返回帶符號的字節(java文檔註明,InputSteam.read()方法的值字節必須是0到255範圍內的整數。若是因爲到達了流的末尾而沒有可用的字節,則返回值啓用1。)    
啓用    Instance methods should not write to "static" fields    「static 」字段不該該在實例方法中處理    
啓用    Interface names should comply with a naming convention    接口的命名應該符合命名規範(的正則表達式)    
啓用    Intermediate Stream methods should not be left unused    中間流方法不該該閒置,應該提供對應的終端操做(流操做有兩種類型:中間操做(返回另外一個流)和終端操做(返回比流更多的內容)。中間操做是惰性的,若是中間流操做的結果沒有提供給終端操做,那麼它就沒有任何做用)    
啓用    Ints and longs should not be shifted by zero or more than their number of bits-1    int和long類型數據的位移不該該>或者等於0    
啓用    Invalid "Date" values should not be used    不該使用無效的「日期」值(須要肯定year\month\day的有效取值範圍)    
啓用    Java 8 features should be preferred to Guava    Java 8特性應該優先於Guava特性(Guava特性修復了java7中一些缺乏的Api,在java8中,這些Api被修復)    
啓用    Java 8's "Files.exists" should not be used    java8中不該該使用"Files.exists"方法(exists方法在JDK 8中性能明顯較差,當用於檢查實際上不存在的文件時,會顯著下降應用程序的運行速度。)    
啓用    Jump statements should not be redundant    不該該有多餘的跳轉語句    
啓用    Jump statements should not occur in "finally" blocks    跳轉語句(break, continue, return, throw, goto)不該該出如今finally代碼塊中    
啓用    JUnit assertions should not be used in "run" methods    JUnit斷言不該該在「run」方法中使用    
啓用    JUnit framework methods should be declared properly    應該正確地聲明JUnit框架方法(命名要正確)    
啓用    JUnit rules should be used    應該使用JUnit規則(沒有被使用的任何測試類字段都不該該被定義)    
啓用    JUnit test cases should call super methods    JUnit測試用例應該調用super()方法    
啓用    Labels should not be used    Labels 不該該被使用    
啓用    Lambdas containing only one statement should not nest this statement in a block    只包含一條語句的Lambdas(匿名函數)不該該將此語句嵌套在塊中(無需用{})    
啓用    Lambdas should be replaced with method references    應該用方法引用替換Lambdas(匿名函數)    
啓用    LDAP connections should be authenticated    應該對LDAP鏈接進行身份驗證    
啓用    LDAP deserialization should be disabled    應該禁用LDAP反序列化    
啓用    Local variable and method parameter names should comply with a naming convention    局部變量和方法參數的名稱應該符合命名約定    
啓用    Local variables should not be declared and then immediately returned or thrown    不該該在聲明局部變量後,當即將變量返回或拋出    
啓用    Local variables should not shadow class fields    局部變量不該該和類字段同名    
啓用    Locks should be released    鎖應該被釋放    
啓用    Loggers should be named for their enclosing classes    日誌記錄器應該用他們的封閉類來命名    
啓用    Loop conditions should be true at least once    循環體至少須要被執行一次    
啓用    Loops should not be infinite    循環不該該是無限的    
啓用    Loops should not contain more than a single "break" or "continue" statement    循環應該只包含一個「break」或「continue」語句    
啓用    Loops with at most one iteration should be refactored    最多隻執行一次的循環應該被重構    
啓用    Map values should not be replaced unconditionally    不該該無條件的替換映射(Map)值    
啓用    Maps with keys that are enum values should be replaced with EnumMap    帶有enum值鍵的映射應該替換爲EnumMap    
啓用    Math operands should be cast before assignment    應該在數學計算以前,至少對一個操做數完成對最終類型的強制類型轉換    
啓用    Method names should comply with a naming convention    方法的命名應該知足命名規則    
啓用    Method overrides should not change contracts    方法重寫不該更改約定(超類方法參數若是被@Nullable、@CheckForNull、@NotNull、@NonNull和@NonNull修飾,則子類重寫的方法參數也應該有相應的限制)    
啓用    Method parameters, caught exceptions and foreach variables' initial values should not be ignored    方法參數、捕獲的異常和foreach變量的初始值不該該被忽略    
啓用    Methods "wait(...)", "notify()" and "notifyAll()" should not be called on Thread instances    方法」wait(…)」,「notify()」和「notifyAll()」不該該在線程實例上調用    
啓用    Methods and field names should not be the same or differ only by capitalization    類裏面的方法和字段名不該該徹底相同或者僅大小寫不一樣    
啓用    Methods and field names should not be the same or differ only by capitalization    在隨機整數生成中,不該該使用返回浮點值的「隨機」方法    
啓用    Methods returns should not be invariant    方法返回不該該是不變的    
啓用    Methods should not be empty    方法不該該是空的    
啓用    Methods should not be named "tostring", "hashcode" or "equal"    方法不該該被命名爲「tostring」、「hashcode」或「equal」    
啓用    Methods should not call same-class methods with incompatible "@Transactional" values    方法不該該調用具備不兼容的「@Transactional」值的同類方法    
啓用    Methods should not have identical implementations    兩個方法不該該有相同的實現    
啓用    Methods should not have too many parameters    方法不該該有太多的參數    
啓用    Methods should not return constants    方法不該該返回常量    
啓用    Min and max used in combination should not always return the same value    組合使用的Min和max不該該老是返回相同的值    
啓用    Modifiers should be declared in the correct order    修飾符應該按照正確的順序聲明    
啓用    Multiline blocks should be enclosed in curly braces    多行代碼塊應該用大括號括起來    
啓用    Multiple variables should not be declared on the same line    多個變量不該該在同一行中聲明    
啓用    Mutable fields should not be "public static"    可變字段不該該是「public static」    
啓用    Neither "Math.abs" nor negation should be used on numbers that could be "MIN_VALUE"    Math.abs 和邏輯非的運算不該該做用在能夠設置爲 MIN_VALUE 的數字上    
啓用    Neither DES (Data Encryption Standard) nor DESede (3DES) should be used    不該該使用DES(數據加密標準)或DESede (3DES)    
啓用    Nested "enum"s should not be declared static    嵌套的「枚舉」類型不該該聲明爲靜態的    
啓用    Nested blocks of code should not be left empty    嵌套的代碼塊不該該是空的    
啓用    Nested code blocks should not be used    不該該使用嵌套代碼塊    
啓用    Non-constructor methods should not have the same name as the enclosing class    非構造函數方法不該該具備與所包含類相同的名稱    
啓用    Non-primitive fields should not be "volatile    非基礎字段(數組、對象等)不該該被volatile 修飾符修飾    
啓用            
啓用    Non-public methods should not be "@Transactional"    不該該在非public方法上添加@Transactional註解    
啓用    Non-serializable classes should not be written    類應該都是可序列化的    
啓用    Non-serializable objects should not be stored in "HttpSession" objects    不可序列化的對象不該該存儲在「HttpSession」對象中    
啓用    Non-thread-safe fields should not be static    非線程安全字段不該該是靜態的    
啓用    Null checks should not be used with "instanceof"    判空檢查不該與「instanceof」一塊兒使用。    
啓用    Null pointers should not be dereferenced    不該該取消對空指針的引用    
啓用    Null should not be returned from a "Boolean" method    不該該從返回值爲「布爾」類型的方法返回Null    
啓用    Nullness of parameters should be guaranteed    應保證方法參數不爲空    
啓用    Objects should not be created only to "getClass"    對象不該該只爲了「getClass」方法建立(僅僅爲了調用getClass而建立對象是對內存和週期的浪費)    
啓用    Only static class initializers should be used    應該只使用靜態初始化方法    
啓用    Optional value should only be accessed after calling isPresent()    在調用get()方法以前,應該先判空處理    
啓用    Overrides should match their parent class methods in synchronization    子類重寫的方法應該與父類方法的同步保持一致    
啓用    Overriding methods should do more than simply call the same method in the super class    子類中重寫一個方法不該該只是爲了簡單的調用父類的同名方法    
啓用    Package declaration should match source file directory    包聲明應該匹配源文件目錄    
啓用    Package names should comply with a naming convention    包的名稱應該符合命名規則    
啓用    Packages containing only "package-info.java" should be removed    只包含"package啓用info.java" 包應該被刪除    
啓用    Parameters should be passed in the correct order    方法的參數應該按照正確的順序傳遞    
啓用    Parentheses should be removed from a single lambda input parameter when its type is inferred    僅帶單參數的lambda(匿名函數),應該將該參數的圓括號刪除    
啓用    Parsing should be used to convert "Strings" to primitives    可使用解析方法將String解析爲指望的基本類型    
啓用    Persistent entities should not be used as arguments of "@RequestMapping" methods    持久化實體不該該用做「@RequestMapping」方法的參數    
啓用    Primitive wrappers should not be instantiated only for "toString" or "compareTo" calls    應該使用基本包裝器類的靜態toString()或compare方法。    
啓用    Primitives should not be boxed just for "String" conversion    不該該爲了調用toString方法而將基本類型的數據進行類型轉換    
啓用    Printf-style format strings should be used correctly    Printf啓用style格式字符串應該被正確使用(Printf-style的字符串是在運行時解釋的,而不是由編譯器驗證的,因此它們可能包含致使建立錯誤字符串的錯誤)    
啓用    Printf-style format strings should not lead to unexpected behavior at runtime    Printf-style 格式字符串不該該在運行期間致使意外的操做發生    
啓用    Private fields only used as local variables in methods should become local variables    只在方法中用做局部變量的私有字段應該設置爲局部變量    
啓用    Public constants and fields initialized at declaration should be "static final" rather than merely "final"    在初始化時聲明的公共常量和字段應該是「static final」,而不只僅是「final」。    
啓用    Raw byte values should not be used in bitwise operations in combination with shifts    帶符號的原始字節值不該該進行位移操做    
啓用    Reading the Standard Input is security-sensitive    讀取標準輸入的數據是不安全的    
啓用    Receiving intents is security-sensitive    公開的接收器是不安全的    
啓用    Redundant casts should not be used    不該該使用冗餘類型轉換    
啓用    Redundant pairs of parentheses should be removed    應該刪除多餘的括號    
啓用    Reflection should not be used to check non-runtime annotations    反射不該用與檢查非運行時註解(只有已被賦予運行時保留策略的註釋纔可用於反射。使用其餘保留策略測試老是返回false)    
啓用    Related "if/else if" statements should not have the same condition    相關的if.../else if...代碼塊中不該該有相同的判斷條件    
啓用    Resources should be closed    (實現close - able接口或其超級接口autoclose - able的鏈接、流、文件和其餘)類在使用後須要關閉。必須在finally塊else中執行close調用,不然將沒法執行調用。    
啓用    Return of boolean expressions should not be wrapped into an "if-then-else" statement    布爾表達式的返回不該該封裝到「if-then-else」語句中    
啓用    Return values from functions without side effects should not be ignored    不該該忽略沒有反作用的函數的返回值(多是無效代碼,或者代碼的效果與預期不符)    
啓用    Return values should not be ignored when they contain the operation status code    不該該忽略返回值中包含的操做狀態代碼    
啓用    Sections of code should not be commented out    不該該保留被註釋的代碼    
啓用    Sending emails is security-sensitive    代碼中發送電子郵件是不安全的    
啓用    Servlets should not have mutable instance fields    Servlets實例中不該該包含可變的字段    
啓用    Setting JavaBean properties is security啓用sensitive    設置javaBean屬性是不安全的    
啓用    Short-circuit logic should be used in boolean contexts    短路邏輯應該在布爾上下文中使用    
啓用    Silly bit operations should not be performed    有些可預期獲得結果的位操做(如&啓用1獲得原始值)是不須要執行的    
啓用    Silly equality checks should not be made    一些對等檢查是不須要作的(不一樣類型的判等、兩個數組的判等)    
啓用    Silly math should not be performed    一些可預測結果的數學運算不須要作(如x%1)    
啓用    SMTP SSL connection should check server identity    SMTP SSL鏈接應該檢查服務器標識    
啓用    Source files should not have any duplicated blocks    原文件中不該該存在重複的塊    
啓用    Standard outputs should not be used directly to log anything    應該使用日誌程序記錄輸出內容(便於檢索    
啓用    Static fields should not be updated in constructors    不該該在構造函數中更新靜態的字段    
啓用    Static non-final field names should comply with a naming convention    被static修飾(但未被final修飾)的字段,命名應該符合命名規範    
啓用    String function use should be optimized for single characters    字符串函數(如indexOf(「」))的使用應該優化爲單個字符    
啓用    String literals should not be duplicated    字符串文字不該該重複    
啓用    String offset-based methods should be preferred for finding substrings from offsets    基於字符串偏移量的方法才應該是從偏移量中尋找子字符串的首選方法    
啓用    String.valueOf() should not be appended to a String    valueof()不該該被附加到字符串中    
啓用    Strings and Boxed types should be compared using "equals()"    字符串內容以及數據類型的比較應該使用equals()方法    
啓用    Strings should not be concatenated using '+' in a loop    字符串在遍歷過程當中不該該經過"+"號來進行擴展(應該使用append())    
啓用    Struts validation forms should have unique names    Struts驗證表單應該名稱唯一    
啓用    Subclasses that add fields should override "equals"    父類中包含equals()方法,添加了字段的子類中須要重寫equals()方法    
啓用    Switch cases should end with an unconditional "break" statement    Switch case應該以無條件的「break」語句結束    
啓用    Synchronization should not be based on Strings or boxed primitives    同步不該該基於字符串或基礎類型的數據    
啓用    Synchronized classes Vector, Hashtable, Stack and StringBuffer should not be used    不該該使用Synchronized 修飾類向量、散列表、堆棧和StringBuffer    
啓用    Ternary operators should not be nested    三元式運算不該該嵌套    
啓用    TestCases should contain tests    測試用例文件中應該包含測試方法    
啓用    Tests should include assertions    測試應該包含斷言(該條規則支持自擴展)    
啓用    Tests should not be ignored    不該該跳過測試    
啓用    The default unnamed package should not be used    不該該使用默認的未命名包    
啓用    The diamond operator ("<>") should be used    應該使用diamond操做符(「<>」)(沒必要在聲明和構造函數中都聲明List的類型,可使用<>簡化構造函數聲明,編譯器將推斷出類型。)    
啓用    The non-serializable super class of a "Serializable" class should have a no-argument constructor    可序列化類的不可序列化超類應該包含無參的構造函數    
啓用    The Object.finalize() method should not be called    不該該調用Object.finalize()方法(Object.finalize()方法應該由垃圾回收器調用)    
啓用    The Object.finalize() method should not be overriden    Object.finalize()不該該被重載(應該只由垃圾回收器調用)    
啓用    The signature of "finalize()" should match that of "Object.finalize()"    「finalize()」的簽名應該與「Object.finalize()」的簽名匹配(Object.finalize()方法應該由垃圾回收器調用,其餘方法不該該命名爲finalize)    
啓用    The value returned from a stream read should be checked    應該檢查從流讀取的返回值的長度是否大於0(不能保證流返回的不是0字節)    
啓用    Throwable and Error should not be caught    Throwable 和 Error 不該該被捕獲(Throwable 是全部異常的超類, Error是全部錯誤的超類,程序捕捉到也沒法處理)    
啓用    Throwable.printStackTrace(...) should not be called    printstacktrace(…)不該該被調用(默認狀況下,printstacktrace(…)將一個Throwable及其堆棧信息打印到某個流,這可能會無心中暴露敏感信息)    
啓用    Track uses of "FIXME" tags    跟蹤「FIXME」標籤的使用(FIXME標記一般用於標記懷疑有bug的地方,可是開發人員但願稍後處理這些地方。)    
啓用    Track uses of "TODO" tags    跟蹤「TODO」標籤    
啓用    TrustManagers should not blindly accept any certificates    TrustManagers(信託管理) 不能盲目的接受任何證書    
啓用    Try-catch blocks should not be nested    不該該嵌套的使用try-catch代碼塊    
啓用    Try-with-resources should be used    應該使用try-with啓用resources 結構(代替try-finally結構)    
啓用    Two branches in a conditional structure should not have exactly the same implementation    (switch啓用case/if...else if/if...else)條件結構中的兩個分支不該該具備徹底相同的實現    
啓用    Type parameter names should comply with a naming convention    類型參數名稱應該符合命名約定    
啓用    Unary prefix operators should not be repeated    不該該重複使用一元表達式的前綴操做符(針對於「!, ~, 啓用, +」)    
啓用    Unnecessary imports should be removed    應該刪除沒必要要的import    
啓用    Untrusted XML should be parsed with a local, static DTD    不可信的XML應該使用本地靜態DTD進行解析    
啓用    Unused "private" classes should be removed    應該刪除未使用的private類(未使用的私有類屬於死代碼)    
啓用    Unused "private" fields should be removed    未使用的 private字段應該被刪除(死代碼應該被處理)    
啓用    Unused "private" methods should be removed    未使用的private方法應該被刪除(死代碼應該被清理)    
啓用    Unused labels should be removed    未使用的標籤應該被刪除    
啓用    Unused local variables should be removed    未使用的局部變量應該被刪除    
啓用    Unused method parameters should be removed    方法中未使用的參數應該被刪除    
啓用    Unused type parameters should be removed    未使用的方法返回參數類型應該被刪除    
啓用    URIs should not be hardcoded    URI永遠不該該硬編碼,應該用可定製的參數替換它,保證代碼的可移植性(此外,即便動態獲取URI的元素,若是路徑分隔符是硬代碼,那麼可移植性仍然是有限的)    
啓用    Using command line arguments is security-sensitive    使用命令行參數是不安全的    
啓用    Using environment variables is security-sensitive    使用環境變量是不安全的    
啓用    Using hardcoded IP addresses is security-sensitive    硬編碼(直接編碼)IP地址是不安全的    
啓用    Using non-standard cryptographic algorithms is security-sensitive    使用非標準的密碼編碼算法是不安全的    
啓用    Using pseudorandom number generators (PRNGs) is security-sensitive    使用僞隨機數生成器是不安全的(肯定的算法產生的隨機數都是僞隨機數,很容易被黑客獲取seed從而破解)    
改成提醒    Using regular expressions is security-sensitive    使用正則表達式是不安全的(影響性能)    
啓用    Using Sockets is security-sensitive    (直接)使用套接字是不安全的    
啓用    Using unsafe Jackson deserialization configuration is security-sensitive    不該該使用不安全的JACKSON反序列化方法(若是可能,使用@JsonTypeInfo(use = Id. name)代替@JsonTypeInfo(use = Id. class)或@JsonTypeInfo(use = Id. MINIMAL_CLASS),所以須要使用@JsonTypeName和@JsonSubTypes註解)    
啓用    Utility classes should not have public constructors    Utility 是靜態類,不能被實例化,就算擴展,也不該該有公共的構造函數    
啓用    Validating SSL/TLS connections is security-sensitive    驗證SSL/TLS連接是不安全的(SSL/TLS協議加密網絡鏈接,服務器一般提供一個數字證書來證實其身份。接受全部SSL/TLScertificates會使應用程序容易受到中間人攻擊(Man啓用in啓用the啓用middle attack, MITM)的攻擊。)    
啓用    Value-based classes should not be used for locking    基於值的類不該該用於鎖定(基於值的類只爲了做爲值的包裝器,沒有構造函數,經過工廠化方法實例化,不會指定返回實例的標識)    
啓用    Values should not be uselessly incremented    值不該該毫無心義的遞增    
啓用    Variables should not be self-assigned    變量不該該自賦值    
啓用    Weak SSL protocols should not be used    不該該使用弱SSL協議    
啓用    Web applications should not have a "main" method    web應用不該該有main()方法    
啓用    Week Year ("YYYY") should not be used for date formatting    日期格式不該使用Week Year ("YYYY") (由於存在一週中跨年的狀況)    
啓用    Writing cookies is security-sensitive    編寫cookies是不安全的(cookie應該只用於管理用戶會話。最佳實踐是將全部與用戶相關的信息保存在服務器端,並將它們連接到用戶會話,而不是將它們發送到客戶機)    
啓用    XML transformers should be secured    XML 轉換程序應該受到保護    
啓用    Zero should not be a possible denominator    0不該該被做爲分母    
相關文章
相關標籤/搜索