What is cyclomatic complexity and why is it important?

Answer Posted / sheetal

What is cyclomatic complexity
Cyclomatic complexity is a computer science metric
(measurement) developed by Thomas McCabe used to generally
measure the complexity of a program. It directly measures
the number of linearly independent paths through a programs
source code.
The concept, although not the method, is somewhat similar to
that of general text complexity measured by the
Flesch-Kincaid Readability Test.
Cyclomatic complexity is computed using a graph that
describes the control flow of the program. The nodes of the
graph correspond to the commands of a program. A directed
edge connects two nodes, if the second command might be
executed immediately after the first
command. By definition,
CC = E - N + P
where
CC = cyclomatic complexity
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between user control an custom control?

617


Explain transparent caching with aop?

526


Which tool you have done?

1484


What is viewstategenerator?

702


What is the difference between exe and dll?

557






Explain what benefit does your code receive if you decorate it with attributes demanding specific security permissions?

526


What is web api vs wcf?

583


Suppose You Want A Certain Asp.net Function Executed On Mouseover For A Certain Button. Where Do You Add An Event Handler?

648


How long does an http session last?

531


How does windows service lifecycle differ from a .standard. Exe?

516


What are the new features implemented in ASP.NET?

611


What does it mean your session has timed out?

533


What are session state modes in asp.net?

554


What are the main differences between asp and asp.net?

526


What is the usie of activex control in .net?

562