rule | Description | url | kpi | example |
---|---|---|---|---|
ApexUnitTestClassShouldHaveAsserts | Apex unit tests should System.assert() or assertEquals() or assertNotEquals() | https://pmd.github.io/latest/pmd_rules_apex_bestpractices.html#apexunittestclassshouldhaveasserts | Maintainability | |
ApexUnitTestMethodShouldHaveIsTestAnnotation | Apex test methods should have @isTest annotation. | https://pmd.github.io/latest/pmd_rules_apex_bestpractices.html#apexunittestmethodshouldhaveistestannotation | Maintainability | |
ApexUnitTestShouldNotUseSeeAllDataTrue | Apex unit tests should not use @isTest(seeAllData = true) | https://pmd.github.io/latest/pmd_rules_apex_bestpractices.html#apexunittestshouldnotuseseealldatatrue | Maintainability | |
AvoidGlobalModifier | Avoid using global modifier | https://pmd.github.io/latest/pmd_rules_apex_bestpractices.html#avoidglobalmodifier | Maintainability | |
AvoidLogicInTrigger | Avoid logic in triggers | https://pmd.github.io/latest/pmd_rules_apex_bestpractices.html#avoidlogicintrigger | Maintainability | |
DebugsShouldUseLoggingLevel | Calls to System.debug should specify a logging level. | https://pmd.github.io/latest/pmd_rules_apex_bestpractices.html#debugsshoulduselogginglevel | Maintainability | |
UnusedLocalVariable | Variable ''{0}'' defined but not used | https://pmd.github.io/latest/pmd_rules_apex_bestpractices.html#unusedlocalvariable | Maintainability | |
AvoidDeeplyNestedIfStmts | Avoid creating deeply nested if-then statements since they are harder to read and error-prone to maintain. | https://pmd.github.io/latest/pmd_rules_apex_design.html#avoiddeeplynestedifstmts | Maintainability | _x000D_ public class Foo {_x000D_ public void bar(Integer x, Integer y, Integer z) {_x000D_ if (x>y) {_x000D_ if (y>z) {_x000D_ if (z==x) {_x000D_ // !! too deep_x000D_ }_x000D_ }_x000D_ }_x000D_ }_x000D_ }_x000D_ |
AvoidDirectAccessTriggerMap | Avoid directly accessing Trigger.old and Trigger.new as it can lead to a bug. Triggers should be bulkified and iterate through the map to handle the actions for each item separately. | https://pmd.github.io/latest/pmd_rules_apex_errorprone.html#avoiddirectaccesstriggermap | Maintainability | |
AvoidNonExistentAnnotations | Apex supported non existent annotations for legacy reasons._x000D_ In the future, use of such non-existent annotations could result in broken apex code that will not compile._x000D_ This will prevent users of garbage annotations from being able to use legitimate annotations added to Apex in the future._x000D_ A full list of supported annotations can be found at https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation.htm | https://pmd.github.io/latest/pmd_rules_apex_errorprone.html#avoidnonexistentannotations | Maintainability |
1 bis 10 von 16 Einträgen