0

I am using SonarQube for Java rules. I created custom rules using sonarqube UI -> Rules -> Java -> Template -> Shows Templates Only

I am able to create rules using this for java.

I want same for .Net/C# projects also. How to get that.

enter image description here

sorab
  • 321
  • 1
  • 4
  • 15
  • Create a Roslyn analyser? See also [MMF1332](https://jira.sonarsource.com/browse/MMF-1332) and [this](https://github.com/SonarSource/sonarqube-roslyn-sdk) GitHub repository. – Jeroen Heier Dec 27 '18 at 16:14
  • See https://stackoverflow.com/questions/53877432/how-can-i-create-my-own-c-sharp-custom-rules-for-sonarqube/53889326?noredirect=1#comment94682197_53889326 – duncanp Jan 02 '19 at 09:37
  • Hi, Thx for info. As other approach, can i write java code that will parse the .Net/C# code and report the finding. – sorab Jan 02 '19 at 13:55
  • I am not able to follow the instruction to create sonar rules for .Net code (I am not .Net developer). If you can please share step by step instructions on how to write custom rules for .Net – sorab Jan 02 '19 at 13:57
  • The Microsoft "getting started" page has pointers to a number of resources and walkthroughs for creating Roslyn analyzers: https://learn.microsoft.com/en-us/visualstudio/extensibility/getting-started-with-roslyn-analyzers?view=vs-2017 Writing C# rules in Java: technically yes, but you would have to write your own SonarQube plugin, find/write a parser for C#, write your rules etc. That would be much more work than learning how to write rules in C# using Roslyn. – duncanp Jan 03 '19 at 13:42
  • Thanks... Can you please suggest some material to study the working of sonarqube. – sorab Jan 04 '19 at 09:34

0 Answers0