Cyclomatic complexity groupings

Must-share information (formatted with Markdown):

  • which versions are you using SonarQube (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 9.5

  • what are you trying to achieve
    I am trying to generate a report for my project showing how many low, medium, and high complexity functions it has

  • what have you tried so far to achieve this
    I added cpp:S1541 to my project, but I can only have a single threshold. I can also pull instances of these violations from the web API, although I need to do some string parsing to get the actual complexity.

The best solution I can come up with is to set the threshold to 0 so every function triggers the code smell. Then I would use my script to count and bin everything. Is there a better way?


Welcome to the community!

We just don’t record method-level measures. You’ve already worked through the options to the best available.