How to write custom rule for pl/sql with sonarqube?

Hi all,
How to write custom rule for pl/sql with sonarqube. Example:Is there a ID column in the table?
I created AST but I couldn’t write xpath query.

Hello @anilakuzum ,

In this link → Adding coding rules, you can find the documentation describing how to write and validate an XPath Rule using SSLR Toolkit.

I created AST but I couldn’t write xpath query.

You can write your XPath query in “XPath Query” text box at the bottom of the SSLR window and then click on “Evaluate XPath” to validate your rule on the code sample that you have provided in the “Source Code” text box (see screenshot below).

Knowing the XPath language is the only prerequisite for using the SSLR (there are a lot of tutorials on XPath online for help).

I hope this helps!

Best Regards
Mary

Thank you for answer