Complexity analysises aim to identify a measured value, which represents the complexity of a given program. This metric measures certain aspects of software quality metrics, such as maintainability
. Metrics are limited to data for a certain aspect of quality metrics (not all). An interpretation in relation and weighting to other elements provides a comparable figure for meaningful statements. Breaching of thresholds indicate an issue with the quality of the code.
Given tools, such as SonarQube can provide insights into code complexity as illustrated below:

Cyclomatic Number
An interesting indicator is the cyclic number. It identifies the depth of cycles within a given functionality. The higher the numer, the worse the code. It is defined by the amount of binary branches plus one. It can also be calculated giving the following formular:
v(G) = e – n + 2p
Sequence
v(G) = 1 – 2 + 2 = 1
Choice
v(G) = 4 – 4 + 2 = 2
Loop
v(G) = 9 – 8 + 2 = 3

Legend
G
e
n
p
Control Flow Graphe Amount of edges
Amout of Edges
(arrows)
Amount of nodes
(circles)
Amount of connected components
(arrow in, but no arrow out)