I develop C++ QT applications and analyze with sonarqube. Headers have signal and slots, and sonar shows them as unused function which is wrong. I do not want to set all of them “resolve as false positive” manually. Can I write regex to solve this issue or is there any solution for this problem?
Any help?
Hello @decos55276 and welcome to our community!
Could you tell us which version and which edition of SonarQube you are using?
We have two rules about unused functions: RSPEC-1144 and RSPEC-5536.
From what you’re describing, I suppose you are talking about the second rule (RSPEC-5536) that is a project-level rule, is that correct?
Be aware that this rule is not very well-suited for projects that are used as libraries, because the plugin can’t see that some functions are used outside of the project.
If you want to keep this rule activated, I can think of only one way to solve your issue: add the test file testing these “unused functions” to your analysis.