How Do You Calculate Cyclometric Complexity?
Cyclometric complexity is a measurement used to determine the complexity of a software program. To determine this complexity a cyclometric calculates the number of potential paths through the program’s source code. The number of these paths is the result of how many decision statements are present within the code. A decision statement is a code construct such as “if…then.” The more of these decision statements there are inside the code, the more potential paths there are and the more complex the program becomes. When a program becomes too complex due to an excess of these decision statements, it can cause the program to malfunction. Knowing the cyclometric complexity allows you to adjust the code to prevent this from happening. View the source code of the program. The exact process for viewing the source code varies depending on what type of program it is. Add up the number of decision statements in the source code. If you are not sure which commands are considered decision statement