This document summarizes code metrics for various modules, including the 5 worst modules by cyclomatic complexity and maintainability. It shows that modules with higher cyclomatic complexity values are more likely to be fault-prone. The maintainability index synthesizes cyclomatic complexity, lines of code, and computational complexity to assess a module's maintainability, with lower scores indicating worse maintainability.
2. 5 Worst Modules by Cyclomatic Complexity
Title Module Complexity
Gms-Ci Credit.CTWB.DocumentsSetup.Control.dll 157
Gms-Ci Credit.CommonControls.LookUp.Common.dll 143
Gms-Ci Credit.ApplicationManager.EditQuickTab.Control.dll 133
Gms-Ci Credit.CTWB.CovenantsSetup.Control.dll 121
Gms-Ci Credit.CTWB.CovenantsSetup.Service.dll 111
Gus-Init1 GUS.WinApplication.Metrics.dll 262
Gus-Init1 GUS.WinApplication.Common.dll 104
Gus-Init1 GUS.WinApplication.ServiceAgent.dll 82
Gus-Init1 ICSharpCode.SharpZipLib.dll 67
Gus-Init1 GUS.WinApplication.Approvals.dll 59
TechnicalDebtTaskLib TechnicalDebtTaskLib.dll 22
TechnicalDebtTaskLib TechnicalDebtTaskLib_Accessor.dll 5
TechnicalDebtTaskLib BuildProcessTemplate.dll 5
TechnicalDebtTaskLib TechnicalDebtTaskLib.Tests.dll 3
Cyclomatic Complexity – Measures the structural
complexity of the code. It is created by calculating the
number of different code paths in the flow of the program.
A program that has complex control flow will require more
tests to achieve good code coverage and will be less
maintainable.
3. McCabe Cyclomatic Complexity: the proof in
the pudding
The results show that the files having a CC
value of 11 had the lowest probability of
being fault-prone (28%). Files with a CC
value of 38 had a probability of 50% of
being fault-prone. Files containing CC
values of 74 and up were determined to
have a 98% plus probability of being fault-
prone.
4. 5 Worst Modules by Maintainability
title modulename maintainability
Gms-Ci Credit.CommonControls.CADDDialog.Service.dll 48
Gms-Ci Credit.Metrics.Preference.Control.dll 49
Gms-Ci Credit.CTWB.DocumentsReceipt.Control.dll 50
Gms-Ci Credit.CTWB.DocumentsHistory.Control.dll 53
Gms-Ci Credit.CommonControls.ConflictInformation.Control.dll 53
Gus-Init1 Halos.Xml.DocGen.Generator.dll 56
Gus-Init1 Halos.Xml.DocGen.DocumentFactory.dll 71
Gus-Init1 Halos.Configuration.DynamicConfigurationManager.dll 74
Gus-Init1 GUS.WinApplication.Metrics.dll 75
Gus-Init1 GUS.WinApplication.ServiceAgent.dll 78
Gus-Init1 GUS.WinApplication.BulletinBoard.dll 78
TechnicalDebtTaskLib TechnicalDebtTaskLib.Tests.dll 66
TechnicalDebtTaskLib BuildProcessTemplate.dll 75
TechnicalDebtTaskLib TechnicalDebtTaskLib_Accessor.dll 78
TechnicalDebtTaskLib TechnicalDebtTaskLib.dll 79
The maintainability index is a synthesis of
three metrics: cyclomatic complexity, lines
of code, and computational complexity. Its
values are not expressed in units.
MAX(0,(171 - 5.2 * ln(Halstead Volume) -
0.23 * (Cyclomatic Complexity) - 16.2 *
ln(Lines of Code))*100 / 171)
Notas del editor
From http://www.enerjy.com/blog/?p=198
Remediation information at http://www.codinghorror.com/blog/2006/01/flattening-arrow-code.html