Need to Understand the flow of SonarQube. How can achieve rerun the analysis

Sonar * Community Edition * Version 7.9.2 (build 30863)

  • what are you trying to achieve
    We are trying to use sonar as Quality control in the organization and we have NodeJS and Java bases microservices as code. We release new versions accordingly with incremental numbers for Java and NodeJS. The issue we are receiving that as we have common SQ running in an environment and developers who are working on one project are developing the code to the next level. But when the time comes to run sonar analysis they use the same SQ server and rerun the analysis again and again which does not give the result at last that how much new line of code has been covered on report. Or even if they increase the version then SQ server still show the same result as previously it was showing.
    How can I achieve the final report for a project. I want to see the new code and they coverages if I compare the versions.

As I am using community version what are the alternative ways. Kindly suggest.

  • what have you tried so far to achieve this
    I tried SNAPHOT policy that we want to work on new code then we rename branch with version-SNAPTOP and analysis it. but the time of renaming back to VERSION it still shows the same results.
    i.e.

NOTE: Always get new lines to covers for once. When we reran the analysis then my new coverage merge with overall and no new code shows in new coverage.

Hi,
With the default setting of the New Code Period, the new code is whatever was added since the version was last changed. If you change the version in every analysis, you’ll never have any new code.
Could you show us what you get in the New Code tab in the Overview?

1 Like

Hi Duarte, We we are not changing version number in every analysis. We just do it when after stable release. But my question was that when we when we do analysis for a same version our new code just show only once and when we do run the same analysis for the same version then it does not show new code any more. Even we have not changed the version number.

I Understand that SQ store results so that it can match with previous result the new ones…

Is there any suggestion how can I track my changes here in new code…

I’m not sure I understand what you are doing. A change of version should start a New Code Period and changes in subsequent analysis of the same version should be part of the New Code.

Maybe some more screenshots would be helpful.

In the screenshot you showed there is no New Code because the version was just changed to v3.0.2, so a new New Code Period has just started. If now you do more analysis of v3.0.2, changes there shoudl be part of the New Code Period.

1 Like

Hi Duarte,

I will share the screen shots soon.

Thanks