Table of Contents
Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Salesforce Platform server, in conjunction with calls to the API.
Language Info for Apex
- Since PMD 5.5.0
- Implementation:
ApexLanguageModule
- Id: apex
- PMD: ✔️
- CPD: ✔️
Metrics framework
In order to use code metrics in Apex, use the metrics constants in ApexMetrics
,
together with MetricsUtil
.
Multifile Analysis
Integration happens in ApexMultifileAnalysis
. It uses
ApexLink. For detailed information, see also Apexlink POC #2830.
Used for rule UnusedMethod
Language Properties
Parser
We use Jorje, the Apex parsers that is shipped within the Apex Language Server. This is part of the Salesforce Extensions for VS Code.
We take the binary from https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex/out and provide it as a maven dependency (see pmd-apex-jorje).