-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sonar cxx plugin takes around 20 minutes to analyze the code that has templates and boost::optional #1539
Comments
Hi @roopshree, is this with or without Includes could be a root cause or an enabled cxx check? Regards |
The actual sonar properties that is used with the production code has the includedirectories. I did not bother adding the includedirectories because I was working with a cpp file. Do I still need to include the path to standard header files? Also, is there a documentation on how to use the toolkit link that you provided? |
includedirectories: parsing the files is a two step process. Reading the cpp file, running the preprocessor and than creating an AST with the C++ grammar. Typically such problems comes from adding the boost header files to includedirectories. In this case the parser has to handle thousands of includes.
Tool is straight forward. Start the tool on your local PC. Copy the sample code into it and press I tried it out. Your are right. Parsing the code is indeed horrible slow (without setting includedirectories). |
see #1685 |
We have a code file which the sonar.cxx plugin takes around 20 minutes to analyze.
I have reduced the code to bare minimum to reproduce this issue:
If I reduce the number of boost::optional in the code above or remove the additional indirection in FOOPARAM, then the analysis speeds up. Unfortunately, I cannot do either in the actual code.
sonar-project.properties used:
sonar debug logs
The text was updated successfully, but these errors were encountered: