concept difference in category sonarqube

appears as: difference, The difference, differences
SonarQube in Action

This is an excerpt from Manning's book SonarQube in Action.

But whether you’re using SonarQube Runner, Maven, or Ant to run your analysis, you need to make sure you give SonarQube a way to differentiate between, say, your Java evaluation of a project and the JavaScript analysis of the project. Don’t assume that SonarQube will pick up on the difference in the specified language. It only differentiates projects by projectKey, not by projectKey and language. Reuse the same projectKey for each language, and each subsequent analysis against a new language will overwrite the previous one (which will do bizarre things to your quality trends). You may want to vary sonar.projectName as well, but that’s only for your own convenience. It’s not as crucial, and it can easily be changed later if you find yourself getting confused. In chapter 14, we’ll show you how to set up filters (project lists) for each language, so if you wanted to keep the names the same, you could still easily tell each aspect of, say, Project Blue apart by whether you’re looking at the list of Java analyses, the JavaScript results, or the Flex list.

Similar principles apply to technical debt. The difference is that there is no initial obligation. The debt starts to build when the first commit takes place, and it’s increased every time you add new code to the project. It’s like when you get a new credit card. On the first day, the balance is zero, but every purchase (commit) is a charge to your card (technical debt) that eventually you’ll have to repay.

At the right of each metric is a number showing the difference between the latest analysis and the snapshot analysis you selected in the Differential drop-down menu. We’ve said before that SonarQube uses colored trend arrows—green for good and red for bad. When you’re in differential mode, the same applies to the numbers that replace the trend arrows. Good changes are green, bad are red, and value-neutral are black.

Look at the comments and duplications widget in figure 9.15. In this case, the density of comments has decreased from 7.0% to 6.9%, so in SonarQube, the difference is colored red. Similarly, there are 33 new duplicated lines and 3 new duplicated blocks of code. They negatively affect the quality of the project, so they’re shown in red.

Figure 13.22. You access the profile comparison interface from the Compare Profiles link at the top of the list of profiles. It lets you compare any two profiles, regardless of language, and shows the differences in summary form at the top with a list of details at the bottom.