Different versions of Project Analyzer may report different values for the same metric. There can be changes with the definition of a metric. There can also be improvements in the code analysis, which produces more accurate metrics as a by-product.
If you intend to compare projects, or different versions of the same project, you should analyze them with the same version of Project Analyzer and with the same settings. Comparing metrics stored with different Project Analyzer versions can lead to the wrong conclusions about the quality or development done on the code.
This page is about changes to metrics: the way they are defined and calculated. This page lists no new metrics, only old ones that were changed.
Tip: If you wish to measure the amount of change that affects your old metrics data, do a simple test: Analyze the same project with the current Project Analyzer and your previous version. Compare the values you get. The metrics with large changes should not be used for comparison.
The following is a list of the known changes to metrics in Project Analyzer v8.x and v9.x. Other changes can exist, especially under some specific circumstances.
Metric | Description | Projects affected | Effect |
---|---|---|---|
Cyclomatic complexity CC, CC2, CC3, TCC, DECDENS |
Each target line of On..GoTo and On..GoSub counts as a decision. | Classic VB, VBA | Slight increase |
STMTc | The calculation routines for STMTc have been updated, which may result in slight changes to the values reported. Yield and Throw are now included in STMTc. Due to an error, STMTc previosly counted the following statements twice, even though they must be counted only once: On Error GoTo, On..GoTo, On..GoSub. | All | Slight change |
STMTnc | Since this metric depends on STMTc, the same changes affect it as well, but in reverse. | All | Slight change |
LEN | Calculation includes names of projects and compiler constants, which were ignored before. | All | Slight change |
Metric | Description | Projects affected | Effect |
---|---|---|---|
VARS, VARSloc | Block-level local variables (several local variables with the same name) are now included in the variable count metrics. | VB.NET | Increase |
CONSTS | Block-level local constants (several local constants with the same name) are now counted in CONSTS. Rarely seen in real code. | VB.NET | Slight increase |
Metric | Description | Projects affected | Effect |
---|---|---|---|
TCC for classes | TCC for a class now counts complexity of Custom Event accessors too. Project Analyzer v8.x did not include them. This only affects classes with Custom Events. The project-level TCC is not affected by the change. | VB.NET 2005 | Increase |
System complexity SC, SYSC, RSYSC, SFOUT |
Project Analyzer v9.0 improved the analysis of late-bound calls. In projects using late binding, system complexity related metrics may differ significantly from values stored with previous Project Analyzer versions. | All with late binding | None to significant
-21% to +19% |
Dead code metrics dPROCS, dVARS, dCONSTS, dLINES, DEAD |
Due to more accurate analysis, dead code metrics may have changed. | All | Slight change |
VARS, VARSloc | Implicit arrays, those declared via ReDim without a preceding Dim, are now included in the variable count metrics. | VB 3.0 - 6.0 | Slight increase |
Metric | Description | Projects affected | Effect |
---|---|---|---|
DCALLT, maxDCALLT | DCALLT has been fixed for recursive call trees. What is more, it is now being approximated for complex recursive call trees. | All | Increase (fix) Decrease (approximation) |
AHF, MHF | A bug caused MHF and AHF to be miscalculated by Project Analyzer v8.0. It has been fixed. The bug didn't affect all projects, just some. If MHF or AHF changed a lot, this indicates the fix affected your program. | VB.NET | None to significant |
Metric | Description | Projects affected | Effect |
---|---|---|---|
VARS ⇒ VARSloc | VARSloc (local variables) was previous called VARS. It has been renamed to avoid confusion with other variable counts. | All | |
CDENS ⇒ CALLDENS | CALLDENS (call density) was previously called CDENS. It has been renamed for clarity. | All | |
CALLS, CALLDENS | Setting the function return value (myfunc = retval) is no longer counted in CALLS or CALLDENS. | All | Significant decrease -15% to -62% |
LLINES, LLOC, LLOC% | Attribute lines (VB 4.0 - 6.0) are no longer counted into LLOC or LLINES (nor into STMT or STMTd either, for that matter).
They can thus appear to have decreased a little. For the same reason, LLOC% may also have decreased a little.
Slightly decreased LLOC or LLINES is not deleted code! |
VB 4.0 - 6.0 | Slight decrease LLOC and LLINES 0%..-2% |
LLOC'%, LLOW%, MCOMM% | If the amount of code decreases as mentioned above (LLOC), the amount of commentation and whitespace increases accordingly. | VB 4.0 - 6.0 | Slight increase |
Statement counts STMT*, XQT, CTRL |
The statement count metrics may have changed slightly due to subtle changes in the counting routines. | All | Slight changes 0%..-5% |
dVARS, DEAD | The number of dead variables now always includes variables that are read only or written only. This increases both dVARS and DEAD. | All | Increase |
LENP | LENP Length of procedure names doesn't count the length of Operator names as Operator names are pre-defined. This is a definition update for VB.NET 2005, not a real change. | VB.NET 2005 | None |
Object-oriented metric changes | |||
MOOD metrics | MOOD metrics take both Property Set and Get accessors into account. In Project Analyzer v7, each VB.NET property was taken only once because Get/Set always have the same scope in VB.NET 2002 and 2003. Now that VB.NET 2005 allows different scopes for Get/Set, we consider each accessor. For the sake of conformance, we do the same for 2002 and as well. The change gives more weight to properties. | VB.NET 2002 and 2003 | Small |
AIF, MIF | MIF and AIF were reported too high by Project Analyzer v7. Therefore, old MIF and AIF values are no longer displayed. | VB.NET | Breaking change; significant decrease |
PF | Classes with explicit Protected Overrides Sub Finalize is not counted as it is derived from System.Object, not your own classes. |
VB.NET with Sub Finalize | Decrease if lots of Finalize |
RFC, RFC', CBO, MPC | Improved analysis can have found new calls (such as calls to constructors), which increases RFC, RFC', CBO and MPC. | Projects with classes | Increase RFC 0%..+3% RFC' 0%..+49% CBO 0%..+26% MPC 0%..+17% |
LCOM2, LCOM3 | Constructors and destructors are no longer counted as methods for LCOM2 and LCOM3, as they frequently access many or all variables in a class. | Projects with classes | Increase 0%..+13% |
WMCi, VARSi | Bug fix: WMCi and VARSi were erroneously zero for projects with just 1 class. | Projects with 1 class | Increase |
Changes with complexity, call tree and fan-in/fan-out metrics | |||
Cyclomatic complexity CC, CC2, CC3, TCC |
CC, CC2, CC3, TCC: Each Catch branch counts as one decision (previously none) and Catch..When counts as two (previously none). An unconditional Do..Loop does not add complexity (previously added 1). CC2 now counts Boolean operators in Catch..When (previously not). An additional change affects class-level TCC: A bug caused too low TCC for abstract classes with MustOverride procedures. The magnitude of that bug was equal to the number of MustOverride procedures. |
All More changes with VB.NET |
Slight changes |
DCOND, DLOOP | Fix: End While now correctly terminates a While loop for DCOND and DLOOP. The bug caused too high values for DCOND and DLOOP. Maximum bug effect: +1 for each End While . |
VB.NET with While.. |
Small decrease |
System complexity SC, DC, SYSC, RSYSC |
The values of DC, SYSC and RSYSC have changed compared to values reported by earlier versions.
|
All | Noticeable change
SC -3%..22% DC -14%..+19% SYSC RSYSC |
DCALLT, maxDCALLT, LLOCt | The call tree metrics can have increased due to a) improved analysis that finds more calls and b) due to corrections in the way these metrics are calculated. The increases vary from none to relatively high values. Large increases are possible for individual functions. |
All | Large increases possible
maxDCALLT DCALLT 0..+70% LLOCt 0..+34% |
SFIN, SFOUT for files | Late-bound calls now add to file-level SFIN and SFOUT. In Project Analyzer v7, late-bound calls were not counted. To get back old behavior, disable late-bound analysis in the General options dialog.
Improved analysis can also have found new calls, which further increases SFIN and SFOUT. |
All | Increase 0% to +76% |
SFIN, SFOUT for procedures | Improved analysis can have found new calls, which increases SFIN and SFOUT, especially for calls to constructors and default members. | All | Increase 0% to +15% |
Information flow IFIN, IFOUT, IFIO, IC1 |
The information flow metrics now report different values compared to earlier Project Analyzer versions. The changes are due to improvements in determining "in" and "out" parameters for IFIN and IFOUT. | All | Noticeable changes
IFIN -2%..+7% IFOUT 0..+11% IFIO 0..+10% IC1 -2%..+16% |
The change percentages in the above table are estimated based on min..max changes found in analysis of 17 VB6 projects with Project Analyzer v7.1.01 and v8.0.01, and 20 VB6 projects with Project Analyzer v8.0.01 and v9.0.01. The changes are project-level averages (min..max). Changes with individual files, classes, procedures or even projects can be larger.