PMD rules
The following list includes all the PMD rules that are checked by Quality Clouds.
- "System.debug" first parameter has to be Logging level
- Accessing endpoints over unencrypted http should be avoided
- Access permissions should be checked before a SOQL/SOSL/DML operation
- All Apex classes should have at least one test class
- Apex Assertions Should Include Message
- Apex Unit Test Method Should Have "@IsTest" Annotation
- Apex unit tests should include at least one assertion
- Apex unit tests should not use @isTest(seeAllData=true)
- Avoid Approval Operation In Loop
- Avoid assignments in operands
- Avoid Async scheduling or queueing Operation In Loop.
- Avoid classes with too many fields
- Avoid classes with too many public methods
- Avoid constructors with excessive Lines of Code count
- Avoid creating deeply nested if-then statements
- Avoid declaring integers over 15 digits
- Avoid declaring multiple variables in a single line
- Avoid directly accessing Trigger.old and Trigger.new
- Avoid DML statements inside loops
- Avoid empty block statements
- Avoid empty Catch Block
- Avoid Empty If Statements
- Avoid empty try or finally blocks
- Avoid empty while statements
- Avoid excessive class file lengths
- Avoid excessive cyclomatic complexity
- Avoid excessive standard cyclomatic complexity
- Avoid functions with inconsistent return types
- Avoid hardcoded credentials used in requests to an endpoint
- Avoid hardcoding IDs
- Avoid implementing business logic in triggers
- Avoid Messaging Operation In Loop
- Avoid methods with excessive Lines of Code count
- Avoid Non Existent Annotations
- Avoid processing unescaped URL parameters
- Avoid return statements in if blocks
- Avoid SOQL inside loops
- Avoid Sosl calls within loops
- Avoid System.debug and Configuration.disableTriggerCRUDSecurity()
- Avoid trailing commas in object or array literals
- Avoid types with excessive Lines of Code count
- Avoid unintended global variables
- Avoid unintended modification of variables outside loops
- Avoid unnecessary code blocks
- Avoid unnecessary parenthesis
- Avoid use of the "==" operator
- Avoid using "for" statements without using surrounding braces
- Avoid using "while" statements without using braces to surround the code block
- Avoid using "while" statements without using curly braces
- Avoid using DML operations in Apex class constructor/init method
- Avoid using for statements without using curly braces
- Avoid using if...else statements without using curly braces
- Avoid using if..else statements without using surrounding braces
- Avoid using if statements without using braces to surround the code block
- Avoid using if statements without using curly braces
- Avoid using the ParseInt function without an explicit base parameter
- Avoid using the with keyword
- Avoid using untrusted / unescaped variables in DML queries
- Calls to addError with disabled escaping should be avoided
- Classes should explicitly declare a sharing mode if DML methods are used
- Class names should always begin with an upper case character
- Cognitive Complexity
- Eagerly Loaded Describe SObject Result
- Field Declarations Should Be At Start
- Field Naming Conventions
- Final variables should be fully capitalized and non-final variables should not include underscores
- Formal Parameter Naming Conventions
- Inaccessible Aura Enabled Getter
- Local Variable Naming Conventions
- Method names should always begin with a lower case character, and should not contain underscores
- Method Naming Conventions
- Methods with numerous parameters should not be used
- Missing ApexDoc @description
- Missing ApexDoc comment
- Non-constructor methods should not have the same name as the enclosing class
- Override Both Equals And Hashcode
- PMD - Apex Class rules
- PMD - Apex Trigger rules
- PMD - Lightning rules
- Property Naming Conventions
- Randomly generated IVs and keys should be used for Crypto calls
- Redirects to user-controlled locations should be avoided
- Test Methods Must Be In Test Classes
- The Global modifier should be avoided
- Unused Local Variable
- Variable names should start with a lowercase character
- Variables should start with a lowercase character
PMD Copyright
This product includes software developed in part by support from the Defense Advanced Research Project Agency (DARPA).