Cyclomatic Complexity Definition

Cyclomatic Complexity

Cyclomatic Complexity – is a quantitative measure used in software engineering whereby it examines the control flow complexity of a program. It tests that a number of linear independent paths inside source code reflect the structural complexity and the probable need for testing. It measures the number of decision points from the flow control of the code and includes loops, conditionals, and function calls among others.

Its basis is from graph theories that are based on the concept of a control flow graph with nodes representing program statements and edges representing control flow among the statements. Furthermore, programs having High Cyclomatic Complexity will show more possible execution paths so they should be offering more chances to errors and other kind of defects. This metric also allows the problem to be exploited as per code reviews, testing of the code, and procedures that involve refactoring in order to quickly spot spots in the code complicated, probably simple, or optimal at most.