GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing docs.pmd-code.org — Code Style | PMD Source Code Analyzer
Release date: 27-November-2026
Code StyleRules which enforce a specific coding style.
Table of ContentsAnnotationsNamingConventionsSince: PMD 7.17.0 Priority: Medium (3) Apex, while case-insensitive, benefits from a consistent code style to improve readability and maintainability. Enforcing PascalCase for annotations aligns with the established conventions and reduces ambiguity - promoting a unified coding standard. This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.AnnotationsNamingConventionsRule Example(s): Use this rule by referencing it: ClassNamingConventionsSince: PMD 5.5.0 Priority: High (1) Configurable naming conventions for type declarations. This rule reports type declarations which do not match the regex that applies to their specific kind (e.g. enum or interface). Each regex can be configured through properties. By default this rule uses the standard Apex naming convention (Pascal case). This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.ClassNamingConventionsRule Example(s): This rule has the following properties:
Use this rule with the default properties by just referencing it: Use this rule and customize it: FieldDeclarationsShouldBeAtStartSince: PMD 6.23.0 Priority: Medium (3) Field declarations should appear before method declarations within a class. Note: Since PMD 7.21.0, properties are ignored. This means that fields can appear before or after properties (or fields and properties can be mixed) as long as all fields are placed before the first method declaration. This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FieldDeclarationsShouldBeAtStartRule Example(s): Use this rule by referencing it: FieldNamingConventionsSince: PMD 6.15.0 Priority: High (1) Configurable naming conventions for field declarations. This rule reports variable declarations which do not match the regex that applies to their specific kind —e.g. constants (static final), static field, final field. Each regex can be configured through properties. By default this rule uses the standard Apex naming convention (Camel case). This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FieldNamingConventionsRule Example(s): This rule has the following properties:
Use this rule with the default properties by just referencing it: Use this rule and customize it: ForLoopsMustUseBracesSince: PMD 5.6.0 Priority: Medium (3) Avoid using ‘for’ statements without using surrounding braces. If the code formatting or indentation is lost then it becomes difficult to separate the code being controlled from the rest. This rule is defined by the following XPath expression: Example(s): Use this rule by referencing it: FormalParameterNamingConventionsSince: PMD 6.15.0 Priority: High (1) Configurable naming conventions for formal parameters of methods. This rule reports formal parameters which do not match the regex that applies to their specific kind (e.g. method parameter, or final method parameter). Each regex can be configured through properties. By default this rule uses the standard Apex naming convention (Camel case). This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FormalParameterNamingConventionsRule Example(s): This rule has the following properties:
Use this rule with the default properties by just referencing it: Use this rule and customize it: IfElseStmtsMustUseBracesSince: PMD 5.6.0 Priority: Medium (3) Avoid using if..else statements without using surrounding braces. If the code formatting or indentation is lost then it becomes difficult to separate the code being controlled from the rest. This rule is defined by the following XPath expression: Example(s): Use this rule by referencing it: IfStmtsMustUseBracesSince: PMD 5.6.0 Priority: Medium (3) Avoid using if statements without using braces to surround the code block. If the code formatting or indentation is lost then it becomes difficult to separate the code being controlled from the rest. This rule is defined by the following XPath expression: Example(s): Use this rule by referencing it: LocalVariableNamingConventionsSince: PMD 6.15.0 Priority: High (1) Configurable naming conventions for local variable declarations. This rule reports variable declarations which do not match the regex that applies to their specific kind (e.g. local variable, or final local variable). Each regex can be configured through properties. By default this rule uses the standard Apex naming convention (Camel case). This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.LocalVariableNamingConventionsRule Example(s): This rule has the following properties:
Use this rule with the default properties by just referencing it: Use this rule and customize it: MethodNamingConventionsSince: PMD 5.5.0 Priority: High (1) Configurable naming conventions for method declarations. This rule reports method declarations which do not match the regex that applies to their specific kind (e.g. static method, or test method). Each regex can be configured through properties. By default this rule uses the standard Apex naming convention (Camel case). This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.MethodNamingConventionsRule Example(s): This rule has the following properties:
Use this rule with the default properties by just referencing it: Use this rule and customize it: OneDeclarationPerLineSince: PMD 6.7.0 Priority: High (1) Apex allows the use of several variables declaration of the same type on one line. However, it can lead to quite messy code. This rule looks for several declarations on the same line. This rule is defined by the following XPath expression: Example(s): This rule has the following properties:
Use this rule with the default properties by just referencing it: Use this rule and customize it: PropertyNamingConventionsSince: PMD 6.15.0 Priority: High (1) Configurable naming conventions for property declarations. This rule reports property declarations which do not match the regex that applies to their specific kind (e.g. static property, or instance property). Each regex can be configured through properties. By default this rule uses the standard Apex naming convention (Camel case). This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.PropertyNamingConventionsRule Example(s): This rule has the following properties:
Use this rule with the default properties by just referencing it: Use this rule and customize it: WhileLoopsMustUseBracesSince: PMD 5.6.0 Priority: Medium (3) Avoid using ‘while’ statements without using braces to surround the code block. If the code formatting or indentation is lost then it becomes difficult to separate the code being controlled from the rest. This rule is defined by the following XPath expression: Example(s): Use this rule by referencing it: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |