Visual Basic Support Guide

Previous Next

Visual Basic Support Guide
Visual Basic Support Guide
This guide describes Modernization Workbench (MW) support for the Visual Basic programming language (Microsoft Visual Basic Version 6). It includes a summary of supported tools, support notes and known limitations, and reference tables that describe the Visual Basic object (Level 1) and construct (Level 2) models created by the MW parser.
The following topics are discussed:
Supported Tools
Support Notes
Modeling Support in MW
Previous Next

© Copyright 2010 Micro Focus (IP) Limited. All Rights Reserved.


Supported Tools

Visual Basic Support Guide : Supported Tools
Supported Tools
Table 1‑1 describes the Repository-level tools and HyperView panes which are supported for Visual Basic. For details about a specific MW tool, see the workbench documentation set.
Table 1‑1
Supported MW Functionality
Area of MW Supported
Support Notes
Inventory
Visual Basic source objects are registered into workspaces with default extensions:
Visual Basic Project File = .VB Project File
Visual Basic File = .bas, .cls, .ctl, .frm
Library Desription File = .Library Description File
Verification
full support
Inventory Report
full support
Verification Report
full support
Reference Reports
Unreferred Report
Unresolved Report
Cross-Reference
Executive Report
Inventory Details and Repository Statistics only
Complexity Metrics
full support
Effort Estimation
full support
Diagrammer
full support
Quick Diagrammer
full support
Decision Resolution
Boundary decisions can be resolved to targets
Hyperview Source Pane
full support
Hyperview Context Pane
full support
Hyperview Clipper Pane
full support
Hyperview Advanced Search
Perform searches on individual Visual Basic files rather than project-wide searches
Hyperview Model Pane
Includes descriptions of the Visual Basic HyperCode constructs and their attributes
Hyperview Bird's Eye Pane
full support
Business Rule Manager
Includes the ability to create business rules manually or from Clipper lists


Support Notes

Visual Basic Support Guide : Support Notes
Support Notes
This section contains general support information and known limitations for Visual Basic in this release.
Note:
Be sure to check the workbench release notes for late-breaking issues not available at press time.


Registering Library Description Files

Visual Basic Support Guide : Support Notes : Registering Library Description Files
Registering Library Description Files
Visual Basic Project (.vbp) files contain references to Active X objects in dynamic link libraries. The following objects may be referenced:
•
DLLs
•
OCX controls
•
TLBs (type libraries)
•
OLBs (object libraries)
To successfully verify a VB Project file (.vbp), each referenced Active X object must be included in your MW project as a Library Description file.
Library Description (or XDL) files use the .xdl file extension, and must be manually generated and added to your project using the XDL.exe utility shipped with MW. XDL files populate the repository with required information about standard VB functions, classes, and dynamic link libraries.
Note:
Library Description information is required during verification. If all necessary XDLs are not registered and verified prior to verifying VB Project files, you will receive verification errors.
The process for adding Library Description information to your MW project consists of four steps:
•
Include MW’s default XDL files in your project.
•
Determine which Active X objects are referenced in your VBP files.
•
Generate an XDL file for each referenced Active X object.
•
Include, register, and verify the XDL files in your MW project.
See To create and register Library Description files: below for comprehensive instructions.
To create and register Library Description files:
1
Add the default XDL files to your project.
MW ships with a default set of XDL files stored in the /Program Files/Modernization Workbench/Templates/VB directory. Include all of these in your MW project.
2
Open a VB Project file and locate the first referenced Active X object.

In a VBP file, such references appear as “Reference=” or “Object=” statements using the following formats:
Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#D:\WINNT\System32\msstdfmt.dll#Microsoft Data Formatting Object Library
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX
3
Launch the XDL.exe utility (default location: /Modernization Workbench/bin).
4
Select File>Open.
5
Browse to the location where the referenced file (i.e. .dll, .ocx, .tlb, .olb) is stored.
6
Select the file and click Open.
7
Select File>SaveAs and save the XDL file to a location outside the workspace.
8
Repeat step 2-step 7 as needed for each VBP file and referenced object.
9
Register the newly created XDL files. Select the MW project in the Repository pane, then drag-and-drop the XDL files from the file system onto the Repository pane.
10
Verify all XDL files, including the default XDLs you added in step 1 above.


Boundary Decisions

Visual Basic Support Guide : Support Notes : Boundary Decisions
Boundary Decisions
You must specify boundary decisions in the Workspace Options dialog. See Preparing Projects in the workbench documentation set for details.


Known Limitations

Visual Basic Support Guide : Support Notes : Known Limitations
Known Limitations
The following constructs are not supported and are marked with the “Item was ignored by parser” message during verification:
AppActivate
ChDir
ChDrive
Close
Deftype
DeleteSetting
Erase
Error
Event
Get
GoSub...Return
GoTo
Implements
Input #
Kill
Line Input #
Lock
Lset
MkDir
Name
Open
Option Base
Option Compare
Option Private
Put
RaiseEvent
Randomize
Resume
RmDir
Rset
SaveSetting
Seek
Stop
Time
Exit
Width #


Modeling Support in MW

Visual Basic Support Guide : Modeling Support in MW
Modeling Support in MW
MW is a model-based technology that generates information about legacy applications at two levels:
•
Level 1 (or object-level) information describes the relationships between the objects that comprise an application: program source files, header files, and so forth.
•
Level 2 (or construct-level) information describes the relationships between the abstract syntactical constructs that comprise an object: sections, paragraphs, statements, conditions, variables, and so forth.
At both levels, the models are conceived as Entity Relationship Diagrams (ERDs). Each object or construct the parser generates is modeled as an entity in one of the diagrams. The models are represented in tree form to the end user.


Level 1 Modeling Support for Visual Basic

Visual Basic Support Guide : Modeling Support in MW : Level 1 Modeling Support for Visual Basic
Level 1 Modeling Support for Visual Basic
The Level 1 model for an application defines the relationships between the objects that comprise the application. These can be physical objects, like screens, libraries, and Visual Basic project files; or logical objects that identify abstract program elements (decisions, methods, functions, etc.).


Level 1 Metamodel

Visual Basic Support Guide : Modeling Support in MW : Level 1 Modeling Support for Visual Basic : Level 1 Metamodel
Level 1 Metamodel
Every entity the parser generates is an instance of an entity type. The Level 1 metamodel defines these types, or meta-entities, and their relationships. Figure 1‑1 shows the Level 1 metamodel.
Note:
The Level 1 metamodel is also referred to, in OMG terms, as the Knowledge Discovery Metamodel (KDM).
Figure 1‑1
Level 1 Metamodel
Click image to expand


Level 1 Model Table

Visual Basic Support Guide : Modeling Support in MW : Level 1 Modeling Support for Visual Basic : Level 1 Model Table
Level 1 Model Table
Table 1‑2 shows the objects in the Level 1 metamodel and their relationships.
Table 1‑2
Level 1 Model Table
Object
Relationships
Library
Contains Function
Contains Class
Library Description File
Defines
VB Class
Calls Method
Calls Method Decision
Defines Screen
Depends On Class
Has Method
Inherits Class
VB File
Included In VB Project File
VB Function
Calls Method
Depends On Class
VB Method
N/A
VB Project File
Defines
Includes VB File
Uses Library


Level 1 Relationship Projections

Visual Basic Support Guide : Modeling Support in MW : Level 1 Modeling Support for Visual Basic : Level 1 Relationship Projections
Level 1 Relationship Projections
The following tables describe relationships generated by Visual Basic statements in the Level 1 model.
VB Project File Relationship Projections
Table 1‑3
VB Project File Relationship Projections
Statement
Format
Relationship
Entities
ExeName32
Name
Title
Name=”name”
ExeName32=”dllname”
VB Project File
Defines
Library
Library.LibName=<name>
Library.Name=<dllname>
Reference
Reference=guid#ver#path\dllname#descr
VB Project File
Uses
Library
Library.Name=<dllname>
Object
Object=guid#ver#;dllname
VB Project File
Uses
Library
Library.Name=<dllname>
Module
Module=name; filename
VB Project File
Includes
VB File
VbFile.Name=<filename>
VbFile.Type=Module
Class
Class=name; filename
VB Project File
Includes
VB File
VbFile.Name=<filename>
VbFile.Type=Class
Form
Form=name; filename
VB Project File
Includes
VB File
VbFile.Name=<filename>
VbFile.Type=Form
UserControl
UserControl=name; filename
VB Project File
Includes
VB File
VbFile.Name=<filename>
VbFile.Type=UserControl
HelpFile
N/A
N/A
N/A
ResFile32
N/A
N/A
N/A
Library Description File Relationship Projections
Table 1‑4
Library Description File Relationship Projections
Statement
Format
Relationship
Entities
Name
ExeName
Name=”name”
File = ”dllname”
Library Description File
Defines
Library
Library.LibName=<name>
Library.Name=<dllname>
Interface
<interface name=”InterfaceName” > | <dispinterface name=” InterfaceName”>
Library
HasClass
VB Class
VbClass.Name=<Library.Name>.<InterfaceName>
VbClass.ClassName=<InterfaceName>
Coclass
<class name=”ClassName”>
Library
HasClass
VB Class
VbClass.Name=<Library.Name>.< ClassName >
VbClass.ClassName=<ClassName>
Method
<interface> <function name=”Name” invoke="MethodType” >
VB Class
Has
VB Method
VbMethod.Name=<VbClass.Name>.<Name>
VbMethod.MethodName=<Name>
VbMethod.MethodType=MethodType
VbMethod. AccessModifier=Public
Function
<module name=”ModuleName”> <function name=”Name”>
Library
HasFunction
VB Function
VbFunction.Name=
<Library.Name>.<ModuleName>.<Name>
VbFunction.FunctionName=<Name>
VbFunction. AccessModifier=Public
Class, Form, User Control Relationship Projections
Table 1‑5
Class, Form, User Control Relationship Projections
Statement
Format
Relationship
Entities
Name
Attribute VB_Name = “name”
Library
HasClass
VB Class
VB File
Defines
VB Class
For Forms:
VB Class
Defines
Map
VbClass.Name=<Library.Name>.<name>
VbClass.ClassName=<name>
Map.Name=<name>
Inheritance
Begin <ParentName> <ClassName>
VB Class
Inherits
VB Class
Property Get
<AccessModifier> Property Get <name> () As <ReturnType>
VB Class
Has
VB Method
VbMethod.Name=Get.<VbClass.Name>.<name>
VbMethod.MethodName=<name>
VbMethod.MethodType=PropertyGet
VbMethod. AccessModifier=
<AccessModifier>
Property Set
<AccessModifier> Property Set <name> (args)
VB Class
Has
VB Method
VbMethod.Name=Set.<VbClass.Name>.<name>
VbMethod.MethodName=<name>
VbMethod.MethodType=PropertySet
VbMethod. AccessModifier=
<AccessModifier>
Property Let
<AccessModifier> Property Let <name> () As <ReturnType>
VB Class
Has
VB Method
VbMethod.Name=Let.<VbClass.Name>.<name>
VbMethod.MethodName=<name>
VbMethod.MethodType=PropertyLet
VbMethod. AccessModifier=
<AccessModifier>
Function
<AccessModifier> Function <name> (args) As <ReturnType>
VB Class
Has
VB Method
VbMethod.Name=<VbClass.Name>.<name>
VbMethod.MethodName=<name>
VbMethod.MethodType=Method
VbMethod. AccessModifier=
<AccessModifier>
Sub
<AccessModifier> Sub <name> (args)
VB Class
Has
VB Method
VbMethod.Name=<VbClass.Name>.<name>
VbMethod.MethodName=<name>
VbMethod.MethodType=Method
VbMethod. AccessModifier=
<AccessModifier>
Method call
<Object>.<MethodName> (args)
VB Class
Calls
VB Method
VbMethod.MethodName= <MethodName >
Object var declaration
Dim <VarName> As <ClassName>
VB Class
DependsOn
VB Class
VbClass.ClassName=<ClassName>
Module Relationship Projections
Table 1‑6
Module Relationship Projections
Statement
Format
Relationship
Entities
Function
<AccessModifier> Function <name> (args) As <ReturnType>
Library
HasFunction
VB Function
VbFunction.Name=<Library.Name>.<name>
if public,
VbFunction.Name=<Library.Name>.<ModuleName>.<name>
otherwise;
VbFunction.FunctionName=<name>
VbMethod. AccessModifier=
<AccessModifier>
Sub
<AccessModifier> Sub <name> (args)
Library
HasFunction
VB Function
VbFunction.Name=<Library.Name>.<name>
if public,
VbFunction.Name=<Library.Name>.<ModuleName>.<name>
otherwise;
VbFunction.FunctionName=<name>
VbMethod. AccessModifier=
<AccessModifier>
Method call
<Object>.<MethodName> (args)
VB Function
Calls
VB Method
VbMethod.MethodName=<MethodName>
Object var declaration
Dim <VarName> As <ClassName>
VB Function
DependsOn
VB Class
VbClass.ClassName=<ClassName>


Complexity Metrics

Visual Basic Support Guide : Modeling Support in MW : Level 1 Modeling Support for Visual Basic : Complexity Metrics
Complexity Metrics
Table 1‑7 describes the industry standard and workbench-generated complexity metrics supported by the legacy estimation tools. Not all metrics will be available for your configuration.
Table 1‑8 and Table 1‑9 describe Visual Basic-specific details for the supported complexity metrics.
Table 1‑7
Complexity Metrics
Metric
Object Types
Description
Absolute Complexity
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
Binary Decisions divided by the number of statements.
Abstract Classes
Java Package, Java File
Number of abstract classes and interfaces.
Abstract Methods
Java Package, Java File
Number of abstract methods.
Abstractness
Java Package
Ratio of Number of Abstract Classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package.
Afferent Coupling
Java Package
Number of other packages that depend on classes in the package. An indicator of the package’s responsibility.
Areas
DMS DDL File, IDMS Schema File, IDMS Subschema
Number of areas.
Asynchronous Calls
Program
Number of asynchronous calls, such as Cobol INITIATE statements.
Average Absolute Complexity
Java Class, Java Interface, Java Package, Java File
Average Absolute Complexity of methods.
Average Binary Decisions
Java Class, Java Interface, Java Package, Java File
Average Binary Decisions of methods.
Average Catch Clauses
Java Class, Java Interface, Java Package, Java File
Average Catch Clauses in methods.
Average Computational Statements
Java Class, Java Interface, Java Package, Java File
Average Computational Statements of methods.
Average Conditional Complexity
Java Class, Java Interface, Java Package, Java File
Average Conditional Complexity of methods.
Average Cyclomatic Complexity
Java Class, Java Interface, Java Package, Java File, PB Object
Average Cyclomatic Complexity of methods.
Average Depth of Inheritance Hierarchy
Java Package, Java File
Average Depth of Inheritance Hierarchy of classes and interfaces.
Average Essential Complexity
Java Class, Java Interface, Java Package, Java File
Average Essential Complexity of methods.
Average Extended Cyclomatic Complexity
Java Class, Java Interface, Java Package, Java File
Average Extended Cyclomatic Complexity of methods.
Average IF Statements
Java Class, Java Interface, Java Package, Java File
Average IF Statements in methods.
Average Lack of Cohesion Per Type
Java Package, Java File
Average Lack of Cohesion of classes and interfaces.
Average Loop Statements
Java Class, Java Interface, Java Package, Java File
Average Loop Statements in methods.
Average Maximum Switch Cases
Java Class, Java Interface, Java Package, Java File
Average Maximum Switch Cases in methods.
Average Nested Block Depth
Java Class, Java Interface, Java Package, Java File, PB Object
Average Nested Block Depth of methods.
Average Parameters
Java Class, Java Interface, Java Package, Java File, PB Object
Average Parameters in methods.
Average Specialization Index Per Type
Java Package, Java File
Average Specialization Index of classes and interfaces.
Average Subtypes
Java Package
Average Subtypes in methods.
Average Switch Cases
Java Class, Java Interface, Java Package, Java File
Average Switch Cases in methods.
Average Switch Statements
Java Class, Java Interface, Java Package, Java File
Average Switch Statements in methods.
Average Unique Method Calls
Java Class, Java Interface, Java Package, Java File
Average Unique Method Calls in methods.
Binary Decisions
Java Method, PB Method, Program, VB Function, VB Method,
C/C++ Function, C++ Member Function
Number of branching conditions in the flow graph with two possible outcomes. Includes statements with implicit condition evaluation (loops, AT END, and so on).
Blank Lines
All source files
Number of blank lines of source (sequence number area content is ignored).
Catch Clauses
Java Method, PB Method
Number of catch clauses.
Classes
VB Library
Number of classes.
Columns
DDL File
Number of columns.
Comment Lines
PL/I File, PL/I Include File
Number of lines of source containing comments only and no code.
Comments Ratio
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, PB Method, PB Object
Number of Comments divided by Lines of Code.
Computational Statements
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
Number of statements performing arithmetic calculations.
Conditional Complexity
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
Binary Decisions plus Unique Operands in Conditions.
Conditional Statements
Program
Number of branching statements with nested statements executed under certain conditions, not including conditional GOTOs.
Constructors
C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, PB Method, PB Object
Number of constructors.
Control Cards Usages
JCL File, JCL Procedure
Number of DD statements referencing control cards identified in Legacy.xml to generate program to control card relationships.
Cyclomatic Complexity
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
v(G) = e - n + 2, where v(G) is the cyclomatic complexity of the flow graph (G) for the program in question, e is the number of edges in G, and n is the number of nodes. Quantity of decision logic. The number of linearly independent paths (minimum number of paths to be tested). v(G) = DE + 1, where DE is the number of binary decisions made in the program.
Data Elements
Copybook File, Program
Number of declared data items (elementary structures and their fields). For PL/I, the implicit variable DFHEIBLK for CICS statements is counted as a data element.
Data Members
C++ Class
Number of data members.
Data Sets
DMSII Database
Number of data sets.
Dead Data Elements
Program
Number of dead data elements in programs and used include files. Dead data elements are unused structures at any data level, all of whose parents and children are unused. For PL/I, number of declared data items in dead internal procedures.
Dead Data Elements from Includes
Program
Number of dead data elements in include files. Dead data elements are unused structures at any data level, all of whose parents and children are unused. For PL/I, N/A.
Dead Lines
Program
Number of dead lines in programs and used include files. Dead lines are source lines containing Dead Data Elements or Dead Statements. For Cobol, also source lines containing “dead constructs.” For more information on dead constructs, see the Parser Reference Manual.
Dead Lines from Includes
Program
Number of dead lines in include files. Dead lines are source lines containing Dead Data Elements from Includes or Dead Statements from Includes. For Cobol, also source lines containing “dead constructs.” For more information on dead constructs, see the Parser Reference Manual.
Dead Statements
Program
Number of dead statements in programs and used include files. A dead statement is a procedural statement that can never be reached during program execution. For PL/I, dead DECLARE statements are not calculated as dead statements.
Dead Statements from Includes
Program
Number of dead statements in include files. A dead statement is a procedural statement that can never be reached during program execution.
Depth of Inheritance Hierarchy
C++ Class, Java Class, Java Interface, PB Object
Maximum nesting of the inheritance hierarchy.
Destructors
C++ Class, VB Class
Number of destructors.
Difficulty
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
D = (n1 / 2) * (N2 / n2), where n1 is Unique Operators, N2 is Operands, and n2 is Unique Operands.
Disjoint Data Sets
DMSII Database
Number of disjoint data sets.
Efferent Coupling
Java Package
Number of other packages that the classes in the package depend on. An indicator of the package’s independence.
Entry Points
Program
Number of program entry points.
Error Estimate
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
B = E**(2/3) / 3000, where E is Programming Effort.
Essential Complexity
C/C++ Function, C++ Member Function, Java Method, PB Method, Program
Quantity of unstructured logic (a loop with an exiting GOTO statement, for example). v(G) for reduced graph without D-structured primes.
Exception Handling Statements
C/C++ Function, C++ Member Function, VB Function, VB Method
Number of exception handling statements.
EXEC Cataloged Procedure Steps
JCL File, JCL Procedure
Number of EXEC statements invoking cataloged procedures.
EXEC In-stream Procedure Steps
JCL File, JCL Procedure
Number of EXEC statements invoking instream procedures.
Executable Statements
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
All Cobol Procedure Division statements, plus CONTINUE and NEXT STATEMENT. All PL/I statements, except BEGIN, DECLARE, DO (block), END, ENTRY, PACKAGE, and PROCEDURE. All Natural statements, except DEFINE DATA and IGNORE. For object-oriented languages, all assignments, function calls (alone on a line), calls, returns, IF, DO, FOR, CHOOSE, EXIT, CONTINUE, and GOTO statements.
Extended Cyclomatic Complexity
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
Cyclomatic Complexity plus Logical Operators in Conditions. Number of all paths in the program.
Fields
AS/400 Database File, Java Class, Java Interface, Java Package, Java File, PB Object, VB Class
Number of fields.
Fields of Adabas File Number
Natural DDM File
Number of fields of Adabas file number.
Foreign Keys
DDL File
Number of foreign keys.
Function Calls
C/C++ Function, C++ Member Function, VB Function, VB Method
Number of function calls.
Function Points
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, VB Class, VB Function, VB Method
Lines of Code divided by K, where K depends on the language: Cobol=77, Natural=52, PL/I=67, PowerBuilder=24. For RPG, Lines of Code/K + 0.5, where K=61. Estimate of the number of end-user business functions implemented by the program.
Functions
VB Library
Number of functions.
Global Data Items
DMSII Database
Number of global data items.
GoTo Statements
C/C++ Function, C++ Member Function, Program, VB Function, VB Method
Number of GOTO statements, including conditional GOTOs.
Hidden Fields
Map
Number of hidden fields.
IF Statements
C/C++ Function, C++ Member Function, Java Method, PB Method, VB Function, VB Method
Number of IF statements.
Import Statements
Java Package, Java File
Number of import statements.
Include Copybook Statements
APS File, APS Include File
Number of include copybook statements.
Include Data Structure
APS Application
Number of included data structures.
Include DDI
APS Application
Number of included DDIs.
Include DDL/PSB
APS Application
Number of included data definitions.
Include Global Data Area Statements
Natural File, Natural Subroutine File
Number of included global data area statements.
Include Local Data Area Statements
Natural File, Natural Subroutine File
Number of included local data area statements.
Include Macro Statements
APS File, APS Include File
Number of included macro statements.
Include Macro/Copybook
APS Application
Number of included macros/copybooks.
Include Parameter Data Area Statements
Natural File, Natural Subroutine File
Number of included parameter data area statements.
Include Program
APS Application
Number of included programs.
Include Report
APS Application
Number of included reports.
Include Resource Statement
Copybook File, Cobol File (ACUCOBOL only)
Number of included resource statements.
Include Screen
APS Application
Number of included screens.
Include Statements
All source files, except DDL File, Java Interface, Java File, PB Object
Number of language-specific include statements.
Inherited Methods
C++ Class, VB Class
Number of inherited methods.
Inner Call Statements
Program
Number of statements that invoke Inner Procedures.
Inner Procedures
Program
Number of structured pieces of code that cannot be invoked from external programs (Cobol paragraphs, inner PL/I procedures, Natural inline subroutines).
Input Fields
Map
Number of input fields.
Input/Output Fields
Map
Number of input/output fields.
Instability
Java Package
Ratio of Efferent Coupling (Ce) to total coupling (Ce + Ca), such that I = Ce / (Ce + Ca). An indicator of the package’s resilience to change.
Intelligent Content
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
I = L * V, where L is Program Level and V is Program Volume. Complexity of a given algorithm independent of the language used to express the algorithm.
Interfaces
Java Class, Java Interface, Java Package, Java File
Number of interfaces.
IO Statements
Program
Number of statements performing input/output operations.
Key Fields
AS/400 Database File
Number of key fields.
Labels
C/C++ Function, C++ Member Function, VB Function, VB Method
Number of labels.
Lack of Cohesion
Java Class, Java Interface
LOCM = (m - sum(mA)/a1+a2) / (m-1), where mA is the number of methods that access class attributes.
Lines of Code
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
Number of lines of code, including copybooks (if applicable), but not including comments and blank lines.
Lines with Both Comments and Code
PL/I File, PL/I Include File
Number of lines of source containing both comments and code.
Lines with Comments
All source files, except PL/I, PL/I Include, and Java Files
Number of lines of source containing comments, including inline comments placed on lines with statements.
Local Data Items
C/C++ Function, C++ Member Function, VB Function, VB Method
Number of local data items.
Logical Operators in Conditions
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, VB Class, VB Function, VB Method
Number of binary logical operators used in conditions.
Logical Records
IDMS Subschema File
Number of logical records.
Loop Statements
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
Number of repetitively executing statements.
Macro Assignments
PL/I File, PL/I Include File
Number of assignments to global macro variables outside any macro procedure.
Macro Declarations
PL/I File, PL/I Include File
Number of global macro variables. Macro variables within macro procedures are not counted.
Macro Lines
PL/I File, PL/I Include File
Number of lines for include statements, macro invocations, declarations, macro procedures, and %-statements. Blank lines and comments lines are ignored.
Macro Procedures
PL/I File, PL/I Include File
Number of macro procedures declared in the file.
Macro Statements
PL/I File, PL/I Include File
Number of macro statements.
Maintainability Index
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
MI = 171 - 5.2 * ln (PgmVolume) - 0.23 * ExtCycComp - 16.2 * ln (LOC) + 50 * sin (sqrt (2.46 * CommentLines/SourceLines)), where PgmVolume is Program Volume, ExtCycComp is Extended Cyclomatic Complexity, LOC is Lines of Code, CommentLines is Comment Lines, and SourceLines is Source Lines.
Maps
Natural Map
Number of maps.
Maximum Depth of Logic Nesting
C/C++ Function, C++ Member Function
Maximum nesting of logic.
Maximum Switch Cases
C/C++ Function, C++ Member Function, Java Method, PB Method
Maximum Switch Cases.
Member Function Calls
C/C++ Function, C++ Member Function
Number of member function calls.
Member Functions
C++ Class
Number of member functions.
Method Calls
VB Function, VB Method
Number of method calls.
Methods
Java Class, Java Interface, Java Package, Java File, PB Object, VB Class
Number of methods.
Nested Block Depth
Java Method, PB Method
Maximum nesting of IF, CHOOSE, TRY, DO, SWITCH, or FOR constructs. 1 is added to the depth in the IF and ELSE parts of IF statements, the bodies of loops, and the code in each case of a Choose statement.
Nesting Level
Program, VB Function, VB Method
Maximum nesting of conditional statements within conditional statements (0 if no conditional statements, 1 if no nesting).
Non-returning Calls
Program
Number of non-returning calls, such as Cobol XCTL statements.
Normalized Distance
Java Package
Perpendicular distance of the package from the idealized line A + I = 1. An indicator of the package’s balance between abstractness and stability.
Number of Comments
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, PB Method, PB Object
For C/C++, number of items containing text preceded by // or enclosed between /* and */.
For Java, number of lines of source containing comments, including inline comments placed on lines with statements.
For PowerBuilder, number of lines of source containing comments only and no code.
Number of Controls
PB DataWindow
Number of controls.
Number of Entries
CSD File, FCT File, PCT File, Valtab File
Number of entries.
Number of Executes
ECL File
Number of executes.
Number of Lines
PB DataWindow, PB Query, PB Pipeline
Number of lines.
Number of PCBs
PSB File
Number of PCBs.
Number of Processor Calls
ECL File
Number of processor calls.
Omit Fields
AS/400 Database File
Number of Omit fields.
Operands
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
Number of operand occurrences (N2). Operands are variables and literals used in operators. Compare Unique Operands.
Operators
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
Number of operator occurrences (N1). Operators are executable statements and unary and binary operations. Compare Unique Operators.
Output Fields
Map
Number of output fields.
Overridden Methods
Java Class, Java Interface, Java Package, Java File
Number of overridden methods.
Parameters
C/C++ Function, C++ Member Function, Java Method, PB Method, Program, VB Function, VB Method
Number of Cobol Procedure Division USING...RETURNING parameters. Number of PL/I PROCEDURE parameters. Number of Natural PARAMETER and PARAMETER USING parameters. Otherwise, number of parameters in method calls.
Path Groups
IDMS Subschema File
Number of path groups.
Pointers
C/C++ Function, C++ Member Function, C++ Class, Program, VB Function, VB Method
Number of data elements declared as pointers.
Primary Keys
DDL File
Number of primary keys.
Program Length
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
N = N1 + N2, where N1 is Operators and N2 is Operands.
Program Level
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
L = 1 / D, where D is Difficulty.
Program Volume
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
V = N * log2(n), where N is Program Length and n is Vocabulary. Minimum number of bits required to code the program.
Programming Effort
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
E = V / L, where V is Program Volume and L is Program Level. Estimated mental effort required to develop the program.
Programming Time
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
T = E / 18, where E is the Programming Effort and 18 is Stroud’s Number. Estimated amount of time required to implement the algorithm, in seconds.
Public Data Members
C++ Class
Number of public data members.
Public Fields
VB Class
Number of public fields.
Public Member Functions
C++ Class
Number of public member functions.
Public Methods
VB Class
Number of public methods.
Records
ADL File, AS/400 Database File, DMS DDL File, IDMS Schema File, IDMS Subschema File
Number of records.
Remapped Data Sets
DMSII Database
Number of remapped data sets.
Response for Class
C++ Class, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object
Response for class.
Returning Calls
Program
Number of returning calls, such as Cobol CALL or LINK statements.
Screens
AS/400 Device Description, BMS File, DPS File, ICL Form, MFS File
Number of screens.
Segments
DBD File
Number of segments.
SELECT (SWITCH) Statements
VB Method
Number of SWITCH statements.
Select Fields
AS/400 Database File
Number of select fields.
Sets
ADL File, DMS DDL File, DMSII Database, IDMS Schema File, IDMS Subschema File
Number of sets.
Sliceable Dead Lines
PL/I Program
Number of Dead Lines that can be sliced using the Application Architect Dead Code Elimination method. Dead procedures containing either preprocessor statements or statements subject to macro preprocessor replacement are not counted as sliceable dead lines, since it is not always possible to determine whether they can be safely removed. Lines from include files are not counted.
Source Lines
All source files
Number of lines of source.
Specialization Index
Java Class, Java Interface
Number of subclasses divided by number of superclasses.
Static Data Items
C/C++ Function, C++ Member Function, VB Function, VB Method
Number of static data items.
Static Data Members
C++ Class
Number of static data members.
Static Fields
Java Class, Java Interface, Java Package, Java File, PB Object, VB Class
Number of static fields.
Static Functions
C++ Class
Number of static functions.
Static Member Functions
C++ Class
Number of static member functions.
Static Methods
Java Class, Java Interface, Java Package, Java File, VB Class
Number of static methods.
Steps
JCL File, JCL Procedure, Job
Number of steps.
Subsets
DMSII Database
Number of subsets.
Subtypes
Java Class, Java Interface, Java File, PB Object
Number of subtypes.
Switch Cases
C/C++ Function, C++ Member Function, Java Method, PB Method
Number of SWITCH cases.
Switch/Choose Statements
Java Method, PB Method
Number of SWITCH in Java, CHOOSE statements. in PowerBuilders.
SWITCH/SELECT Statements
C/C++ Function, C++ Member Function, VB Function
Number of SWITCH statements.
Tables
DDL File
Number of tables.
Total EXEC Cataloged Procedure Steps
JCL File
Number of EXEC statements invoking cataloged procedures in the job and invoked procedures. If a procedure is invoked multiple times, it is counted each time.
Total Include Copybook Statements
APS File, APS Include
Total number of include copybook statements.
Total Include Statements
Assembler File, BMS File, Cobol File, Copybook File, DMS II DASDL File, ECL File, JCL File, MFS File, Natural File, Natural Subroutine File, PL/I File, PSB File, RPG File, VB Project File, WFL File
Total Include Statements. For PL/I, all the include statements in the file and the used include files.
Unique Function Calls
C/C++ Function, C++ Member Function
Number of unique function calls.
Unique Member Function Calls
C/C++ Function, C++ Member Function
Number of unique member function calls.
Unique Method Calls
Java Method, PB Method, PB Object
Number of distinct method calls.
Unique Operands
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
Number of distinct operands (n2). Operands are variables and literals used in operators. Uniqueness of literals is determined by their notation. Compare Operands.
Unique Operands in Conditions
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
Number of distinct operands used in conditions.
Unique Operators
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
Number of distinct operators (n1). Operators are statements and unary and binary operations. Compare Operators.
Unique System Macro Instructions
Assembler File
Number of unique system macro instructions.
Vocabulary
C/C++ Function, C++ Member Function, C++ Class, Java Method, Java Class, Java Interface, Java Package, Java File, Program, PB Method, PB Object, VB Class, VB Function, VB Method
n = n1 + n2, where n1 is the number of Unique Operators and n2 is the number of Unique Operands.
Weighted Methods
Java Class, Java Interface, Java Package, Java File, PB Object
Number of weighted methods.
Detailed Description of Visual Basic Complexity Metrics
Table 1‑8
Detailed Description of VB Function and VB Method Complexity Metrics
Metric
Statements
Binary Decisions
DoLoop, For EachNext, ForNext, If (# of ElseIf + 1), Select (# of Case except Case Else), While
Catch Statements
On Error
Computational Statements
Let (for numeric operands)
Conditional Statements
DoLoop, For EachNext, ForNext, If, On expr, On Error, Select, While
Executable Statements
AppActivate, Beep, Call, ChDir, ChDrive, Close, Date, DeleteSetting, DoLoop, Erase, Error, Exit, FileCopy, For EachNext, ForNext, Get, GoSub, GoTo, If, Input, Kill, Let, Line Input, Load, Lock, LSet, Mid, MidB, MkDir, Name, On Error, On expr, Open, Print, Put, RaiseEvent, Randomize, Reset, Resume, Return, RmDir, RSet, SaveSetting, Seek, Select, SendKeys, Set, SetAttr, Stop, Time, Unload, Unlock, While, Width, With, Write
Function Calls
All intrinsic and user-defined function calls,
Call statements
GoTo Statements
GoSub, GoTo
If Statements
If
Labels
Line labels (lbl:)
Local Items
All variables declared,
all named constants declared
Logical Operators in Conditions
And, Or, Eqv, Imp, Xor in conditions of Conditional statements
Loop Statements
DoLoop, For EachNext, ForNext, While
Method Calls
All methods call
Nesting Level
Maximum nesting of Conditional statements
Operands
All variables and constants in executable statements
Operators
All Executable statements,
intrinsic or user-defined function calls,
&, *, +, -, /, \, ^, Mod,
And, Or, Xor, Not, Eqv, Imp,
>, <, >=, <=, =, <>, Is, Like,
AddressOf,
(subscript)
Parameters
Function or method parameters
Pointers
Pointers
Static Items
Data items declared as Static; local data items of Static function (method)
Switch Statements
Select
Unique Operands in Conditions
Unique operands in conditions of Conditional statements
Table 1‑9
Detailed Description of VB Class Complexity Metrics
Metric
Statements
Methods
All methods
Public Methods
Public methods
Inherited Methods
Inherited methods
Constructors
Class_Initialize method
Destructors
Class_Terminate method
Fields
All variables declared,
all named constants declared
Public Fields
Public fields


Level 2 Modeling Support for Visual Basic

Visual Basic Support Guide : Modeling Support in MW : Level 2 Modeling Support for Visual Basic
Level 2 Modeling Support for Visual Basic
The Level 2 model for an object defines its syntax. It shows in abstract form how the syntactical constructs that comprise the object (constants, expressions, variables, etc.) are related.


Level 2 Metamodel

Visual Basic Support Guide : Modeling Support in MW : Level 2 Modeling Support for Visual Basic : Level 2 Metamodel
Level 2 Metamodel
Each construct the parser generates is an instance of an entity type. The Level 2 metamodel defines these types, or meta-entities, and their relationships. Figure 1‑2 shows the Level 2 metamodel.
Note:
The Level 2 metamodel is also referred to, in OMG terms, as the Abstract Syntax Tree Metamodel (ASTM).
Figure 1‑2
Level 2 Metamodel


Level 2 Model Table

Visual Basic Support Guide : Modeling Support in MW : Level 2 Modeling Support for Visual Basic : Level 2 Model Table
Level 2 Model Table
Table 1‑10 describes the relationships for constructs in the Level 2 metamodel. A construct that “inherits from” other constructs can be thought of in “child/parent” terms. The child construct inherits all attribute values and relationships of the parent.
Table 1‑10
Level 2 Model Table
Construct
Relationships
Block
Sequence of statements (no relationships)
Class Definition
Inherits from Type Definition
Condition
Case Branch: WHEN statement
Then Branch: statements to execute when a test is met.
Inherits from Expression
Constant
Inherits from Expression
Declaration
Instances: all references to the data item
Type Definition: definition of the type
Inherits from [Insert Xref]
Inherits from [Insert Xref]
Enumeration Type Definition
Inherits from Type Definition
Expression
Select: SELECT statement that corresponds to the expression.
IF Statement: IF statement that corresponds to the expression
IF Statement
Condition: the test under IF
Else Branch: default branch of a conditional
Inherits from Statement
GO TO statement
GoTo Destination Statement: the statement to which the control is transferred
Inherits from Statement
Label
GoTo Statements: all references to the GOTO statements, which transfer control to this label.
Inherits from Declaration
Library
VB Library (no relationships)
Select Statement
Condition: the expression in the SELECT statement is evaluated and its value is saved
Inherits from Statement
Slice From Array
Inherits from Expression
Statement
If For Then Branch: reference to the IF Statement THEN branch which contains this statement
If For Else Branch: reference to the IF Statement ELSE branch which contains this statement
Select Statement: select statement
Subroutine
Procedure, function, method, or property declaration (no relationships)
Structure Type Definition
Inherits from Type Definition
Type Definition
Usages: all references to usages of the class
Variable
Declaration: declaration of the data item
Inherits from Expression


Construct Attributes

Visual Basic Support Guide : Modeling Support in MW : Level 2 Modeling Support for Visual Basic : Construct Attributes
Construct Attributes
Table 1‑11 describes the attributes of constructs in the Visual Basic level 2 model.
Table 1‑11
Table of Attributes for Visual Basic
Attribute
Construct(s)
Attribute Description
Name
Library
Type Definition
Class Ddefinition
Structure Type Definition
Enumeration Type Definition
Expression
Condition
Constant
Slice From Array
Declaration
Label
Variable
String: name of the construct
Value
Constant
Slice From Array
Declaration
Label
Variable
String: value of the construct
LabelName
Label
Variable
String: name of the label
Kind
Block
Class Definition
Condition
Constant
Enumeration Type Definition
Expression
If Statement
GO TO statement
Label
Library
Select Statement
Slice From Array
Statement
Structure Type Definition
Subroutine
Type Definition
Declaration
Variable
String: kind of the construct
Faked
Statement
If Statement
Select Statement
GO TO statement
Block
Subroutine
Library
Type definition
Class definition
Structure type definition
Enumeration type definition
Expression
Condition
Constant
Slice From Array
Declaration
Label
Variable
Boolean: tag indicating that the entity is faked and is not present in the parse tree
Text
Condition
Constant
Slice From Array
Declaration
Label
Variable
String: complete text of the construct


Asset Transformation Workbench Analyzer for Eclipse

Corporate Headquarters
International Business Machines Corporation
New Orchard Road
Armonk, New York 10504
Tel +1 (914) 499-1900

www.ibm.com

© 2006 International Business Machines Corporation
All rights reserved.
This document applies to IBM Asset Transformation Workbench (product number 5724-R03) and to all subsequent releases and modifications. For the latest information about this product, please refer to the Release Notes.
No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of IBM. Information in this document is subject to change without notice and is not guaranteed to be error-free.
Licensed Materials - Property of IBM.
Product Reference: IBM Asset Transformation Workbench v2.1
Document Reference: REL7.3DOC13.A

RescueWare is a registered trademark of Relativity Technologies, Inc. All other brands mentioned in this document are trademarks or registered trademarks of their respective holders.

www.relativity.com


Relativity Modernization Workbench Copyright Page

Corporate Headquarters
Relativity Technologies
2300 Rexwoods Drive
Suite 100
Raleigh, NC 27607
Tel +1 (919) 786-2800
Fax +1 (919) 786-2850

www.relativity.com

© 2005-07 Relativity Technologies
All rights reserved.
Printed in the United States of America.

RescueWare is a registered trademark of Relativity Technologies, Inc. All other brands mentioned in this document are trademarks or registered trademarks of their respective holders.

The software supplied with this document is the property of Relativity Technologies and is furnished under a license agreement. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Relativity Technologies, Inc. Information in this document is subject to change without notice and is not guaranteed to be error-free.

For the latest information about this product, please refer to the Release Notes.


Relativity Modernization Workbench Copyright Page

Corporate Headquarters
Relativity Technologies
2300 Rexwoods Drive
Suite 100
Raleigh, NC 27607
Tel +1 (919) 786-2800
Fax +1 (919) 786-2850

www.relativity.com

© 2005-06 Relativity Technologies
All rights reserved.
Printed in the United States of America.

RescueWare is a registered trademark of Relativity Technologies, Inc. All other brands mentioned in this document are trademarks or registered trademarks of their respective holders.

The software supplied with this document is the property of Relativity Technologies and is furnished under a license agreement. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Relativity Technologies, Inc. Information in this document is subject to change without notice and is not guaranteed to be error-free.

For the latest information about this product, please refer to the Release Notes.


VisualBasic.1.9.1.html

Visual Basic Support Guide : Modeling Support in MW : Level 1 Modeling Support for Visual Basic : Level 1 Metamodel


VisualBasic.1.14.1.html

Visual Basic Support Guide : Modeling Support in MW : Level 2 Modeling Support for Visual Basic : Level 2 Metamodel


VisualBasic-1004259.html

The Level 1 model for an application defines the relationships between the objects that comprise the application. These can be physical objects, like screens, libraries, and Visual Basic project files; or logical objects that identify abstract program elements (decisions, methods, functions, etc.).


VisualBasic-1004302.html

The Level 2 model for an object defines its syntax. It shows in abstract form how the syntactical constructs that comprise the object (constants, expressions, variables, etc.) are related.