SonarLint times out with class with many C++ header includes

SonarLint in disconnected mode using VS 2019, a particular file in our c++ project causes the IDE to become unresponsive for around a minute and then the scanner times out as seen in the verbose output below.

I attempted to use the SONAR_INTERNAL_CFAMILY_ANALYSIS_TIMEOUT_MS environment variable but it does not appear that that is a valid troubleshooting method anymore and I do not see any way to extend the timeout via Tools->Options->SonarLint either.

This will eventually get a refactor but is there anything I can do to make this less painful in the meantime?

Analyzing C:\Users\aflorence\source\repos\xeno\edot\middle-layer\codebase\src\win32_io_service_handler.cpp
Refreshing PCH file for C:\Users\aflorence\source\repos\xeno\edot\middle-layer\codebase\src\win32_io_service_handler.cpp. PCH file location: C:\Users\aflorence\AppData\Local\Temp\SonarLintForVisualStudio.PCH.preamble
Execution cancelled.
Aborted analysis of C:\Users\aflorence\source\repos\xeno\edot\middle-layer\codebase\src\win32_io_service_handler.cpp, analysis has been re-triggered or has timed-out.

TLDR: How do I extend the timeout for SonarLint?

Hi @aflorence - welcome to the community.

You can modify the timeout by setting the SONARLINT_INTERNAL_ANALYSIS_TIMEOUT_MS environment variable, then restarting Visual Studio (although note that this environment variable, like SONAR_INTERNAL_CFAMILY_ANALYSIS_TIMEOUT_MS, is intended primarily for internal use and could be dropped in a future version).

Could you send us a reproducer file so the analyzer devs can investigate further please?

This topic was automatically closed after 15 days. New replies are no longer allowed.