Switched to Automatic Analysis and Now Overview Page Has 0 Findings

  • ALM used (GitHub)
  • CI system used (GHA)
  • Scan type: Automatic
  • Languages: PHP, JS
  • Problem: Zero changed lines of code in Overview and in most PR branches

We recently switched from scanning using a dedicated agent in Azure Devops, over to Automatic Analysis.

Since then, the Overview page shows 0 lines of code, and the Findings went to 0 as well. Most PR branches are also showing 0 lines of code changed and no Findings.

I think I need some assistance debugging why this is occurring.

One other issue I’m noticing… when I’m in the UI, a browser popup flashes in the lower left that says “an error has occurred while processing the request.” It disappears quickly, and if I click on the message it doesn’t go anywhere. I don’t have any context about what the error is or why it’s appearing.

Thanks,
Matt

Hello,
You mentioned that there is an Error message. On which screen do you receive it?
Can you also try to use your browser Developer Tools (F12 for Chrome) to check what request fails?

To find information about your scan requests, can you please share the analysis ID or your project name? You can send it in a private message.

Hi @AlexanderOrlov

Here is an analysis ID from the project. Can you get the project name from that?
AYq1QVmlpi7NMO6H0YYt

Hello,
From what I can see, I would assume that you might have too tight restrictions set up in General Settings → AnalysisScope → Source File Inclusions, or in sonar-project.properties file.

OK, I did find a missing comma, but it’s unclear to me how it could have impacted the inclusion rules in a way that no files would get scanned.

I don’t think I have the ability to DM you or I would send you the contents of the sonarcloud.properties file. Can you DM me? Maybe then I can reply?

It might be the sonar.inclusions. I wanted to include one subfolder of an excluded folder. But I think specifying that inclusion essentially excludes everything that is not in the inclusions list.

2 Likes

Hi,

Yes, that’s exactly what sonar.inclusions does.

 
Ann

So assuming all the code I want to scan is in these two locations…

foo/exclude1
foo/exclude2
foo/exclude3
foo/projectA

bar/projectD
bar/projectE
bar/projectF
bar/excludethis

I want to only include projectA in /foo, and all projects in /bar that aren’t in the exclusions list.

I would do this… ???

sonar.sources=.
sonar.exclusions=foo/**,bar/excludethis/**
sonar.inclusions=foo/projectA/,bar/

Hi,

sonar.sources accepts

  • Comma-separated paths to directories containing main source files.

so…

sonar.sources=foo/projectA,bar
sonar.exclusions=bar/excludethis/**/*

(Note the trailing /*. ** means 0-n directories)

Or

sonar.sources=foo/projectA,bar/projectD,bar/projectE,bar/projectF

 
HTH,
Ann