Java: Complexity Measurement

Can programs measure source code complexity?

Because the complexity we're trying to measure is how complex a human programmer thinks a program is, it's unlikely that complexity measurement software will ever accurately model the human difficulties in comprehending source code, not to mention that there are lots of individual programmer differences.

Although no program can provide an accurate measurement of what a human perceives, there are some general rules of thumb that can make a rough estimation.

Measurements of whole programs, both from a design and after it has been written

Measurements of methods

An interesting topic is to measure the complexity of individual methods. There are several things that contribute to the complexity. For example.

Computing McCabe's Cyclomatic Complexity for Java methods

Next: Method Cyclomatic Complexity describes how to easily compute the flow complexity of a Java method.