SonarCloud Automatic Analysis: Not scanning the folders present in the root directory of GitHub Repo

Hello,

I’ve been setting up SonarCloud Automatic Analysis for a couple repositories (All repositories having around 100k lines of code). There is one repository which is of about 66k lines of code, when the automatic analysis runs on this repository only 114 lines of code gets scanned, these lines are present in the files that are located at the root of the project, where as the rest of the code is present in a folder called “src” which does not get scanned.

I have set up a New Code Definition.

I tried setting the “sonar.inclusions” present under the “Analysis Scope” on the UI, but upon including this the analysis returns that there is no code in the branch.

I will be switching to the CI Based Analysis in the near future since the Automatic Analysis does not include CodeCoverage, but as for now I would want to understand why is SonarCloud failing to analyse this repository where as the other repositories which I configured where successfully scanned under the Automatic Analysis.

What would be the possible workaround for this automatic analysis to be able to successfully access the rest of the code? Is there any workaround for this?

Please find the details and folder structure of the project below:

  • ALM used: GitHub
  • CI system used: None (Currently on automatic analysis)
  • Scanner command used: None
  • Languages of the repository: TypeScript
  • Folder structure:
    `
/
|- .github/
|  |- ...
|  ...
|
|- public/
|  |- ...
|  ....
|- src/
|  |- config/
|  |  |- abc.ts
|  |- models/
|  |  |- abc.model.ts
|  | ....
|  |
|  |- bar.js
|  |  ....
|  ...
...

`

Note: The folder structure is identical to the other repository for which the analysis was successful.

Thanks in advance.

Kind regards,
TJ

Hey there.

I’ll reach out to you by private message for your organization / project key so we can take a look at the logs.