-
Notifications
You must be signed in to change notification settings - Fork 20
Home
Clément Fournier edited this page May 31, 2019
·
18 revisions
Welcome to the pmd-designer wiki!
The rule designer is both a way to inspect the tree on which PMD rules run on, and to write XPath rules in an integrated manner. This page describes the features that enable this.

You can enter source code in the middle zone.
- Make sure to select the correct language and version for your source code with the cog icon
⚙on the top! - If the source is valid using this setting, the tree to the right will update to display the AST of the code
- When selecting a node, the left panel updates with information about a node
There are several ways to focus a node for inspection:
- From the tree view: just click on an item
- From the crumb bar: the crumb bar below the code area shows the ancestors of the currently selected node, and is empty if you have no selection:

- From the source code: maintain CTRL for a second until the code area becomes mostly blue. Then, each node you hover over on the code area will be selected automatically. Example:

The left panel displays the following information:
- XPath attributes: this basically are all the attributes available in XPath queries. Those attributes are wrappers around a Java getter, so you can obtain documentation on the relevant Javadoc (that's not yet integrated into the designer)
- Metrics: for nodes that support it, the values of metrics are displayed in this panel
- Scopes: This is java specific and displays some representation of the symbol table. You mostly don't need it. If you select eg a variable id, its usages are highlighted automatically:
