Hi @obusorna_k,
This post has some pointers that will get you started.
The first step, writing a custom Roslyn analyzer, has nothing to do with SonarQube. There are a lot of resources and examples on the web to help you. If you have any questions about that part, I’d suggest asking in a general forum like StackOverflow.