Sitecore: How to improve code quality with sonarqube

Intro:
I learned about the great tool sonarqube from my time with Java. It is an awesome tool to check your code quality and control hopefully your code quality improvements. I will share my experiences about it. Also its being the topic of the Sitecore Usergoup Switzerland. See here the slideshow from this presentation:


Setup Sonar:
The setup is really easy if you run it standalone. Just follow the steps in here.

Setup Sonar & Jenkins:
If you have a running Jenkins just add to your Job a Windows batch file element and past in that:

cd C:/Program Files/Jenkins/jobs/<jenkins job name>/workspace
C:\Programs\sonar-runner-2.4\bin\sonar-runner.bat -X -Dsonar.login=admin -Dsonar.password=password


Replace  <jenkins job name> with the Job name. Don’t change it because Jenkins uses it as folder name. Of Course adjust the path to your environment.

BTW: the -X parameter is for verbose log information the sonar-runner is executed.

My recommendations:
- 0 % duplication is a must
- No critical or blocker bug allowed

Outlook
Especially for Sitecore:  Do not fight the framework. So there are additional FXcop rules to implement. Find them here:


Comments

  1. Very good post. I am experiencing many of these
    issues as well..

    ReplyDelete
  2. you're actually a just right webmaster. The web site loading pace is
    amazing. It kind of feels that you're doing any unique trick.
    Moreover, The contents are masterpiece. you've done a great process in this matter!

    ReplyDelete
  3. Hey very interesting blog!

    ReplyDelete
  4. Hey very nice blog!

    ReplyDelete

Post a Comment

a new comment