Cyclomatic complexity is the most widely used member of a class of static software metrics.

Cyclomatic complexity may be considered a broad measure of soundness and confidence for a program. Introduced by Thomas McCabe in 1976, it measures the number of linearly-independent paths through a program module. This measure provides a single ordinal number that can be compared to the complexity of other programs. Cyclomatic complexity is often referred to simply as program complexity, or as McCabe's complexity. It is often used in concert with other software metrics. As one of the more widely-accepted software metrics, it is intended to be independent of language and language format.

Cyclomatic complexity has also been extended to encompass the design and structural complexity of a system.

The cyclomatic complexity of a software module is calculated from a connected graph of the module (that shows the topology of control flow within the program):

Cyclomatic complexity is the most widely used member of a class of static software metrics.

Cyclomatic complexity may be considered a broad measure of soundness and confidence for a program. Introduced by Thomas McCabe in 1976, it measures the number of linearly-independent paths through a program module. This measure provides a single ordinal number that can be compared to the complexity of other programs. Cyclomatic complexity is often referred to simply as program complexity, or as McCabe's complexity. It is often used in concert with other software metrics. As one of the more widely-accepted software metrics, it is intended to be independent of language and language format.

Cyclomatic complexity has also been extended to encompass the design and structural complexity of a system.

The cyclomatic complexity of a software module is calculated from a connected graph of the module (that shows the topology of control flow within the program):

It has formula e-n+2 e refers to num of edges n refers to nodes. it is matic used to know howmany times the prog has to be excuted to excute all statements.

D.Thilagavathi

Aug 31st, 2007

The cyclomatic complexity of a software module is calculated from a connected graph of the module (that shows the topology of control flow within the program):

Cyclomatic complexity (CC) = E - N + p

where E = the number of edges of the graph

N = the number of nodes of the graph

p = the number of connected components.

Manoj

Oct 11th, 2007

I am currently implementing a program analysis tool that does static and dynamic analysis. I am using the Cyclomatic complexity metric to determine the complexity of a program. The formula I am using is CC = Number of decision + program entry point.

I just wanted to know is there any sort of grading I have to do for the different conditional statements? (if-else,while,for)

e.gÂ If-statment will have a grading of 1 or a while-statement is more complext so it will have a grading of 2.

‘CYLLOMETRIC COMPLEXITY’ is a software metric that provides a quantitative measure of the logical complexity of a program. Here, the value computed for cyclometric complexity defines the No. of independent paths is the basis set of program and provides as with the upped bound for the No. of tests that be conducted to ensure that all statements have been exercise at least once.

Cyclomatic Complexity is a measure of the logical complexity of an Algorithm and Looping Paths for Eg: Validating the Debit, Credit Card--the Developer is validate the Check Some Algorithm either developing code or doing unit testing---

Cyclomatic Complexity is software metric that provides a quantitative measure of the logical complexity of a program. Cyclomatic complexity defines the number for independent paths in the basis set of a program and provides us with an upper bound for the number of tests that must be conducted to ensure that all statements have been executed atleast once. It can be calculated in the following two ways.

Cyclomatic complexity, V(G), for a flow graph, G is defined as V (G) = E-N+2Where E, is the number of flow graph edges, N is the number of flow graph nodes.3. Cyclomatic complexity, V (G) for a flow graph, G is also defined as: V (G) = P+1Where P is the number of predicate nodes contained in the flow graph G.

Cyclomatic complexcity is a methodology to measure the complexity at a certain area of code.In other words it an another way to reach at defect clustering.
Cyclomatic complexity is to measure the number of independent paths in a programs source code.
The formula it follow: M = E- N + 2P
where

M = cyclomatic complexity
E = number of edges of the graph
N = number of nodes of the graph
P = the number of connected components.

**The easier one is like:n(umber of Decision statements in the program being tested plus one.)
It provides the degree of testing/review required in a certain area of code.

## What is cyclomatic complexity?

raghuramsuravarapuProfile Answers by raghuramsuravarapu Questions by raghuramsuravarapu

Questions by raghuramsuravarapu answers by raghuramsuravarapu

## Answer Question

Click here to Login / Register your free account

## Related Answered Questions

## Related Open Questions