Create custom rules Java

Hello everyone,

I’m quite new to all things Sonarqube and I could use some help. I’d like to be able to write custom rules for my projects but apart from the simple Sonar tutorial : sonar-java/ at master · SonarSource/sonar-java · GitHub
I can’t find any documentations and such that explain concretely how these libraries work.

I admit that the tuto was not enough for me to be autonomous on these rules…
If someone would have a doc, a video or whatever, information that will allow me to write rules by myself I would be grateful.

Thank you for your help,


a good starting point is to look at the sources of Sonar Java

and see how it’s done / search for rules with similar functionality



Thank you @Rebse for your answer,

I have not been able to make any progress on this subject since my post because I admit that it did not help me much.
Indeed I would be obliged to create only precise and personalized rules. I’m not sure that just reading rules helps me a lot.

If ever there are people much more qualified than me on the creation of custom rules I’m a taker because I find it quite complicated to take in hand :(.


Hi Elio,

Feel free to create new threads with specific questions. Include what you’re trying to accomplish, what you’ve tried & what the results were.