SonarQube New Code analysis is off by 5 hours

Above is the total analysis details. Let me know your findings

So it looks like the lines were classified as “new” when you get those responses.

Were you expecting the change date of those lines to be 2021-07-13T08:22:05-0500?

My Bad… The one’s above which I mentioned and classified as “New” is the correct response. I was able to see the analysis on new code in sonarqube.

I also updated few lines of code in the project (Between 5 Hr time range) but they were not showing as new code as you can see below.

{
			"line": 47,
			"code": "        <span class=\"k\">public</span> <span class=\"h\">IEnumerable</span>&lt;<span class=\"h\">RefAddressType</span>&gt; <span class=\"sym-10 sym\">GetRefAddressType</span>()",
			"scmRevision": "302208",
			"scmAuthor": "xxxxxx",
			"scmDate": "2021-07-12T08:37:53-0500",
			"duplicated": false,
			"isNew": false
		},
		{
			"line": 48,
			"code": "        {",
			"scmRevision": "302208",
			"scmAuthor": "xxxxxxx",
			"scmDate": "2021-07-12T08:37:53-0500",
			"duplicated": false,
			"isNew": false
		},
		{
			"line": 49,
			"code": "            <span class=\"sym-3 sym\">_logger</span>.LogInfo(<span class=\"s\">\"GetRefAddressType\"</span>, <span class=\"s\">\"Get Ref Address Type started!\"</span>);",
			"scmRevision": "302208",
			"scmAuthor": "xxxxxxx",
			"scmDate": "2021-07-12T08:37:53-0500",
			"utLineHits": 0,
			"lineHits": 0,
			"duplicated": false,
			"isNew": false
		},

Hope this gives you the correct and detailed report.

Thanks.
So the New Code Period started at 2021-07-12T13:28:05-0500 and those lines have a changed date, as reported by the SCM, set to 2021-07-12T08:37:53-0500.
Based on that data it makes sense that they are not considered as “new”.

What one of the dates did you expect to be different?

Thanks

I don’t understand what you mean when you say that the 2nd analysis didn’t work. Does it mean the scmDate it not what you expected? Or is it because there was no code shown as “new”?

If the code you analyze as a commit date in the past (before the New Code Period threshold), it’s not going to show up as “new” in SonarQube.

“ScmDate” was showing correct in all cases, but its not showing as “new” even though it is new code and was never added in the past.

Hi @dmeneses Is there anything you can help with this issue. This is hampering our development and appreciate your support