How to track Complexity while refactoring


  • Bitbucket Cloud
  • CI: Bitbucket Cloud
  • c++
  • Sonarsourcel

We are currently refactoring some old code and I would like to track the Cyclomatic & Cognetive Complexity for each PR. Unfortunately it’s only available for the whole code base.

How can I monitor that we are in the right direction ? Each time we are pushing new code the complexity of the code that was refactored is lower that the recommended values ?


Another question that came up is how to set the quality gate value.
For cyclomatic it is said that the target should be around 10. But it seems that the quality gate consider the sum based on all files.

The solution to my question:

Cyclomatic & Cognitive complexities are considered as code smells. So you can configure the quality gate to fail on a number of code smells.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.