Contents
What are the apex rules for debug statements?
AvoidDebugStatements: Debug statements contribute to longer transactions and consume Apex CPU time even when debug logs… AvoidDmlStatementsInLoops: Deprecated Avoid DML statements inside loops to avoid hitting the DML governor limit.
Which is the best rule to avoid in apex?
AvoidDeeplyNestedIfStmts: Avoid creating deeply nested if-then statements since they are harder to read and error-prone to … CognitiveComplexity: Methods that are highly complex are difficult to read and more costly to maintain.
What are the rules for onedeclarationperline in apex?
OneDeclarationPerLine: Apex allows the use of several variables declaration of the same type on one line. However, it ca… PropertyNamingConventions: Configurable naming conventions for property declarations. This rule reports property… VariableNamingConventions: Deprecated A variable naming conventions rule – customize this to your liking.
How are apex rules related to code documentation?
Rules that are related to code documentation. ApexDoc: This rule validates that: ApexDoc comments are present for classes, methods, and properties th… Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.
Are there any side effects to using DML in apex?
ApexCSRF: Having DML operations in Apex class constructor or initializers can have unexpected side effects:… AvoidDirectAccessTriggerMap: Avoid directly accessing Trigger.old and Trigger.new as it can lead to a bug. Triggers should be …
What’s the difference between empty block and emptyifstmt?
EmptyIfStmt: Empty If Statement finds instances where a condition is checked but nothing is done about it. EmptyStatementBlock: Empty block statements serve no purpose and should be removed. EmptyTryOrFinallyBlock: Avoid empty try or finally blocks – what’s the point?