Looking for a Cognitive Complexity Badge

Hi,

I was wondering if there is a way to get a project badge showing cognitive complexity. I was not able to find anything in the documentation. So my question is basically: is it possible to create custom badges?

I am using Sonarqube Community Edition Version 9.4

Thanks for your help

Hey there.

It’s not possible to select Complexity as a metric to use in a badge – and I would be interested in learning about the use-case where you’d find it useful. Complexity calculated at a project level… isn’t that interesting. A basic calculator app will be less complicated than a self-driving car. What is usually more meaningful is that specific functions/files do not get too complex.

Hi Colin, thanks for your answer.

I know that it is not possible to select “complexity” as a badge as I don’t see it on the dropdown. I am looking for a way to do that anyway :frowning: maybe a plugin, something to configure, anything?

Any ideas?

How do you track complexity of your application over time? Knowing if your applications get more and more or less and less complex over time is useful when one of your goals is to make your app less complex, right? So having a number to follow is a good start.

Giving people awareness by showing a badge is exactly the purpose of this.

I never said I was comparing projects by their complexity. But if that works for you then go ahead. No judging here.

Nobody is saying the opposite. But how do you summarise that? Isn’t the metric doing exactly so by adding all values.