SonarQube only analyzes (large) subset of files

  • I am using SonarQube developer edition, version 7.9.1, build 27448.
  • I am trying to analyze all the files in my project, but only a (big) subset is being analyzed.
    The files not being analyzed is available in SonarQube to be read. In the overview it just has a — instead of an amount, but if i open up the actual file inside SonarQube it says how many lines there actually are. But they aren’t being analyzed.
  • I’ve run SonarQube on my project, expecting everything to be analyzed, but a part isn’t. It is a brand new project and i haven’t excluded anything. I’ve tried enabling include autogenerated code in case it mistook it for autogenerated.

I am using Azure DevOps integration and that plugin, to do this.

Any suggestions would be appriciated :smiley:

Typically this implies that some code is being analyzed as Test code (as such, metrics/issues won’t be reported).

Could this be the case? Feel free to share logs from your analysis if you’d like someone to take a look and pinpoint what’s going on (anything else will be guesswork)

I can’t see any reason it would be considered Test code, but i don’t know how to confirm.

Here is a log from running the code analysis, from DevOps, let me know if this is not the file you need.
https://pastebin.com/zWE96qLS

Here is an example of what Sonarqube says, if i go in and open the file it knows how many lines there is, so they are being uploaded properly.

I look forward to hear from you!

2019-11-29T13:24:53.5485187Z INFO: Indexing files of module 'AHLProject.Common.Core'
2019-11-29T13:24:53.5486700Z INFO:   Base dir: C:\agent\_work\1\s\AHLProject.Common.Core
2019-11-29T13:24:53.5490087Z INFO: Indexing files of module 'AHLProject.Common.Standard'
2019-11-29T13:24:53.5490634Z INFO:   Base dir: C:\agent\_work\1\s\AHLProject.Common.Standard

Hm, seems like SonarQube doesn’t think it needs to analyze inside this folders (or, it can’t analyze things, more on that later)

To me, this means that metrics aren’t being calculated for the code (while Lines can be determined without an analysis, Lines of Code cannot)

Are you doing a full build of your code (MSBulid.exe /t:rebuild)?

Colin

Hey! I would like to reply instantly but i am not getting email notifications of replies :frowning:

There are plenty of files it DOES analyze, and metrics are made for those:

I actually have 3 solutions, so in DevOps i use MSBuild with project as *.sln, and it seems to build all 3.

Any idea Colin :smiley:?