Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Writing custom rules in Java via a SonarQube plugin
  2. Adding XPath rules directly through the SonarQube web interface

Note that the first way must be preferred when available because the support of XPath will be eventually droppedJava API, if available, will be more fully-featured than what's available for XPath, and is generally preferable.

Note

Before implementing a new coding rule, you should consider whether it is specific to your own context or might benefit others. If it might benefit others, you can propose them on the developer list. If the SonarQube team find your proposed rules interesting, they may be implemented directly in the related language plugin. It means less maintenance for you, and benefit to others.

...

SonarQube provides a quick and easy way to add new coding rules directly via the web interface for certain languages (C/C++, C#, CobolCOBOL, Flex, Java, JavaScript, PL/I, PL/SQL, Python and VB.NET).

...