Documentation for how Cyclomatic Complexity and Cognitive Complexity is being calculated for C#

Hi,

I want to use SonarCloud to calculate the Cyclomatic Complexity and Cognitive Complexity for a C# project. Because I’m using it for my thesis, I need to know precisely how it is calculated for C#. My question is therefore if you know where I can find any documentation on the matter? I have found this link, but it does not explicitly say C# anywhere: Metric Definitions | SonarCloud Docs.

Hope you can help.

Hi,

Both metrics should be being calculated according to their specifications. Here’s the spec for Cognitive Complexity.

 
HTH,
Ann