Automatic analysis The main branch has no lines of code

Automatic Analysis has been configured, the project is javascript. here is .sonarcloud.properties

# Path to sources
sonar.sources=src
sonar.exclusions=_old
#sonar.inclusions=

# Path to tests
sonar.tests=test
#sonar.test.exclusions=
#sonar.test.inclusions=

# Source encoding
#sonar.sourceEncoding=UTF-8

# Exclusions for copy-paste detection
#sonar.cpd.exclusions=

our main branch in github and in sonarcloud is the same. we’ve made several merges into the branch since adding sonarcloud and it has been 2 days and still it says The main branch has no lines of code. Oddly the branches are all being scanned properly and show code on them. The only one with the issue is the main develop branch.

whenever we change the develop branch i also see this,

image

but when it is done it still goes back to no lines of code

Hello @nwsparks, welcome to the community forum!

Could you share the id of the background task that corresponds to a master analysis?
You can do this by navigating to Administration > Background tasks on the project overview page of your project on SonarCloud.

Tom

Hi @TomVanBraband , thanks! AXCg4SN5NciRRjWu_rI5 is the most recent one

I haven’t heard anything @jakob

@TomVanBraband were you able to look into this? It is still a problem

Hi @jakob and @nwsparks ,

We are currently looking into it. I’ll update you once we have more information.

Thanks,
Tom

@TomVanBraband 8 days no resolution no reply? is there a different line of support we should be using to resolve this?

Hi @nwsparks,

I am sorry for the delay in getting back to you. The support on this community forum works on a best-effort principle.

That being said we have been investigating your problem, and having a reproducer project would help us a lot. Would it be possible for you to create a small project that demonstrates this issue and share it with us?

Thanks,
Tom

@TomVanBraband I’m probably just going to have to switch it to manual at this point unfortunately.

some other troubleshooting measures I tried

  1. disable and re-enable automatic analysis. no change.
  2. comment out the “test” area of sonarcloud.properties. no change.
  3. scan the project manually. this made the develop branch appear in sonarcloud, but next time automatic analysis ran it went back to “The main branch has no lines of code.”

Hello @nwsparks,

We can tell from the logs on our end that the Typescript version that is used to analyze your project is outdated. This is likely due to some configuration specific to your project and I would like to understand this issue better, for which a reproducer project would be helpful.

Thanks,
Tom

@TomVanBraband is that controlled from what we define in packages.json? I can see if we are able to update the version.

I thought it was interesting that the manual analysis worked. I wonder what could be the difference from that versus the automatic?

I’m not sure if there is a way we can provide a reproducer project due to a lot of red tape…but I’m willing to try changes where possible on this one.

@TomVanBraband also what is weird is why do the pull requests analyze properly though? if typescript was the issue wouldn’t that fail on the pull requests then too? our version is not that old, 3.6.3

@TomVanBraband nevermind the solved post sorry. I must have mistaken one of the branches for develop. Develop still shows no lines of code.

@nwsparks Ok, that version of TypeScript should not cause problems at all.

Could you share with me the ID of a background task corresponding to the analysis of a pull request?
To be clear, we only invoke Automatic Analysis for the default branch of your project and for pull requests. It is currently not possible to have other branches analyzed by Automatic Analysis.

Thanks,
Tom

@TomVanBraband thanks

most recent develop branch (default): AXDo_QsqznkN4YVbw9Ti

most recent pull request analysis: AXDo_ybNWOdx4vIHWOgO

I can see the same errors when an analysis is triggered for your pull request. Do all the files in your repository show up when you navigate to your PR on SonarCloud and click on the Code tab?

Would it be possible to share your tsconfig.json (it is possible in a private thread)?

@TomVanBraband interesting. How can I start a private thread? Our tsconfig looks fairly generic so I’ll share it here…If I go to the code tab on both develop and PR I am able to view the files, screenshot from develop:

{
      "compilerOptions": {
        "module": "commonjs",
        "declaration": true,
        "removeComments": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "es2017",
        "sourceMap": true,
        "outDir": "./dist",
        "baseUrl": "./",
        "incremental": true,
        "resolveJsonModule": true,
        "esModuleInterop": true
      },
      "exclude": ["node_modules", "dist"]
    }

Would it be possible to see the errors that are occurring ?

Hello @nwsparks,

The issue is very probably the 'incremental': truein your tsconfig.json. Could you try removing that and see if that solves your issue?

If that is the case I can open a ticket on our end.

Thanks,
Tom

Hi @TomVanBraband - we set it to false but no change unfortunately. Last analysis ID: AXD0WYUgUQHotVoknPbm