Coverage showing 0% on new code

We have observed this frequently, that sonar is not showing coverage %age on new lines of code and still status shows PASSED. This is not happening with new branch or for first time. Even after many commits sonar is not reading the changes.

For eg.

Hey there.

It looks like your browsing the results of New Code – do you have coverage being reported ono Overall Code?

What you’re seeing is expected if, for example, you haven’t added any new code that is analyzed by SonarCloud in the last 30 days. Is there Code in the Code tab of your project that you introduce din the last 30 days that isn’t being shown as new?

Hi @Colin
we added new lines of code in somefiles, but in sonarcloud it is not showing in new tab. our quality gate has 100% coverage policy on new code. look at the following example also. its showing some issues but also saying 0 new lines to cover on new code.

Hey there.

That’s interesting – what languages are the new issues being raised on (and the code you said was added)? Can you give a few example rules where issues have been raised on new code?

Hi @Colin
our code is written on Javascript.

Thanks @js-techie. Can you answer the second part of my question as well?