简体   繁体   中英

Integrate SonarQube C# ruleset to TeamCity for Code Analysis Build Break

Is there someone know here How to integrate SonarQube C# Ruleset in TeamCity for Code Inspection instead using the Resharper(Inspection.NET)?

We don't want to go to sonar site(localhost:9000) to check the C# code issue instead we want to automate this in team city with build break if there is validated rules in C# sonar.

Currently i used FXcop for my Code Inspection but the ruleset from the fxcop is not complete vs from the sonar ruleset for C#, Fxcop contain only the Microsoft Ruleset but not the rulset like in this rule list (bug,pitfall,cwe,convention etc...)

Please help.

Regards

Well, you can launch a SonarQube analysis, and with a web service call look at the quality gate status for example to check that it is not red. If it is red, you are free to make the build fail if you'd like.

However, I personally wouldn't recommend to fail the build, and actually take the habit of going to SonarQube to visualize the quality of your project: It indeed make sense from times to times to introduce some technical debt, however you'll want to make sure that it eventually gets paid back, and that technical debt doesn't grow in every single sprint. Breaking the build when new issues are introduced is like saying that borrowing money should be banned altogether, which is a bit strong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM