# New code period

**URL:** <https://community.sonarsource.com/t/new-code-period/12549>\
**Category:** SonarQube Server / Community Build\
**Created:** [July 29, 2019, 8:02pm UTC](https://community.sonarsource.com/t/new-code-period/12549 "2019-07-29T20:02:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoaoRocha](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@JoaoRocha](https://community.sonarsource.com/u/JoaoRocha)\
**Post date:** [July 29, 2019, 8:02pm UTC](https://community.sonarsource.com/t/new-code-period/12549/1 "2019-07-29T20:02:47Z")

</div>

I’m using sonar qube 7.9.0 LTS

I defined for a project the new code period as 2019-07-28. For every analysis that I performed today (2019-07-29), I get the error:

Invalid new code period. ‘2019-07-28’ is not one of: integer \> 0, date before current analysis j, “previous\_version”, or version string that exists in the project’  
Please contact a project administrator to correct this setting

The project had code changes today so my expection was to have a normal analysis

What I’m I doing wrong?

---

<div class="post-metadata">

**Author:** ![JoaoRocha](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@JoaoRocha](https://community.sonarsource.com/u/JoaoRocha)\
**Post date:** [July 29, 2019, 8:13pm UTC](https://community.sonarsource.com/t/new-code-period/12549/2 "2019-07-29T20:13:48Z")

</div>

My previous analysis was from 2019-07-26…is this my wrong configuration?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [July 30, 2019, 2:34pm UTC](https://community.sonarsource.com/t/new-code-period/12549/3 "2019-07-30T14:34:53Z")

</div>

Hi,

When you set the new code period to a date, the next analysis will choose a ‘baseline’ against which to make all the “New Code Period” comparisons. The baseline is the first analysis on record _inside_ the date range, so in your case _after_ midnight on 2019-07-28.

Your only previous analysis took place before the New Code Period, so there’s no analysis available to be the baseline. That means the New Code Period comparisons can’t be made. Since we use a fail-fast approach, rather than giving you bad comparisons or not making the comparisons, we stop analysis instead. That’s why your analysis is erroring-out.

To fix this you probably need to do this:

- set New Code Period to 2019-07-26
- analyze. You now have an analysis dated 2019-07-30
- set New Code Code Period to 2019-07-28. Your 2019-07-30 analysis will be your baseline from here out

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![JoaoRocha](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@JoaoRocha](https://community.sonarsource.com/u/JoaoRocha)\
**Post date:** [July 30, 2019, 7:57pm UTC](https://community.sonarsource.com/t/new-code-period/12549/4 "2019-07-30T19:57:26Z")

</div>

Thank you.  
it helped indeed
