Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.

prioritymessagerefname_value
3Avoid making DML operations in Apex class constructor or initializers
    3Avoid directly accessing Trigger.old and Trigger.new
    • version: 2.0
    • xpath:
    3Hardcoding Id's is bound to break when changing environments.
      3Use of non existent annotations will lead to broken Apex code which will not compile in the future.
        3Avoid empty catch blocks
        • version: 2.0
        • allowCommentedBlocks: false
        • allowExceptionNameRegex: ^(ignored|expected)$
        • xpath:
        3Avoid empty 'if' statements
        • version: 2.0
        • xpath:
        3Avoid empty block statements.
        • version: 2.0
        • reportEmptyPrivateNoArgConstructor: true
        • reportEmptyVirtualMethod: true
        • xpath:
        3Avoid empty try or finally blocks
        • version: 2.0
        • xpath:
        3Avoid empty 'while' statements
        • version: 2.0
        • xpath:
        3AuraEnabled getter must be public or global if is referenced in Lightning components
          3Classes should not have non-constructor methods with the same name as the class
            3Ensure you override both equals() and hashCode()
              3Test methods must be in test classes
              • version: 2.0
              • xpath: