Next: Weighted Method Count ( Up: Structural Complexity Previous: Structural Complexity
McCabe Cyclomatic Complexity (
)
can be computed on instances of
a common meta-model, as long as the required types are
provided by the front-end. A UML front-end, e.g., would not
construct nodes of required type. Still, this front-end works
with the new meta-model and the metric is unambiguously
defined.
- Description
- is a measure of the control structure complexity of software. It is the number of linearly independent paths and therefore, the minimum number of independent paths when executing the software.
- Scope
- Method
- View
-
- Grammar
- Entities
- Productions :
- Mapping
:
- Definition
-
The value of a method
is defined
as:
- Scale
- Absolute.
- Domain
- Integers in .
- Highly Related Software Quality Properties
-
- Re-Usability 2.4
-
is both negatively and positively influenced by
attributed assess with Cyclomatic Complexity.
- Understandability for Reuse 2.4.1:
-
Understanding if a class is suitable for reuse
depends on its complexity.
Understandability declines with increasing Cyclomatic Complexity.
- Learnability for Reuse 2.4.2:
-
Learning if a class is suitable for reuse depends
on the complexity of its interface. Systems with
high control complexity may also have a complex
(behavioral) interface.
Learnability declines with increasing Cyclomatic Complexity.
- Operability for Reuse - Programmability 2.4.3:
-
How well a class can be integrated depends the
complexity of its interface. Systems with high
control complexity may also have a complex
(behavioral) interface.
Programmability declines with increasing Cyclomatic Complexity.
- Attractiveness 2.4.4:
-
Attractiveness of a class depends on the
complexity of the potentially reused code.
Cyclomatic Complexity allows an assessment
complexity.
Attractiveness increases with increasing Cyclomatic Complexity.
- Maintainability 2.6
-
declines with increasing Cyclomatic Complexity.
- Analyzability 2.6.1:
-
The effort and time for diagnosis of deficiencies
or causes of failures, or for identification of
parts to be modified is directly related to the
number of execution paths, i.e. the complexity of
the control flow.
Analyzability declines with increasing Cyclomatic Complexity.
- Changeability 2.6.2:
-
Each modification must be correct for all
execution paths. Cyclomatic Complexity computes
the number of the linearly independent paths, a
lower bound of all execution paths ignoring
multiple iterations.
Changeability declines with increasing Cyclomatic Complexity.
- Testability 2.6.4:
-
Complete testing requires coverage of all
execution paths. Cyclomatic Complexity computes
the number of the linearly independent paths, a
lower bound of all execution paths ignoring
multiple iterations.
Testability declines with increasing Cyclomatic Complexity.
- Portability 2.7
-
declines with increasing Cyclomatic Complexity.
- Adaptability 2.7.1:
-
As for changeability 2.6.2,
the complexity the control structure of software
has a direct impact. Each modification must be
correct for all execution paths. Cyclomatic
Complexity computes the number of the linearly
independent paths, a lower bound of all execution
paths ignoring multiple iterations.
Adaptability declines with increasing Cyclomatic Complexity.
- Replaceablity 2.7.4:
-
The substitute of a component must imitate its
observable behavior. Components with complex
control structures might have a more complex
observable behavior making it more difficult to
check substitutability and to actually substitute
a component.
Replaceablity declines with increasing Cyclomatic Complexity.
- Related Software Quality Properties
-
- Functionality 2.1
-
might increase with increasing Cyclomatic Complexity.
- Interoperability 2.1.3:
-
Relating Cyclomatic Complexity to
interoperability requires to be able to locate
the parts of a system responsible for
interoperability. Complexity in these parts might
indicate a better ability to interact.
Interoperability might increase with increasing .
- Security 2.1.4:
-
Relating Cyclomatic Complexity to security
requires to be able to locate the parts of a
system responsible for security. Complexity in
these parts might indicate a higher security.
Security might increase with increasing Cyclomatic Complexity.
- Reliability 2.2
-
might increase with increasing Cyclomatic Complexity.
- Maturity 2.2.1:
-
Due to reduced analyzability 2.6.1
and testability 2.6.4,
bugs mights be left in the software. Therefore,
also maturity may be influenced negatively by
control-flow complexity.
Maturity might decline with increasing Cyclomatic Complexity.
- Fault-tolerance 2.2.2:
-
Relating Cyclomatic Complexity to fault-tolerance
requires to be able to locate the parts of a
system responsible for fault-tolerance.
Complexity in these parts might indicate a better
ability to interact.
Fault-Tolerance might increase with increasing .
- Recoverability 2.2.3:
-
Relating Cyclomatic Complexity to recoverability
requires to be able to locate the parts of a
system responsible for recoverability. Complexity
in these parts might indicate a higher
recoverability.
Recoverability might increase with increasing .
- Efficiency 2.5
-
might decline with increasing Cyclomatic Complexity.
- Time Behavior 2.5.1:
-
Static complexity might indicate a higher
execution complexity.
Time behavior might get worse with increasing Cyclomatic Complexity.
- Maintainability 2.6
- declines with increasing Cyclomatic Complexity.
- References
-
- CC is extensively discussed in [22],
- it is used to assess design and structural complexity of a system in [18],
- Li and Henry [15] propose to use Cyclomatic Complexity 3.1.3 as weight measure in Weighted Method Count 3.1.3,
- it is mentioned in the following resources:
- CC is implemented in the VizzAnalyzer Metrics Suite.
- Since
- Compendium 1.0
Next: Weighted Method Count ( Up: Structural Complexity Previous: Structural Complexity