Skip to content

Latest commit

 

History

History
75 lines (53 loc) · 1.61 KB

File metadata and controls

75 lines (53 loc) · 1.61 KB

ApexClass

An Apex class name must be PascalCase and use a correct Suffix

Field: Name
Regex: ^([A-Z][A-Za-z0-9_]*(Controller|CallIn|CallOut|Test|Helper|Mapping|Mock|TriggerHandler|Wrapper|Batchable|Queuable|Schedulable|EntityManager|ServiceManager|DataManager))|(TestDataFactory|Constant)$

Example

  • ActivityTimelineController
  • ActivityTimelineControllerTest
  • RetrieveInteractionsMapper
  • RetrieveInteractionsMock

An ApexClass must follow the best practices

Field: Body

Example

  • No DML in loop
  • Optimize SOQL with related lists
  • No Hardcoded values

An ApexClass must have a Description

Field: Body.description

Example

/** 
 * BoatDataService exposes utilities to manipulate data related to boat
 * @author "John Doe"
 * @date 25/04/2023
**/
public with sharing class BoatDataService {
    public static final String LENGTH_TYPE = 'Length'; 

    @AuraEnabled(cacheable=true)
    public static List<Boat__c> getBoats(String boatTypeId) {
    }
}

An ApexClass must have an author

Field: Body.author

Example

/** 
 * BoatDataService exposes utilities to manipulate data related to boat
 * @author "John Doe"
 * @date 25/04/2023
**/
public with sharing class BoatDataService {
    public static final String LENGTH_TYPE = 'Length'; 

    @AuraEnabled(cacheable=true)
    public static List<Boat__c> getBoats(String boatTypeId) {
    }
}

Apex variables must be camelCase

Field: SymbolTable.variables
Regex: ^[a-z][A-Za-z0-9]*$

Apex methods must be camelCase

Field: SymbolTable.methods
Regex: ^[a-z][A-Za-z0-9]*$