Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cyclomatic Complexity and variants

Whats the diferrence between essential, design complexity, extended cyclomatic complexity, cyclomatic complexity?

I'm checking this metrics using a IntelliJ IDEA plugin.

enter image description here

like image 327
Kennedy Oliveira Avatar asked Jan 14 '15 22:01

Kennedy Oliveira


1 Answers

Overview

Design complexity measures the dependency of a method on other methods; cyclomatic complexity measures the number of distinct paths through a method; and extended cyclomatic complexity adds a control logic metric to represent "the minimal number of tests necessary to completely exercise a method's control flow."

Details

Design complexity

This metric reports the design complexity of a method. The design complexity is related to how interlinked a method's control flow is with calls to other methods. Design complexity ranges from 1 to V(g), the cyclomatic complexity of the method. Design complexity also represents the minimal number of tests necessary to exercise the integration of the method with the methods it calls.

Cyclomatic complexity

This metric reports the cyclomatic complexity of each non-abstract method. Cyclomatic complexity is a graph-theoretic measure of the number of distinct paths through each method. In practice, it is basically 1 + the number of branch points in the method.

Extended cyclomatic complexity

This metric reports the extended cyclomatic complexity of each non-abstract method. Cyclomatic complexity is a graph-theoretic measure of the number of distinct paths through each method, augmented by a measure of the complexity of the decision points. In practice, it is basically 1 + the number of branch points in the method plus the number of logical 'and' and 'or' operations. Cyclomatic complexity also represents the minimal number of tests necessary to completely exercise a method's control flow.

like image 54
gknicker Avatar answered Oct 15 '22 12:10

gknicker