Ignore specific warnings in sonarqube analysis

Hi,

I am facing an issue with CFamily analysis where files referenced by protobuff are not found and

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension):
    Sonarqube Server v10.8 (100206), dotnet sonar-scanner (latest), “C++ (Community)” version 2.1 (build 229)

  • how is SonarQube deployed: Docker, using “sonarqube:developer” image

  • what are you trying to achieve:
    Analyze a complex project containing c++/c# among other languages, excluding certain folders. I get warnings about files referenced by protobuff not present in analysis context (which is normal as i want to exclude them).

  • what have you tried so far to achieve this

I tried taking off all exclusions in order to analyze the whole project and avoid the warning, but i still get warnings like this:

10:44:57.115 WARN: File 'D:\Gitlab-Runner\builds\1793\quantum-project\backend\PluginTest.Lib.Cs\.SolutionEnvironment.cs' referenced by the protobuf 'MetricsInfo' does not exist in the analysis context
10:44:57.134 WARN: File 'D:\Gitlab-Runner\builds\1793\quantum-project\backend\PluginTest.Lib.Cs\.SolutionEnvironment.cs' referenced by the protobuf 'TokenTypeInfo' does not exist in the analysis context
10:44:57.146 WARN: File 'D:\Gitlab-Runner\builds\1793\quantum-project\backend\PluginTest.Lib.Cs\.SolutionEnvironment.cs' referenced by the protobuf 'SymbolReferenceInfo' does not exist in the analysis context
10:44:57.148 WARN: File 'D:\Gitlab-Runner\builds\1793\quantum-project\backend\PluginTest.Lib.Cs\.SolutionEnvironment.cs' referenced by the protobuf 'CopyPasteTokenInfo' does not exist in the analysis context

Full verbose logs are too big to share here (200Mb), please let me know how I can share it :confused:

What are the impacts of these warnings? Is there a way to fix them or ignore this warning specifically?

I am quite new with msbuild/dotnet analysis and thank you in advance for your help :slight_smile:

1 Like

Hello @s.livain

The reported issue is a duplicate of Improvement: Don't log "... does not exist in the analysis context" warnings for excluded files. We have the issue on our radar but we haven’t planned any work on it at the moment (it is a lot of work to do this right, but we would also gain better performance by skipping analysis for such files). As an intermediate solution we plan to turn this warning into a log message that only appears in verbose logs.

1 Like

Hi!

Thank you for your reply. I assume that the impact on the analysis is quite low if you plan to log it as info instead of warning, so i will ignore this for the moment.

Is there a way to indicate sonarqube not to thown some specific warning?

Is there a way to indicate sonarqube not to thown some specific warning?

There is no way to suppress specific warnings in the logs.