Cyclomatic Complexity
![Resim](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrexf2D4kRZV2AWD-ltSewgbZ94pn-YWnRVOEPTLxWB3ZmRX_8eJw7sfvbvdWaNQVVPlvaKlUd1qX0vNrVH3UK6aChjuSfuS_SGESJ4arXGb2jX5s5lguECYS9tEzI3gFLlLOnuFouyjaQPULoxYoBbyq1Zj2Q3tlvCn35NaaGgiBZQiBB1ezHxjYLO-s/s600/%C3%87izim1.jpg)
To enhance understandability in our code, cyclomatic complexity must be limited. Cyclomatic complexity is related to the structural complexity of the code which being analysed. High complexity leads to a high number of defects and maintenance costs. In order to calculate cyclomatic complexity, we have to create a graph. Also this metric give us results related to testability. The general formula to compute cyclomatic complexity is: M = V(G) = E - N + 2P Graf Terimleri V(G) = Cyclomatic number of G E = Number of edges N = Number of nodes P = Number of unconnected parts of the graph If there are no branches, the cyclomatic complexity level is 1. As branches raise cyclomatic complexity levels rise. Code Highlighting Example #include 1. void exampleFunction(int a, int b) { 2. if (a > b) { 3. std::cout << "a is greater than b" << std