1) How well does Sonar handle branch of the same product. So far
I haven't experimented much, but it seems to only recognize groupId+artifactId
as the project identifier. That must make it hard to measure quality on trunk
and branches, for those of us who use both at the same time.
The parameter -Dbranch=name_of_your_branch is certainly what you're looking for. With this parameter two projects with the same groupId+artifactId are considered as different by Sonar.
2) Simulation mode
I was thinking. We sometimes want to identify if certain changes
would improve or not the overall quality of the build before we check it in.
The reasoning is, that often when the project is checked in, developers focus
on the next task ahead. If we had the ability to show potential impact, it
would be easier for the developer to go the last mile. Especially when we want
to encourage a peer review development model.
Is there anyway a measure could be not committed in the DB, but
a diff created in any way? I assume the answer is no, but a bit more elaborated
:-)
My following point of view is totally biased by my agile sensibility :-) :
A good developer should be able to split his work in very elementary baby steps and should commit his changes as soon as a baby step has been done, that is to say each 4, 2 or even 1 hours. By the way, the commit frequency will be one day a metric available in Sonar. This continuous development flow should not be broken or even perturbed for any reasons. The developer must compile and execute unit tests before committing anything but asking him/her to launch locally a Sonar quality analysis is a kind of perturbation.
On the other side, if the developer is starting a big refactoring and doesn't want to alter the stability of the trunk, he/she must work on a branch and the first solution works (using the branch parameter).
It's why we are more willing to better show and trac what have changed in the near past (
http://jira.codehaus.org/browse/SONAR-249) than offering a way to launch Sonar on the developer desktop (even if this is quite easy with the use of the default embedded DB).
Regards
Freddy