Apr 19, 2011

About one year ago, i was asked to research various products and setup a continuous integration test environment. The plan was to migrate part of our development to the new setup.These screens which are also available from my public Picassa album were taken during the evaluation process of the Atlassian platform and finally the setup was adopted by our development team with some additions ofcourse.

Apr 15, 2011

In short, it tells you how bad your code is and where to start fixng things cost-wise. The total code quality of the project very much depends on the number of code violations. But when does something promote as a violation? Is parentheses' padding a violation to you? Maybe declaring arguments as final?

Each Sonar profile defines a collection of rules - checks. The configuration of this profile can dramatically alter the final metrics so it would be better to stick with a profile for the entire lifecycle of a project in order for the metrics to be always relevant.

In the following screen the zero-drop after enabling the most unforgiving profile is obvious, rendering all previous metrics irrelevant.

rules complianceviolations

At milestone A the build was analyzed with an all-out Sonar profile including all the rules, checks and thresholds.

To create such a profile:

1. Log in to Sonar ,(ver. 2.6+), go to configuration and then Quality profiles on the top-left from the menu bar.

2. Click copy to make an exact copy of the default Sonar way configuration and name it as you wish e.g. Sonar complete.Click on Set as default. Next time sonar analyzes a project will use this new configuration.

3. Before triggering a build let's activate some more rules and checks.Click on the newly createdconfiguration to browse and activate the rules.

Select any on the three lists: Plugins, Severity, Status and click search to browse all the available rules.

To activate them all perform a Bulk change selecting Activate all from the select menu on the right , (highlighted with red on the screenshot).

The profile is now ready and we can either set it as default or associate it with specific projects.

Troubleshooting

Trying to run the maven sonar goal with the above profile activated i came accross the folowing two exceptions, (sonar and plugins were completely updated after a clean install):