Analyse code since a spesific date in sonarqube

  • which versions are you using : * Enterprise Edition Version 8.9.10 (build 61524)
  • how is SonarQube installation: Docker-compose file

Hello,

I would like to set a spesific date in sonarqube for code analysis. I would like to set 01.01.2023 date. And I will accept that new codes starts from this date(01.01.203). How can I achive this? I didnt see any option below screenshot. Kind regards,

Hey there.

Starting in SonarQube 8.4 If you were using a specific date or version for your New Code Period, now you’ll need to use a specific analysis.

See the Setting Your New Code Period for more info.

:warning: Make sure you upgrade to SonarQube v9.9 LTS soon, not only to benefit from our Best LTS Ever™, but because soon we will systematically ask users to upgrade when they ask questions about earlier versions of SonarQube, which are now considered unsupported. :smiley:

Hi Colin,

Tahnk you for quick return. So What should I do now? I want to get new code analysis starting 01.01.2023. Could you please explain it clearly? :slight_smile:

Thank you,
Kind regards,

At the project level, after the first analysis, you’ll need to select the analysis that you want to act as the “baseline” – this is probably the first analysis.

For existing projects, you’ll want to select the last analysis before January 1st.

It’s not possible to retroactively determine that lines after January 1st are considered “new” – The New Code Period is a way to resolve which analysis should be used as the baseline.