All Collections
Rule documentation
Naming conventions
Naming conventions for Apex variables
Naming conventions for Apex variables

Keep your variable names consistent, easier to read and maintain.

Lorenzo Frattini avatar
Written by Lorenzo Frattini
Updated over a week ago

Rationale

Naming conventions promote consistency in your app and make the code easier to read and understand.

Scope

  • All fields declared within Apex classes

  • All variables declared within Apex methods

  • All variables declared within Apex triggers

Configuration

  • Pattern for variables. Use a regular expression to define the validation pattern for your variables names.

  • Hint for variables. Add a hint to be displayed when a detection on a variable is flagged, in order to give developers a tangible example of a name that suits naming convention. (Warning: the hint is not validated).

  • Pattern for constants. Use a regular expression to define the validation pattern for your constants (constants are variable with a static final modifier)

  • Hint for constants. Add a hint to be displayed when a detection on a constant is flagged, in order to give developers a tangible example of a name that suits naming convention. (Warning: the hint is not validated).

Did this answer your question?