How Readable Is Your Code? Part 2

Once Again About Cyclomatic Complexity

In the first part, I've introduced Cyclomatic Complexity (CYC) metrics in the previous part. So CYC has no intention to be a readability code metric. CYC was invented a long time ago (in 1976)  by Thomas J. McCabe. 

Cognitive Complexity Metric.

Cognitive Complexity (CC) attempts to count the cognitive effort required to understand the code's flow. Let's take a look at the next example:

How Readable Is Your Code? Part 1

There Is No Perfect Implementation?

Every developer has his own preferences and vision about problem-solving. Any problem can be solved in my différent ways following know practices like SOLID, KISS, etc. But how to compare 2 different implementations? Smaller is better? Only Object-Oriented? How practically evaluate notions like code maintainability, readability, transparency? Well, I'm not sure that there is absolute truth in such questions, but in this article, you will find a metric that can help you find out. 

Cyclomatic Complexity — Number of Scenarios in Code.

Cyclomatic complexity is a metric invented to find out the number of tests to cover the given code fully. This metric also can be used to measure the readability of your code.  Cyclomatic Complexity shows how many scenarios consist of your code (or how many independent ways inside its graph)