Understand 2.0 User Guide
Understand 2.0 User Guide
Reference Manual
Version 2.0
January 2009
Scientific Toolworks, Inc.
230 N 1680 E, Ste. OP1
St George, UT 84790
Section Page
What is Understand 2.0? 1–2
Licensing Issues 1–3
For Those Who Don’t Like to Read Manuals 1–5
Understand 2.0 has analysis features that help you quickly answer
questions such as:
• What is this entity?
• Where is it changed?
• Where is it referenced?
• Who depends on it?
• What does it depend on?
Understand 2.0 has architecture features that help you create
hierarchical aggregations of source code units. You can name these
units and manipulate them in various ways to create interesting
hierarchies for analysis.
Licensing Issues
Understand 2.0 is available in several editions and variants. They all
use the same installation; the license code controls the feature set.
....................................................................................................
Understand 2.0 The Understand 2.0 editions have different sets of features related
Editions to metrics, architectures, and snapshots. The editions are:
• Understand 2.0 Engineer
• Understand 2.0 Pro
• Understand 2.0 Analyst
(Understand 2.0 Non-Commercial has all features of Understand 2.0
Analyst, but is available only to non-commercial users.)
This manual identifies features that are only available in certain
editions using icons. If the icon is at the start of a section, it applies
to the entire section. Otherwise, it applies only to the paragraph it is
next to.
• Analyst: This feature is available only if you have the “Analyst”
edition.
• Pro/Analyst: This feature is available if you have the “Pro”
edition or the “Analyst” edition.
• No icon: The feature is available in all editions.
The Understand 2.0 title bar shows which edition you are using. If
you have licenses for more than one edition, you can change the
current edition by choosing Help->Run at License Level and then
restarting Understand 2.0.
....................................................................................................
Understand 2.0 Understand 2.0 supports Ada, C/C++/C#, FORTRAN, Java,
Language Variants JOVIAL, Pascal, and PL/M.
The Engineer edition of Understand 2.0 supports only C/C++, C#,
and Java. The “Analyst” and “Pro” editions of Understand 2.0 come
in two language variants:
• L1: C/C++/C#, Java, Pascal/Delphi, FORTRAN
• L2: C/C++/C#, Java, Pascal/Delphi, FORTRAN, Ada, PL/M,
JOVIAL
This manual describes all languages supported by any variant.
However, this manual does not provide detailed descriptions of how
specific language features are handled.
The following list provides a brief overview of the language versions
and/or compilers supported:
• Ada: Understand 2.0 supports Ada83, Ada95, and Ada05 code,
separately, or in combination.
• C/C++: Understand 2.0 analyzes K&R or ANSI C source code
and most constructs of the C++ language. Understand 2.0 works
with any C compiler, and has been tested with most of the
popular ones. Note that C++ templates are not yet supported.
• C#: Understand 2.0 supports C#.
• FORTRAN: Understand 2.0 supports FORTRAN 77, FORTRAN
90, and FORTRAN 95, in both free and fixed format. Extensions
supported include Harris FORTRAN and DEC FORTRAN. We
often expand Understand 2.0 to support common compiler
extensions. If you find that the compiler extensions you are using
are not currently supported, contact us at support@[Link].
• Java: Understand 2.0 supports most of JDK 1.3, 1.4, 5, and 6.
Specifically, the generics introduced in JDK 5 are not currently
supported. Source code containing generics may be analyzed
but generics information will be ignored.
• JOVIAL: JOVIAL73 and JOVIAL3 are supported.
• Pascal: Understand 2.0 supports all versions of Borland's Delphi
language and Borland's Turbo Pascal language. It also supports
ISO 7185: 1990 (also known as Unextended Pascal) with DEC
Pascal extensions. You can also enable support for Ingres
embedded SQL statements.
• PL/M: The standard version for PL/M 80/86 is supported.
Section Page
Using Understand 2.0 Windows 2–2
Understand 2.0 Terminology 2–3
Starting Understand 2.0 2–5
Right-Click Menus Are Everywhere 2–7
Quickly Find Things in Your Source 2–9
Info Browser 2–12
Source Editor 2–13
Architecture Browser 2–14
Snapshot Manager 2–15
Graphical Views 2–16
ASCII and HTML Reports 2–17
Perl and C APIs for Custom Reporting 2–18
Previous
Close
Next Window
Drop-down
Sliding
Frame
• Title Bar: You can drag the title bar of an area around the main
window. If you move to the edge of the main window, a docking
area expands. If you drop the area there, it “docks” to the edge of
the main window.
• Pushpins and Drawers: Click the icon to move an area to
a tab along the same edge of the main window to which this area
was docked. This is a “drawer” that opens automatically if you
point your mouse at the tab title. The drawer closes if you move
your mouse away from the area without clicking on it or if you
click the title tab of the currently open drawer.
Click the icon to “pin” a drawer open. Pinned drawers have
a title bar and title bar icons like the ones shown above.
• Dock/Undock: Click the icon to change the area to an
undocked window. Click the icon again in an undocked window
to return to a docked area.
• Close: Click the “X” icon to close the area or undocked window.
• Drop-down: Click this icon to see the right-click menu for this
area. Right-clicking an item within an area usually displays a
right-click menu specific to that item.
• Sliding Frame: You can drag the frames between window areas
to change their sizes.
• Previous and Next: Each area type has different icons below
the title bar. For the Info Browser area shown, you can browse
through the history of entities viewed. For other areas, you will
see other icons.
Document
Info Area Find in Files Dialog
Browser Status Line
Filter Area
Info Browser
For details, see Entity Filter on page 4–5 and Info Browser on
page 4–8.
....................................................................................................
Entity Locator The filter provides a quick way to find major items that were
declared and used in your project. However, some items such as
local parameters, variables, and unresolved variables (used but not
declared in the processed source) are not listed in the filters. To
search or browse the entire database for your project, use the Entity
Locator.
To open the Entity Locator, choose Search->Entity Locator.
By default, this area lists all the entities in the project. You can
search for entities matching a particular text or regex string using
the fields above each column.
For details, see Entity Locator on page 5–3.
As in any other window, the right-click menu is also active.
You can select multiple rows and columns and copy their contents
to the clipboard. When you paste, the contents will be pasted as tab-
separated text.
....................................................................................................
Find in Files Similar to the UNIX
command grep, you may
search files for the
occurrence of a string.
Select Find in Files either
from the Search menu or
from a right-click menu.
When you click the
Search icon, a list of all
occurrences matching the
specified string or regular
expression is displayed in
the Find Results window.
Double click on any result
to display the Source View
where the string occurs.
The Find Options let you
set options such as case-
sensitivity and wildcard
pattern matching.
See Find in Files on
page 5–8 for more information.
....................................................................................................
Favorites You can place entities and code locations that you often use on your
Favorites list. To add a favorite, right-click on it and select Add
Favorite. To see the Favorites list, choose Search->Favorites.
Then, double-click a favorite from the list to go to its location.
Info Browser
Just about everything Understand 2.0 knows about code is shown in
the Info Browser (IB). The IB is used for all types of entities.
The Info Browser shows different things depending on the type of
entity selected.
It shows different kinds of information about entities such as source
files, classes, members, functions, types, methods, packages,
interfaces, and more. Information that is hierarchical in nature (such
as a call relationship) can be expanded multiple levels.
Below are Info Browser windows for a file and a C function:
Source Editor
Understand 2.0 has a source editor that not only lets you edit your
source code, it colorizes the source code and tells you about the
code you are editing.
Source can be visited by double-clicking almost anywhere else in
the tool. You can move forward or backward through such “visits” by
using the Next and Previous icons in the toolbar.
Architecture Browser
The Architecture Browser allows you to manage architectures. It
shows a list of all the defined architectures in the database and
provides a way to navigate individual architectures.
For example, this window shows the auto-architectures provided
with Understand 2.0: Calendar, Filesystem, Languages. The
architectures are expanded somewhat here to show the top-level
nodes for an example application.
Snapshot Manager
The Snapshot Manager allows you to compare versions of files. You
can take a snapshot to capture the state of the database at a given
point in time.
Later, you can compare a snapshot to the current files to find what
changes have occurred.
Graphical Views
Understand 2.0 analyzes your software code and creates a
database containing information about the entities and the relations
between entities. The database can then be browsed using various
“graphical view” windows. The graphical views are divided into
these kinds:
• Hierarchy views show relations between entities. Each view
follows a relation (for instance “Calls”) from the starting entity
(that you inquired about) through its children and successors.
• Structure views quickly show the structure of any entity that
adds to the structure of your software (for instance a package,
function, procedure, or task).
Examples of each type are shown in the following figure:
Structure Hierarchy
View View
The HTML and ASCII reports also show information not available
interactively, such as project metrics and quality reports. These
reports are suitable for printing or browsing with a web browser.
See Generating Reports on page 10–1 for more information.
Section Page
About Understand 2.0 Projects 3–2
Creating a New Project 3–3
Project Configuration Dialog 3–8
Languages Category 3–10
Files Category 3–11
File Types 3–17
File Options 3–18
Scheduled Activities 3–19
Metrics 3–22
Reports 3–24
Visual Studio 3–26
Ada Options 3–28
C++ Options 3–32
C# Options 3–39
FORTRAN Options 3–40
Java Options 3–43
JOVIAL Options 3–45
Pascal Options 3–47
PL/M Options 3–50
Setting General Preferences 3–51
Analyzing the Code 3–67
....................................................................................................
New Project Wizard Unless you have disabled the New Project Wizard, this is the tool
you use to create projects. To open it, click the New Project link in
the Getting Started tab that you see when you start Understand 2.0.
Or, choose File->New Project from the menus.
1 In the Create a Project File page of the wizard, type a Name for
the project and browse for a directory to contain the Understand
2.0 project files. It is often handy to have the project file in the
top-level directory of the source code, but this is not required. If
the directory does not exist, you are asked if you want it created.
5 In the Source Files page of the wizard, you add source files to a
project by clicking Add a Directory or Add a File.
To add a file, just browse for the file and add it.
When you add a directory, you can browse for a directory, modify
the list of languages used in the source files, add additional filters
for file extensions not expected by Understand 2.0, filter out any
files you want to exclude (for example, temp*.*), and choose
whether all the subdirectories of this directory should be added.
You can also choose whether the directory will be watched for
changes. See Adding Directories on page 3–12 for details.
Click OK and Understand 2.0 begins parsing (that is, analyzing) the
code.
If you want to close the Project Configuration dialog without saving
any changes, click Cancel, and then click Yes in the box that asks if
you really want to cancel changes.
Languages Category
In the Languages category of the Project Configuration dialog, you
can check boxes for the languages used in your project. A project
can contain source code in one or more languages.
Only languages you are licensed to use are selectable in this dialog.
The Engineer edition of Understand 2.0 supports only C/C++, C#,
and Java. The “Analyst” and “Pro” editions of Understand 2.0 come
in two language variants:
• L1: C/C++/C#, Java, Pascal/Delphi, FORTRAN
• L2: C/C++/C#, Java, Pascal/Delphi, FORTRAN, Ada, PL/M,
JOVIAL
When you select a language, categories for that language are
added to the list on the left in the Project Configuration dialog.
The languages you choose here not only affect how the source files
are parsed. They also affect the filter types available, the metrics
available, and the report types available.
If you select multiple languages, references between those
languages are analyzed. For example, if C code calls a Java
function, that reference will be found.
Files Category
In the Files category of the Project Configuration dialog, you can
add source code directories and/or individual files to the project. You
can also delete specific files from the analysis and modify the
language-specific options for individual directories and files.
You can add sources here, or you can tie the project to those
specified in an MS Visual Studio project file (MS Windows versions
of Understand 2.0 only). See Visual Studio on page 3–26.
The top area shows the directories and files you have added in a
tree that you can expand. It also shows how many files are currently
in the project.
The bottom area shows any option overrides you have set for the
selected directory or file.
1 In the Directory field, type the full directory path. Or, you can
click the ... button and use the Browse for Folder dialog to locate
a directory containing source files and click OK.
2 In the Configured Filters field, click the ... button if you want to
add or delete languages from the list shown. In the Select Filters
from Configured File Types dialog, put a checkmark next to any
languages you want to be recognized as part of the project.
Notice that additional languages are listed beyond those shown
in the Languages category. These include JavaScript, MSDos
Batch, Perl, Tcl, Text, and XML.
If this directory contains source files with extensions that are not
listed, click Configure. Also, see File Types on page 3–17. For
example, you might add .a64 as an assembly file type.
3 In the Additional Filters field, type a pattern-matching string that
matches only the files you want to keep in the analysis. For
example, std*.* includes only files that begin with “std”.
4 In the Exclude field, type a pattern-matching string that matches
files you want to exclude from the analysis. For example, temp*.*
excludes all files that begin with “temp”.
5 To select and add multiple subdirectories to a project
configuration, check the Include subdirectories box (on by
default). This causes all source files matching the filter in all
subdirectories of the specified path to be added to the project.
6 If you want this directory to be watched for any new files or
deleted files, check the Watch this directory box. Whenever a
source file is added to or deleted from this directory, the change
is reflected in this project. Watched directories are indicated by
the icon in the files list. Directories excluded from being
watched are indicated by the icon. By default, the
subdirectories of a watched directory are also watched. See
page 3–14 for watch setting overrides.
7 On UNIX, you can choose whether symbolic links should be
followed when adding files.
8 After you have specified the fields, click the OK button to add the
source files in that directory to the project. You can click Cancel
if the add file process is taking too long.
Tip: You may add files from multiple directory trees.
If you are using Microsoft Windows, you may drag and drop a
directory, a file, or a selection of files, from another window into the
Project Configuration dialog to add it to the project. If you drag a
folder, the Add a Project Directory dialog opens automatically. If you
drag an individual file, that file will be added to the project whether it
matches the file filter or not.
All directory paths are absolute.
....................................................................................................
Adding Files To add individual source files to the project, click . You see a file
selection dialog, which allows you to select one or more source files
to add to the project. Browse for and select a file or files. Then click
Open. The file(s) are added to the project.
If you click the down arrow next to the icon, you can choose
to import a text file that contains a list of source files to import. For
example, you might generate such a file from a compiler application
or code management system. The file should contain one absolute
file path per line. See Adding Files to a Project on page 13–3 for an
example of such a file.
....................................................................................................
Deleting Directories To delete a directory or file from the project, select the items you
and Files want to delete and click .
....................................................................................................
Setting Overrides Normally, each file in the project is processed according to the rules
you specify in the Project Configuration window for the language of
the file. For example, for C++ you can set include directories and
macro definitions. However, you can override the default settings on
a directory-by-directory or file-by-file basis if you like.
Directory: To override settings for a directory, follow these steps:
1 Select a directory.
2 Click or right-click and select Configure override settings.
....................................................................................................
Setting File You can control the portability of Understand 2.0 projects by clicking
Portability the icon at the top of the Files category of the Project
Configuration dialog. You will see the following dialog.
File Types
In the File Types category of the Project Configuration dialog, you
can control how file extensions are interpreted by Understand 2.0.
The list shows all the file extensions already understood. Files with
the types understood for the languages you checked in the
Languages category are analyzed as part of the project. Other files
are not analyzed.
To modify an existing type, select the type and click Edit.
To add a file extension to the list, click New. Type a file extension
and select the language to use for the file extension. Then click OK.
File Options
In the File Options category of the Project Configuration dialog, you
can control how files are opened and saved by Understand 2.0.
Scheduled Activities
In the Scheduled Activities category of the Project Configuration
dialog, you can cause certain events to be performed on a regular
basis. You can also open this dialog quickly by choosing Tools->
Scheduled Activitites.
To schedule events for the project you currently have open, follow
these steps:
1 Check the Process At box.
2 Select a processing time and check the boxes for one or more
days of the week.
Note: Understand 2.0 must be running at the processing time or the
events will not occur.
3 Check the boxes for the events you want performed. The events
occur in the sequence shown. For example, watched directories
are scanned before the project is analyzed, and the project is
analyzed before metrics are processed.
The following activities are available for scheduling:
• Rescan watched directories: Check this box to automatically
check for files that have been added to or deleted from project
directories. See Adding Directories on page 3–12 for how to
specify which directories to watch. If you have watched
directories, you should always run this task before the “Analyze
all files” task. To run this action without scheduling it, choose
Project->Rescan Watched Project Directories.
• Analyze all files: Check this box to automatically analyze all
project files as described in Analyzing the Code on page 3–67.
Run this task before generating any metrics so that the statistics
will reflect the current state of the project. To run this action
without scheduling it, choose Project->Analyze All Files.
• Create automatic snapshots: Check this box to automatically
generate a snapshot of all the code in the project as described in
Creating Snapshots on page 8–3. Snapshots allow you to
compare changes between entities as they were at different
times. The snapshot name is generated automatically. To run
this action without scheduling it, choose Change->Make
Snapshot.
• Metric processing: Check this box to automatically calculate
metrics for the project. The metrics selected in Metrics->Selected
Category on page 3–23 are processed. Run this task if you plan
to schedule either of the following metrics export tasks.
• Metric CSV export: Check this box to automatically export
metrics as a comma-separated value file. If this box is checked,
you can select the directory path and output filename for the
export. By default, any existing file with the same name is
renamed to provide a backup. You can check the Overwrite box
if you simply want to replace the old export file. To further
configure the export, see Metrics on page 3–22. To run this
action without scheduling it, choose Metrics->Export Project
Metrics and see Exporting Metrics to a CSV File on page 11–6.
If you have scheduled any activities, you see the following message
when you exit from Understand 2.0.
To see a list of all projects for which you have scheduled activities,
choose Tools->Master Scheduler List. To change these times,
you must open the project and then use the Project Configuration
dialog for that project.
Metrics
In the Metrics category of the Project Configuration dialog, you can
control how metrics are generated when a CSV file is exported.
These options set the defaults for both manual updates (page 11–6)
and scheduled automatic updates (page 3–19).
The Metrics category has two sub-categories: Options and
Selected.
• Show Declared in File: Check this box if you want the file in
which each entity is declared to be included in the output. You
can specify whether you want these files displayed with Short
names, Full names, or Relative names.
• Show Function Parameter Types: Check this box if you want
the type of each function parameter listed.
• Write Column Titles: Check this box if you want column
headings in the CSV file.
....................................................................................................
Metrics->Selected The Selected subcategory has lists like the following:
Category
Reports
In the Reports category of the Project Configuration dialog, you can
control how reports are generated. The Reports category has the
following sub-categories: Output, Options and Selected.
Visual Studio
In the Visual Studio category of the Project Configuration dialog,
you can tell Understand 2.0 to use the source, macro, and include
path settings from a Microsoft Studio project file.
You see this window when you choose the Project->Configure
Project menu item and select the Visual Studio category.
4 You can expand the Contains list to see the includes, defines,
and files for the configuration currently selected.
Note: If you sync with a Visual Studio workspace file, the default
target is used because there is no mechanism for specifying
targets for each .dsp project within a .dsw file.
Ada Options
In the Ada->Options category of the Project Configuration dialog,
you can tell Understand 2.0 how to analyze Ada source code. You
see this window when you choose the Project->Configure Project
menu item and select the Ada category.
Type the name of the macro in the first field and the definition (if
any) in the second field. Then click OK.
A macro must have a name, but the definition is optional. Macros
that have no definition value are commonly used in conjunction with
PRAGMA IFDEF statements to test whether a macro is defined.
To change the definition of an existing macro without changing the
name, select the macro and click Edit.
You can import a list of macros and their optional definitions from a
text file by clicking Import and selecting the file. The file must
contain one macro definition per line. A # sign in the first column of a
line in the file indicates a comment. Separate the macro name and
its definition with an equal sign (=). For example, DEBUG=true.
You can set macros on the und command line with the -define
name[=value] option.
C++ Options
In the C++->Options category of the Project Configuration dialog,
you can tell Understand 2.0 how to analyze C and C++ source code.
You see this window when you choose the Project->Configure
Project menu item and select the C++ category.
• Save macro expansion text: If you put a check in this box, you
can right-click on a macro and choose Expanded Macro Text
from the pop-up menu to see how the macro expands.
• Use include cache: By default, include files are cached during
the analysis phase as they are often referenced in multiple
source files. This speeds up analysis, but also uses more
memory. If you have problems with excessive memory use
during analysis, turn this option off. Note that there are also
situations where turning the include cache on or off can affect
analysis results, particularly where include actions are
dependent on where they are included.
....................................................................................................
C++->Includes The C++->Include category in the Project Configuration dialog
Category (which you open with Project->Configure) allows you to specify
include directories. You can specify multiple directories to search for
include files used in the project.
Include paths are not recursively searched; that is, any
subdirectories will not be searched for include files unless that
subdirectory is explicitly specified in the list of include directories.
To add a directory, click the New button and then the ... button,
browse to the directory, and click OK.
You can import a list of include directories from a text file by clicking
Import and selecting the file. The file must contain one directory
path per line. (In all such imported text files, a # sign in the first
column of a line in the file indicates a comment. Full or relative paths
may be used. Any relative paths are relative to the project file.)
The C++->Include category provides the following options to control
how includes are handled:
• Add found include files to source list: Enabling this option
causes include files found during project analysis to be added to
the project automatically. This allows you to see more detailed
information about such include files. The default is off.
• Add found system include files to source list: If you choose
to add include files that are found to the source list, you can also
choose whether system include files should be added. The
default is off.
• Prompt for missing includes: By default, for any include files
that cannot be found during analysis, you will be prompted for
how to handle that missing file. When prompted during analysis,
you may choose to ignore the missing file, or you may specify the
path where the file can be found. Turn this option off to disable
this prompting feature. Any missing include files found during
analysis when the prompt feature is turned off will be ignored.
• Search for include files among project files: This option
directs the parser to look among project files as a last resort for
missing include files. The default is on.
• Treat system includes as user includes: This option tells the
parser to look for system includes (surrounded by < >) using the
same strategies as normal includes (surrounded by quotes). If
this item is off, the parser looks for system includes only in
directories defined by the compiler configuration. The default is
on.
• Use case-insensitive lookup for includes: This option tells the
parser whether to ignore the case of filenames in #include
statements. The default is off.
....................................................................................................
C++->Includes->Auto In the C++->Includes->Auto category you can specify include files
Category that should be included before each file in a project.
To add a file, click New and browse for the file. Then click Open.
You can import a list of auto include files from a text file by clicking
Import and selecting the text file that contains one file path per line.
....................................................................................................
C++->Includes-> In the C++->Includes->Ignore category you can specify individual
Ignore Category include files that you wish to ignore during analysis.
To add a file to be ignored, click the New button and type the
filename of the include file. Then click OK. The filename can use
wildcards, such as moduleZ_*.h, to match multiple files.
You can import a list of include strings and their replacements from
a text file by clicking Import and selecting the file. The file must
contain one include string per line. The file should separate the
include string and its replacement with an equal sign (=).
....................................................................................................
C++->Macros C source code is often sprinkled with pre-processor directives
Category providing instructions and options to the C compiler. Directives such
as the following affect what the software does and how it should be
parsed:
#define INSTRUMENT_CODE
#ifdef INSTRUMENT_CODE
... statements ...
#endif
Macros are often defined with directives (#define) in include files (.h
files) or are passed in via the compiler (typically with the -D option).
For Understand 2.0 to successfully analyze your software it needs to
know what macro definitions should be set.
The C++->Macros category in the Project Configuration dialog
(which you open with Project->Configure) allows you to define
preprocessor macros that are used when compiling the code.
To add a macro definition, click the New button and type the name
of the macro and optionally a definition. Then click OK.
Note that a macro must have a name, but that the definition is
optional. Macros that are defined but have no definition value are
commonly used in conjunction with #ifdef pre-processor statements
to see if macros are defined.
Note: A number of preprocessor macros are automatically supported. In
additions to the common macros, Understand 2.0 supports the
following macro formats for embedded assembly code:
#asm(<embedded assembly code>);
#asm “<embedded assembly code>”;
#asm
<embedded assembly code>
#endasm
You can import a list of macros and their optional definitions from a
text file by clicking Import and selecting the file. The file must
contain one macro definition per line. A # sign in the first column of a
line in the file indicates a comment. The file should separate the
macro name and its definition with an equal sign (=). For example,
DEBUG=true.
The priority for macro definitions is as follows, from lowest to highest
priority:
1 Built-in language macros (__FILE__, etc.)
2 Compiler configuration file
3 Macro definitions in a synchronized Visual Studio project
4 Undefines of compiler defines (via the Configure Undefines
button)
5 Project defines (Macros category)
6 Define on und command line using -define
7 Define in source file (#define / #undefine in source)
....................................................................................................
C++->Macros-> You can list undefined macros in the C++->Macros->Undefines
Undefines Category category in the Project Configuration dialog. Click New and type the
name of a macro that is not defined. Then click OK.
You can import a list of undefined macros from a text file by clicking
Import and selecting the file. The file must contain one macro name
per line. A # sign in the first column of a line in the file indicates a
comment.
C# Options
If you have C# source code, you can set the following C# option in
the C#->Options category of the Project Configuration window:
You can import a list of reference files and their aliases from a text
file by clicking Import and selecting a file that contains one
reference and its alias per line. The file should separate the
reference file and its alias with an equal sign (=).
By default, reference files are analyzed as part of the project. If you
do not want them to be analyzed, uncheck the Analyze found
reference files box in this category.
FORTRAN Options
In the Fortran->Options category of the Project Configuration
dialog, you can specify how to analyze FORTRAN source code. You
see this window when you choose the Project->Configure Project
menu item and select the Fortran category.
Java Options
In the Java->Options category of the Project Configuration dialog,
you can specify how to analyze Java source code. You see this
window when you choose the Project->Configure Project menu
item and select the Java category.
....................................................................................................
Java->Class Paths The Java->Class Paths category allows you to identify Java .jar
Category and .class files that provide classes for which you do not have
source code.
Both .jar files and .class files are supported. Jar files contain
compressed .java (source) files. Class files contain compiled
sources. By default, the [Link] (or [Link]) file provided by the Java
Developers Kit is located. You can add other .jar files as needed.
To add a directory with .class and .java files, follow these steps:
1 Click Add Path.
2 Locate and select the directory containing .class files.
3 Click OK.
JOVIAL Options
In the JOVIAL->Options category of the Project Configuration
dialog, you can specify how to analyze JOVIAL source code. You
see this window when you choose the Project->Configure Project
menu item and select the Jovial category.
2 Click the ... button and browse to the directory you want to add.
3 Click OK.
When a !COPY directive is analyzed, the directories are searched in
the order listed. To change the search order, select a directory and
click Move Up or Move Down.
You can import a list of directories to be searched for files named in
!COPY directives from a text file by clicking Import and selecting the
file. The file must contain one directory path per line. (In all such
imported text files, a # sign in the first column of a line in the file
indicates a comment. Full or relative paths may be used. Any
relative paths are relative to the project file.)
Pascal Options
In the Pascal->Options category of the Project Configuration
dialog, you can specify how to analyze Pascal source code. You see
this window when you choose the Project->Configure Project
menu item and select the Pascal category.
....................................................................................................
Pascal->Standard The Pascal->Standard Library Paths category allows you to
Library Paths specify directories that should be searched for standard libraries.
Category Standard library paths are used to find units that are not found in the
project files. Only files that contain the required units are processed.
For example, the following statement causes the standard libraries
to be searched for a unit names System:
Uses System;
The standard libraries are not used when computing project metrics.
To add a directory, follow these steps:
1 Click the New button.
2 Click the ... button and browse to a directory. Then click OK.
3 You can click Move Up or Move Down to change the
precedence order in which the standard libraries are checked.
You can import a list of directories that should be searched for
standard libraries from a text file by clicking Import and selecting
the file. The file must contain one directory path per line.
....................................................................................................
Pascal->Search Paths The Pascal->Search Paths category allows you to specify
Category directories to search. To add a directory, follow these steps:
1 Click the New button.
2 Click the ... button and browse to a directory. Then click OK.
3 You can click Move Up or Move Down to change the
precedence order in which the standard libraries are checked.
You can import a list of directories to search from a text file by
clicking Import and selecting the file. The file must contain one
directory path per line.
PL/M Options
In the PL/M->Options category of the Project Configuration dialog, you
can specify how to analyze PL/M source code. You see this window
when you choose the Project->Configure Project menu item and se-
lect the PL/M category.
....................................................................................................
General Category The following options can be controlled from the General category
of the Tools->Options dialog:
....................................................................................................
User Interface The following options can be set from the User Interface category
Category of the Tools->Options dialog:
• Show tabs: If checked (the default), tabs are shown at the top of
the document area for each of the windows open in that area.
This includes the Project Assistant, source editor windows,
graphical views, and other windows.
• Dock Window Layouts: Choose which window layout you
would like to use as the default. The Assistant Layout is good
for new users. The Tight Layout is useful if you will be opening
several source files and want plenty of screen space for that. The
Classic Layout is similar to earlier versions. The Multi-monitor
Layout allows you to take advantage of multiple screens if you
have them.
• Title Formats: Choose whether you want filenames in the title
areas of windows, tabs, and selector files to be short names,
long (full path) name, or relative to the project database.
....................................................................................................
User Interface->Lists The following options can be set from the User Interface->Lists
Category category of the Tools->Options dialog:
• Save on parse: Choose what you want done with changed but
unsaved source files when the database is to be analyzed. The
default is to always prompt you to choose whether to save files.
Alternately, you can choose to automatically save changed files
or to not save changed files.
• Save on command: Choose what you want done with changed
but unsaved source files when a command is to be run. The
default is to always prompt you to choose whether to save files.
Alternately, you can choose to automatically save changed files
or to not save changed files.
• Prompt before closing the current project: If checked (the
default), you are asked whether you want to close the current
project and all associated windows when you attempt to open a
different project.
....................................................................................................
Key Bindings The functions of keys in Understand 2.0 can be customized. The
Category Key Bindings category of the Tools->Options dialog lets you
choose how keys will work in Understand 2.0:
4 Press the key combination you want to perform that action. Note
that you can’t use normal editing keys like Backspace or Delete
to edit the keys shown in these fields.
5 When you move focus away from a key binding you changed,
you may see a warning message if the key combination you
chose is already used. For example:
....................................................................................................
Analyze Category The Analyze category of the Tools->Options dialog allows you to
specify options for how the project is analyzed.
This setting controls the font used in the Run a Command dialog to
display output from the commands you issue.
....................................................................................................
Portability Category The Portability category of the Tools->Options dialog lets you
specify names to use as substitutes for file paths. Named roots are
similar to environment variables.
After you have defined a named root, you can use that name in
other Understand 2.0 dialogs, such as the Project Configuration.
This is useful, for example, if you want to share projects with people
who reference project files over a network using different paths.
To add a named root, click the Add Named Root button. This adds
a new row where you can type a name and a path (or click the folder
icon to browse for the location).
You can uncheck one or more named roots if you want to
temporarily deactivate certain names.
To use a named root, see Setting File Portability on page 3–16.
Note: You cannot change the portability settings for your project if your
project contains any snapshots. Because the portability setting must
be the same for the current database and all the snapshots, you can
only change portability options before creating snapshots or if you
delete all the snapshots.
....................................................................................................
Editor Category The following options can be set from the Editor category of the
Tools->Options dialog:
• Default style: Use the Font pull-down list to select a font for
Source Editor windows. The fonts shown are the fixed-width
fonts available on your system. Select a Size for the Source
Editor text. If you check the Antialias box, the font is smoothed.
• File Mode: Select the type of Encoding to use when saving
source files and the Line Endings character you want used.
Many encoding formats are supported. The “System” encoding
uses the same encoding format defined for your operating
system. You should change these settings only if your other
Indent Guide
• Show Page Guide: Check the Page Guide box to display a line
similar to the Indent Guide at a defined line width (that is, at the
right edge of the code). Set the Column to the character width
you want to see indicated.
• Whitespace: Select whether you want to see indicators about
whitespace characters. A dot indicates a space, and an arrow
indicates a tab. You can choose Invisible (the default), Always
Visible, or Visible after Indent. Check the Show End-of-Line box
to see the characters that force a line break.
• Margins: Check Line Number (on by default) to turn on line
numbering in the source view. Check Bookmark (on by default)
if you want bookmarks (red arrows) shown in the margin next to
line numbers. Check Fold (on by default) to turn on the ability to
“fold” source code entity blocks out of the way.
....................................................................................................
Editor->Advanced You can further customize the code editor’s behavior in the Options
Category dialog. To open this dialog, choose Tools->Options. Expand the
Editor category, and select the Advanced category.
The following options control how source code looks when you print
it from an editor window:
• Font Size: Choose the size of the source code you want to use
for printing.
• Color Mode: Choose a color mode for printing. The choices are
as follows. Note that colors other than black and white are
printed only if you are using a color printer and the printer driver
is set to print in color.
- “Normal” matches the current display appearance.
- “Invert Light” prints black as white and white as black. This is
useful if you set the background to a dark color and the text to
light colors for your display.
- “Black on White” prints black code on a white background
regardless of the current display appearance.
- “Color on White” prints colored code on a white background
regardless of the current display appearance.
• Wrap Mode: Choose the wrap mode you want to use for
printing. The default is to wrap words to the next line, but you can
choose to truncate lines or wrap at the character level, which
breaks words across lines.
The Auto-complete options provide for auto-completion of keyword
and entities you type in the editor. As you type, words are shown
below your text. You can arrow down through the list and press
Enter to choose a suggestion.
....................................................................................................
Editor->Styles You can customize the colors used in the Source Code Editor in the
Category Options dialog. To open this dialog, choose Tools->Options.
Expand the Editor category, and select the Styles category.
To change a color, click a color square next to an item in the list.
Use the Select Color dialog to choose a new color for that item.
You can change the text foreground (FG) and background (BG)
colors for any item. You can also make the text bold (B), italic (I), or
underlined (U) for any item. To highlight the whole line for an item,
check the EOL box.
By default, the following color codes are used for the source code:
• Dark blue text: Used for language keywords
• Red text: Used for characters and character strings
...
Analyzing a large project can take some time. If you click Cancel
while the project is being analyzed you will see a message that says
this action will leave the project in an incomplete state. You will need
to analyze the project in order to explore it.
If your project results in errors or warning that you did not expect,
you should revisit the categories of the Project Configuration Dialog
on page 3–8 to make sure your project is configured correctly. The
cause of multiple similar errors is often something like not specifying
an include file directory.
When the analysis is complete, the source code for any errors or
warnings may be examined by double-clicking on the message in
the Parse Log window. If you click the pane-divider arrows,
you can see the source code for errors you double-click on in the
Parse Log window.
To save the Parse Log to a text file, right-click on the white
background of the Parse Log and choose Save As. Specify the
location and name of the file you want to save. Or, you can use
Copy to Clipboard to paste the parse log into another application.
If you have parsed the project during this session, you can choose
Window->Last Parse Log command to reopen the log.
To create a snapshot of the project after parsing, click the
Snapshots button in the lower-right corner of the Parse Log. The
Make Scratch Snapshot option is available in “Pro” and “Analyst”
editions of Understand 2.0. The Make Named Snapshot option is
only available in “Analyst” editions.
In the Understand 1.4 Project field, click the folder icon to browse
for the database file for your Understand 1.4 project. This file will
have a file extension of .uda, .udc, .udf, .udj, .udv, or .udp,
depending on the programming language used in the project.
In the New Project Name field, type a name for your new project.
The file extension of .udb will be added automatically. This may be
the same name as the old project, but need not be.
In the Create In field, click the folder icon to browse for the directory
in which you want the new project stored. The default is the directory
that contains the Understand 1.4 project.
When you click Convert, you see the Parse Log window for the
project being converted.
Section Page
PLEASE RIGHT CLICK 4–2
Various Windows Explained... 4–3
Project Assistant 4–4
Entity Filter 4–5
Info Browser 4–8
Project Browser 4–14
Exploring a Hierarchy 4–16
Favorites 4–17
Right-click almost
anywhere to bring up
a menu.
Ctrl + right-click
brings up the same men
but actions happen
in a new window.
Project Assistant
The Project Assistant provides links to useful tools. You can open it
by choosing Project->Project Assistant.
Project Information
The Project Information portion of the Project Assistant tells you
the full path to the project database, the languages supported in this
project, the number of files in the project, and the total lines of code
in the project.
The remaining sections of the Project Assistant link to various tools.
For information about these tools, see the following locations:
Explore
• View Project Files: See page 4–5.
• View Project Functions: See page 4–5.
• Search Project Files: See page 5–8.
• Search Project Entities: See page 5–3.
Architect
• What is an Architecture? See page 7–2.
• Create a Custom Architecture: See page 7–10.
• Browse Architectures: See page 7–3.
• Manage Architectures: See page 7–9.
• Predefined Architectures: See page 7–10.
Snapshots
• What is a Snapshot? See page 8–2.
• Manage Snapshots: See page 8–10.
• Compare Snapshots: See page 8–14.
Project Metrics
• Project Metrics Summary: See page 11–3.
• Project Metrics Browser: See page 11–4.
• Generate Project Metrics: See page 10–23.
• Generate Project Reports: See page 10–2.
Entity Filter
The Entity Filter provides a quick list of the selected entity type. You
can filter this list to match a text string.
The options in the Show list depend upon the languages you have
enabled for your project and the types of entities and relationships
found in your project. If your project uses multiple languages, the
language is listed along with the type.
For each of these types, you can quickly find any entity that has
been declared (or used) in the source code.
....................................................................................................
Using the Filter Field In the Filter field, you can type a string to match a set of entities. By
default, the string matches entity names starting from the first
character. So, for example, you can type “y” to list only entities that
contain a Y or y anywhere in the name.
If you want to quickly jump to the point in the list where entities begin
with a particular letter, just click in the list of entities and type a letter.
You can select other ways for the Filter field to work. Click the drop-
down icon and choose Filter Pattern Syntax. The options are:
• Fixed String: This is the default behavior.
• WildCard: With this option selected, you can use * (any
characters) and ? (any single character) wildcards for pattern
matching. See page 5–5 for examples.
• Regular Expression: With this option selected, you can use
UNIX-style regular expressions. See page 5–5 for an overview.
By default, filtering is case-insensitive. You can make it case
sensitive by clicking the drop-down icon and choosing Filter
Case Sensitivity->Case Sensitive.
When you are finished using a filter and want to see all the entities
for the selected type, click the drop-down icon and choose Clear
Filter.
....................................................................................................
Customizing the You can modify how the Entity Filter lists entities as follows:
Display By default, the full entity name is shown in the Entity Filters list and
entities are alphabetized by their full name. This name may include
a class prefix or other language-specific prefix type. To list entities
by their “short”, unprefixed names, click the drop-down icon and
choose Entity Name as->Short Name.
By default, only the name of the file is shown in a Files list in the
Entity Filter. This name does not include the file location. To list files
including their locations, click the drop-down icon and choose File
Name as->Relative Name or File Name as->Long Name.
....................................................................................................
Root Filters Notice that there are the filter type names that contain “Root”, as in
Root Calls, Root Callbys, and Root IncludeBys. These “Root”
types show only the top of a given tree. The tops (or bottoms) of
relationship trees are often helpful points to begin exploring code
that is new to you.
• Root Calls: Lists only entities that call others, but are not called
themselves. These are either high-level code (mains), code
called by hardware (interrupt handlers), or dead (unused) code.
• Root CallBys: Lists only entities that are called by others, but
that do not call anybody else. These are low-level routines.
• Root IncludeBys: Lists only files included by others, but not
included themselves. These are “lower” level include files.
• Root Classes: Lists only classes not derived from other classes.
These are candidates for lower level classes, or library classes.
• Root Decls: Lists only the highest level declaring routines. (Ada)
• Root Withs: Lists only program units (packages, tasks,
subprograms) that With other program units, but are not withed
by anybody else. (Ada)
Info Browser
When you click on an
item in the Entity Filter or
in a number of other
windows, the Info
Browser updates to show
everything that
Understand 2.0 knows
about that entity. The Info
Browser shows this data
as a tree whose branches
can be expanded
individually or all at once.
If the Info Browser isn’t
open, you can open it by
either clicking on an item
in the Entity Filter or
Project Browser. Or, you
can right-click on an item
anywhere and choose
View Information.
Everything Understand
2.0 knows about an entity
can be learned using the
Info Browser. The
information is shown in a
tree. The tree can be
expanded selectively or
in bulk. Each terminating
item (leaf) of a tree
provides some
information about that
entity.
All information in an Info Browser window can be saved to a text file,
or copied and pasted via standard Windows or X11 copying
functions.
As you drill down you can change which entity you are learning
about. Each time you change the entity, it is remembered in the Info
Browser history for quick backtracking.
Relationship tree
Where used
....................................................................................................
Drilling Down A Drilling down the tree works as expected (mostly). To expand a tree,
Relationship click on the + sign. To close the tree click on the - sign.
Right-clicking brings up
a menu that includes
expand/collapse options.
Expand All provides a
shortcut to expand all
levels of the selected
branch.
To open or close the
entire tree, right-click on
the top item and choose
Expand All or Collapse All.
See Saving and Printing Info Browser Text on page 4–13 for details
on the other options in this right-click menu.
....................................................................................................
Displaying More or If you click the icon next to a bold heading such as Calls,
Less Information Called By or References in the Info Browser (or right-click on the
heading), you’ll see options that let you modify how that entity is
listed. These options include:
• Fullname: If checked, the fully-qualified name of the entity is
shown.
• Parameter: Lists the parameters.
• Reference: Choose “Full” to include the file and line location of
the reference.
• Return Type: Lists the return type.
• Sort: Controls the sort order of the list.
• Type: If checked, the datatype is shown.
• Filename: Controls whether the reference format is short, long,
or relative to the project database.
....................................................................................................
Searching the Info If you click the binocular icon at the top of the Info Browser (or click
Browser in the Info Browser and press Ctrl+F), a Find bar appears at the
bottom of the Info Browser.
Type text in the box and click a forward or backward arrow to find an
occurrence of the string in the Info Browser text. All text is searched,
including node names and items that are currently hidden by
collapsed nodes. If you type a string that does not appear anywhere
in the Info Browser text, the field turns red.
....................................................................................................
Syncing the Info You can have multiple Info Browser windows open if you uncheck
Browser the Sync box. Selecting an entity or choosing View Information
updates the Info Browser that has its Sync box checked.
The File Sync box synchronizes the Info Browser with the file in the
active Source Editor.
....................................................................................................
Visiting Source Code In general, if you double-click on an entity in an informational
window (Info Browser or Entity Filter) the declaration of that entity
will be loaded into the Document Area.
Another way to visit source from any entity you see in Understand
2.0, is the right-click menu. Where appropriate, an entity’s right-click
menu contains an Edit Source menu item. In some cases, there are
separate menus items for Edit Definition and Edit Declaration or
separate menus for other language-specific locations.
....................................................................................................
Visiting References The portion of the Info Browser labeled “References” lists
everywhere the entity is referred to in the analyzed source code:
....................................................................................................
Viewing Metrics The last node on the Info Browser tree is Metrics. This branch
shows the metrics available for the current entity.
By default, when you switch to another entity in the Info Browser, the
Metrics node is closed automatically. This is because it can take a
long time to update the metrics for each entity in a large project.
If your project is small enough that updating metrics as you switch
between entities does not take a long time, you can right-click on the
Metrics node and choose Allow Pre-expansion. The Metrics node
will then stay open when you change entities. You see the following
warning about the time required for metric updates.
History arrows.
Click to move
back and forth
in history.
Use the right and left arrows to move back and forward in the history
list. The down-arrows show the whole list.
Project Browser
To open the Project Browser, choose Project->Project Browser
from the menus.
The right-click menus for this view offer a number of options. The
options with icons are also available in the toolbar for the Project
Browser.
Exploring a Hierarchy
The Exploring view lets you browse up and down a relationship
hierarchy within your project.
The right-click menu in the Info Browser, Entity Filter, and Project
Browser offers a command to Explore certain types of entities. The
command may be Explore Calls/Callbys or Explore
Includes/Includebys.
If you click on an item in one column, you see its relationships in the
columns on either side. As you choose items to the left or right,
columns resize to show more of the hierarchy. Calls and Includes go
from left to right. Callbys and Includebys go from right to left.
If you double-click an item, a Source Editor window shows the
entity’s definition.
The References area shows the line number of the current
relationship.
If you check the Sync to Information Browser box, then the Info
Browser automatically displays information about any entity you
select in the Exploring window. Holding the Shift key down
temporarily activates this behavior.
If you check the Jump to First Reference box, then the Source
Editor automatically displays the initial reference to any entity you
select in the Exploring window. Holding the Ctrl key down
temporarily activates this behavior.
Favorites
You can mark entities as “Favorites” so that you can quickly access
them as you would web pages in a browser’s Favorites list.
....................................................................................................
Creating a Favorite To mark an entity as a favorite, follow these steps:
1 Right-click on an entity in the Entity Filters area, the Info
Browser, a source view, a graphical view, or anywhere else
entities occur.
Section Page
Searching: An Overview 5–2
Entity Locator 5–3
Find in Files 5–8
Finding Windows 5–14
Searching: An Overview
Finding things in large bodies of source code can be difficult,
tedious, and error prone.
Understand 2.0 offers these solutions for finding things:
• Project wide, entity only, searching using the Entity Locator. This
kind of search finds only entities (not strings, or comments, or
non-syntactically declared or used items). See Entity Locator on
page 5–3.
• Project wide, text-based searching using Find in Files. See Find
in Files on page 5–8.
• Single file searching in the Editor. See Searching Source Code
on page 6–7.
• Text-based searching of various browsers. See Searching the
Info Browser on page 4–10 and Project Browser on page 4–14.
Each of these searching methods has advantages and
disadvantages. Together they provide powerful ways to easily find
what you need to find to better understand and modify your code.
Entity Locator
Not all entities fall into one of the tab categories shown in the Entity
Filter. You can find and learn more about any entity by using the
Entity Locator, which provides a filterable list of entities in the
database. You can filter by name, by entity type, by where the entity
is declared, within what container the entity is declared, or when the
entity was last modified. You can also use architecture hierarchies
to sort entities.
To open the Entity Locator, choose Search->Entity Locator from
the main menu bar.
....................................................................................................
Column Headers Column headers are tools in the Entity Locator. Left-click them to
sort according to that column. Right-click a column or click the drop-
down icon to see a menu that lets you control how entities are listed,
sorted, and filtered.
The entity list may be sorted by any column. Left-click on the column
header to toggle between sorting in ascending order and
descending order. The default sorting order is in ascending order of
entity names.
....................................................................................................
Choosing Columns Click the large + icon in the upper-right of the Entity Locator to see
the Locator Column Chooser.
....................................................................................................
Filtering the List The field below each column heading lets you filter the entities
shown by the Entity Locator. The filter can be entered manually or
automatically based on what was right-clicked on.
For example, you may filter by the Kind column by right-clicking on
any item listed in the Kind column and selecting Filter By Selection
from the menu. This filters the list of entities to contain only entities
of the kind you selected. The title bar shows how many entities
match the filter.
Or, you can simply type a filter in one of the fields. To clear a filter,
just delete the text from the field in the column heading.
The following example shows Filter By Selection for an entity Kind:
To filter the Date Modified column, the left drop-down lets you select
a comparison operator ( <, <=, =, >=, > ), and the right drop-down
lets you select a date from a calendar. You can modify the time by
typing. You must select a comparison operator in addition to a date
in order to filter the entities.
Similarly, the metrics columns allow you to filter with a comparison
operator. For example, you can filter the entities to show only those
Find in Files
You may search all project files or another selection of files for the
occurrence of a text string or regular expression. Matches are
shown in the Find Results window and can be visited in the source
code by double-clicking on any line in the results.
To open this tool, choose Search->Find in Files from the menu bar,
choose Find in... from any right-click menu, or press F5.
The Find in Files area allows you to search multiple files for the
occurrence of a string. In previous versions, this feature was called
Hyper Grep for its similarity to the UNIX command grep.
....................................................................................................
Find Results The Find Results window lists the matches found and some
statistics about the results. Each line where the string occurs is
listed in the Results list. The Details section includes the number of
matches, the number of files that contain matches, the number of
files searched, and information about how long the search took.
Multiple searches are shown in the results list. You can right-click on
the background of the window and choose Expand All to expand all
nodes in the window. Or, choose Collapse All to compress the list
to just the top-level search listing.
You can change the organization of the most recent results by using
the Organize Results By drop-down. The choices are a flat list (the
default), a file-based list, and hierarchies using the default
architectures and any custom architectures you have created.
By default, only the name of files is shown. To show full file paths,
select “Long Names” from the Display Files As drop-down.
You can view the source code for a match by double-clicking on a
result. This opens the Source Editor and highlights the match.
From the right-click menu, you can choose Copy or Copy All to
copy the contents of the window as text for pasting elsewhere.
The toolbar (and right-click menu) for the Find Results area lets you
do the following:
Search within the currently selected set of results (using the
same search bar described in Searching the Info Browser on
page 4–10).
The fields in this area are the same as those in the Find in Files
area. The exception is that there is a Replace field where you type
the text you want to replace the matched string.
When you click Preview Replace, Understand 2.0 checks for any
unsaved source files. If there are unsaved files, you must click Yes
to save all unsaved changes before previewing the changes.
After any files are saved, you see the Preview Replace Changes
window. You can use this window to accept or reject replacements
on a change-by-change basis, file-by-file basis, or all at once. This
window is similar to the comparison areas described in Exploring
Changes on page 8–17.
The top area shows the pre-change code on the left and the post-
change code on the right. Replacements are in pink and the
currently selected replacement is highlighted in blue. The left side
has the Hide Common Lines option set so that most lines that will
not be affected by the replacement are hidden.
The middle area shows the replacements in patch file format. Such
patch files can be used with the Unix patch tool and other similar
programs. You can hide this area by clicking the small
fold icon above the area.
The lower area lists the files where replacements will be made and
the number of replacements accepted and unresolved.
The navigation icons let you move to the next and previous file and
the next and previous replacement.
The accept and reject icons let you accept or reject replacements on
a change-by-change basis, file-by-file basis, or all at once.
If you decide not to make changes, you can click Cancel at any
time. If you have accepted any replacements, you see a message
that asks if you are sure you want to cancel without making
replacements.
Finding Windows
If you have a number of windows open, you can use the options in
the Window menu to organize or find particular windows.
If you have parsed the project during this session, you can use the
Last Parse Log command to reopen the log.
The Change Dock Window Layout lets you choose from several
standard layouts for common tools. The layouts include the “Tight”
layout, “Classic” layout, and “Multi-monitor” layout.
The Window menu also lets you Tile or Cascade the open windows.
You can use Split Vertically or Split Horizontally to split the
document area. When the document area is split, new areas open in
the half that has its box checked. You can drag tabs from one half of
the document area to the other as needed. Choose Window->
Unsplit to remove the split.
The windows you currently have open are listed in the Window
menu. You can select one of these windows to move focus to that
window.
The Window->Navigator command (Ctrl+Tab) opens a temporary
list of currently open windows. When you double-click on an item in
this list, the list goes away and focus is given to the item you chose.
You can dismiss this area without choosing a window by pressing
Esc.
If you have many windows open in the document area, you can
right-click on the tab for the window you are using and choose
Close All But This or Close All Tabs to the Right.
The Window->Selector command opens an area that lists currently
open windows. Click a window name to make it active. By default,
the Selector lists all windows, but you can choose to show only
Editor windows or various other window types. The icons indicate
the type of window, including whether the source file is unsaved.
You can use the drop-down icon to change the order from
alphabetic to most recently used. Click an item in this list to give that
item focus.
You can type a filter to quickly narrow the list. The current filter is
shown at the bottom of the Selector area.
Using the Selector is a convenient way to perform actions—such as
Close—on multiple windows by selecting multiple windows from the
list, right-clicking, and choosing Close Selected Window(s) or
Close Unselected Window(s).
If you have created bookmarks in your source code (page 6–12),
you can use the Bookmarks command in the Windows menu to
open the list of bookmarks.
You can hide or display categories of toolbar icons by right-clicking
on the toolbar or menu bar and choosing a category. The toolbar is
separated into the following categories: Project, File, Edit,
Configure, Editor History, Favorites, User Tools, TrackBack, Browse,
SplitWorkspace, and Scopes.
Section Page
Source Editor 6–2
Saving Source Code 6–6
Searching Source Code 6–7
Other Features 6–10
Printing Source Views 6–14
Source Editor
The Source Editor offers a full featured source code editor, with
syntax coloring and right-click access to information most entities in
your code.
....................................................................................................
Scope List You can jump to a particular
function, procedure, or other
language-specific construct in the
current source file by selecting from
the scope drop-down list in the
toolbar. The drop-down list shows
all such constructs found in the file
the last time the project was
analyzed.
You can right-click on the Scope List area to choose a sort order
from the right-click menu. The ascending and descending orders
sort alphabetically or reverse alphabetically. The default is file order.
For more power than the scope list, use the Contextual Information
Sidebar on page 6–9.
....................................................................................................
Status Icons Each file in a Source Editor window has a status icon in its upper-left
title bar. The letter inside the icon indicates the type of file. The color
of the icon indicates whether the file has been modified but not yet
analyzed. An asterisk next to the filename marks files with unsaved
changes.
If you click the line number in the status bar, you can use the Go To
Line dialog.
You can temporarily enter Browse Mode by holding down the Ctrl
key while using a Source Editor window.
See page 4–3 for a more complete list of the code exploration tools
in Understand 2.0.
....................................................................................................
Incremental Find To search quickly within the current file, press Ctrl+F (or choose
Search->Incremental Find). The status bar of the Source Editor
changes to a search bar.
You can type a string in the field. As you type, matches for that
string are highlighted in the Source Editor. Click Previous or Next to
move from match to match. You can also check the Match Case
and Match Whole Words boxes to modify how the search is
performed.
If you check the Hide box, then as soon as you click on the code,
the incremental search bar is hidden. When you press Ctrl+F again,
your last search is shown. Use Ctrl+Shift+F to find the previous
occurrence.
When the search wraps more than one full time around the file, you
see the icon.
....................................................................................................
Find If you want to use Search-and-Replace or regular expressions for
searching, you can use the Find dialog. To open this dialog, choose
the Search->Find menu item or press Ctrl+Alt+F.
....................................................................................................
Contextual The Contextual Information Sidebar (CIS) is similar to the Scope List
Information Sidebar (see page 6–3), but more powerful. You can open the CIS by
choosing Search->Contextual Information Sidebar from the
menus or clicking the icon in the toolbar.
The CIS shows the structure and information for the currently active
Source Editor. The tabs in the CIS provide the following information:
• Structure Browser: This is an expanded scope list for the
current file. It lists the types and names of structures in the file
and highlights the one where your cursor is located. In addition to
functions, it lists includes, macros, classes, and more. Press
Ctrl+F to search within this tab.
• File Information: This tab provides an Info Browser for the
current file.
• Scope Information: This tab provides an Info Browser for the
current entity—that is, the one highlighted in the Structure
Browser tab.
• Context Browser: This tab shows the current entity’s location in
the hierarchy on the left and the entities it contains on the right.
The switch icon (Ctrl+,) to the right of the File Information tab
changes the current file in the Source Editor and the CIS to a file in
the same directory with the same name but a different file extension
(if such a file exists). For example, the switch icon might toggle
between a .c or .cpp file and a .h file with the same name.
As always, right-clicking in any of these tabs provides links to more
information about each entity.
Other Features
The Source Editor also provides several other options for displaying
and editing files.
....................................................................................................
Bracket Matching A handy feature of the Understand editor is syntax bracket
matching. Use this feature to find the matching ending bracket of
syntactically used braces, parenthesis and brackets. Symbols
matched are ( ), { }, and [ ]. Matching isn’t done inside comments.
Pressing Ctrl+j (or right-click and Jump to Matching Brace) jumps
the editor to the matching end or beginning brace. Ctrl+j isn’t active
unless your editing cursor is by a symbol that it can match. Another
Ctrl+j takes you back where you started.
Pressing Ctrl+Shift+J selects all the text from the bracket to its
matching bracket.
Brackets without a match are highlighted in red when you move your
cursor to them. Brackets with a match are highlighted in green.
When your cursor is on a preprocessor directive that has a match
(for example, #ifdef and #endif), you can use Ctrl+j (or right-click
and Jump to Matching Directive) to move your editing cursor to
the match.
....................................................................................................
Folding and Hiding The - and + markings next to the line numbers allow you to “fold” the
code to hide blocks such as functions, if statements, and other
statements that have a beginning and end.
If you right-click on the code, you can choose Fold All to close all
the open blocks.
You can also choose Hide Inactive Lines to hide preprocessor
lines that are not active because a preprocessor macro is not
defined. Choose Show Inactive Lines to view all lines again.
....................................................................................................
Commenting and You can comment code that you have selected by right-clicking and
Uncommenting choosing Comment Selection. To remove the comment characters,
right-click and choose Uncomment Selection.
Note that nested comments within the selection are not parsed.
....................................................................................................
Changing Case You can change the case of selected text in the Source Editor.
Follow these steps:
1 Select a word or words in the source code.
2 Right-click and choose Change Case from the pop-up menu.
3 Choose the type of case you want to apply to the selection. The
choices are as follows:
....................................................................................................
Bookmarking You can create “bookmarks” in your code by right-clicking on a line
and choosing Add Bookmark from the right-click menu. Lines with
a bookmark have a red arrow next to them.
Select a file in the file-based view and click this icon to delete
all the bookmarks in this file. You can also select a bookmark and
click this icon to delete all the bookmarks in the file that contains the
selected bookmark.
If you choose Show Tab Title as, you can shorten or lengthen the
filename shown in Source Editor tabs. Likewise, if you choose Show
Window Title as, you can shorten or lengthen the filename shown
in the main Understand 2.0 window and any separate Source Editor
windows.
If you choose Release Window, the tabbed area changes to a
separate window that can be moved around your screen. Click
to change a tab to a window within the Understand 2.0 window.
Section Page
About Architectures 7–2
Using the Architecture Browser 7–3
Managing Architectures 7–9
Creating an Architecture 7–10
Building an Architecture 7–13
Using XML to Manage Architectures 7–15
Using Architecture Filters 7–16
About Architectures
An architecture is an abstract hierarchy layered onto a body of
source code. For example, a staff architecture could have nodes for
each engineer working on a particular project. The nodes would
contain a list of source code files belonging to or to be modified by
that engineer. Dependencies and interactions could then be derived
from that architecture.
Architectures allow you to name regions of a software project or
ways of looking at software hierarchically. An architecture creates a
hierarchy of source code units (entities). You can use the provided
architectures or create your own.
Architectures need not reference every source entity in the
database; that is, they can define a subset of the entities. Also,
architectures can contain a particular entity more than once.
(Technically, that is, the architecture's flattened expansion need not
maintain the set property.)
You can combine architectures successively to create novel filters
for your entities.
From a more technical perspective, simple set algebra is used to
combine and transform architecture hierarchies. The result of the
filter is a list of entities. This result list can be viewed as a flat list or
in terms of another architecture. The filter definition can be saved as
a dynamic architecture. A dynamic filter architecture is updated as
the contents of the database change and it can be used to
reconstitute the filter at a later date.
If you have the “Engineer” edition, you can use the auto-
architectures for browsing. If you have the “Pro” edition, you can
also define some Predefined architectures. If you have the “Analyst”
edition, you can also create custom architectures and custom
architecture-based filters.
....................................................................................................
Generating Graphs You can generate graphs that show the hierarchy of an architecture.
You can save these graphs as PNG, JPEG, SVG, and Visio files.
To create a graph, follow these steps:
1 Select the highest-level architecture node you want to graph.
You can graph the entire hierarchy or just a sub-hierarchy.
2 Right-click on the node and choose Graphical Views from the
right-click menu. The submenu allows you to choose Graph
Architecture, Dependency Graph, Reverse-Dependency
Graph, or Butterfly-Dependency Graph.
3 In the graph, you can right-click to modify the display. For
example, in the following Architecture Graph, both Include
Entity Lists and Include Referenced Architectures were off by
default but were turned on. Likewise, you can right-click on
Dependency graphs to set options such as the Depth of
expansion levels (default = 1).
....................................................................................................
Generating Metrics You can generate metrics information about an architecture or a
subset of an architecture. The metrics information can be either a
text summary or a comma-separated list for use in spreadsheets.
To create a metrics summary, follow these steps:
1 Select the highest-level node of the architecture for which you
want metrics.
2 Right-click on the node and choose Metrics Summary from the
right-click menu.
3 You see an Architecture Metrics Summary window. For example,
the following two summaries use the Complexity architecture to
compare metrics for “Low Complexity” and “High Complexity”
functions.
4 When you close the window, you are asked whether you want to
save the file. If you click Save, you can save the summary as
text.
4 When you close the window, you are asked whether you want to
save the file. If you click Save, you can save the data as a .CSV
file.
Managing Architectures
To open the Architect Manager window, choose Architect->
Manage Architectures from the main menubar in Understand 2.0.
The window lists the auto-architectures on the right and custom
architectures you have created on the left.
Creating an Architecture
There are several ways to create a new architecture:
• To create an architecture from scratch, choose Architect->
Create Custom Architecture from the menus or click the
icon in the Architect Manager. Use the Architecture Wizard to
create the architecture as described in Using the Architecture
Wizard on page 7–11.
• To duplicate an existing architecture (which you can then
modify), select an architecture and click the icon in the
Architect Manager window. Or, right-click an existing architecture
node in the Architecture Browser and choose Duplicate
Architecture from the right-click menu to create an architecture
from that node and lower in the hierarchy.
....................................................................................................
Using the When you open the Architecture Wizard by choosing Architect->
Architecture Wizard New Architecture from the menus or clicking the icon in the
Architect Manager window, you see a page that asks for the name
of your architecture. (If you have the “Pro” edition, you can use the
Architecture Wizard to create the Predefined architectures only.)
Type a name for the architecture. This name should be fairly short
so it can be shown in architecture trees.
Then click Next to see the page that lets you add and edit
architecture nodes. This is the hierarchy to which entities will be
assigned in a later page of the wizard
Click Add a Node and type the Name of the node you want to add.
The default location is within the node you had selected in the
Architecture Wizard, but you can select another location in the
Create In field. Then click OK.
You can modify nodes you have created by selecting a node and
clicking Edit Node. You can delete the selected node by clicking
Remove Node.
The next window presents an animation that shows how to use the
Architecture Builder to add entities to the nodes you have created.
When you have finished watching the animation, click Finish. This
opens the Architecture Builder shown in the animation. Your
architecture nodes are shown on the right. See Building an
Architecture on page 7–13 for details on adding entities to each
node.
Building an Architecture
To edit an existing architecture, select that architecture and click the
icon in the Architect Manager window. Or, right-click on an
existing architecture and choose Edit Architecture from the right-
click menu. Both actions open the Architecture Builder. (If you have
the “Pro” edition, you can use the Architecture Builder to edit the
Predefined architectures only.)
This dialog allows you to add nodes to architectures. You create an
architecture structure on the right-hand side and map entities into
the architecture from the left-hand side.
• Click the icon to create a new node at the same level as the
selected node. Click the icon to create a new node as the
child of the selected node.
• Click the icon to delete the selected node.
• Click the icon to undo your last change. Click the icon
to redo you last undo.
To map files to nodes in the Architecture Builder, follow these steps:
1 On the left side of the Architecture Builder, select an existing
architecture from the drop-down list that will allow you to easily
find the files you want. The default is the Filesystem architecture.
2 You can choose whether to show all entries in the architecture or
just the unmapped entries. For example, if you want to map all
the entries into your new architecture, you might want to select
Show Unmapped Entries so that you can see which files you
haven’t mapped yet.
3 In the left architecture hierarchy, select one or more files or
architecture nodes.
4 In the right architecture hierarchy, select the node you want to
contain your selection.
5 Click the Add button or drag your selection to the right side.
6 When you finish editing your custom architecture, click Save.
You can use the Remove button to delete files and nodes from the
architecture you are editing.
As always, you can right-click on any node or file to use its right-click
menu to get information.
You can save your edits to the architecture at any point by clicking
the icon. Then, you can continue editing. If you close the
Architecture Builder without saving changes, you will be asked if you
want to save your changes.
Saves dynamic
architecture
Saves static
results of
architecture
just processed
Section Page
About Snapshots 8–2
Creating Snapshots 8–3
Managing Snapshots 8–10
Comparing Snapshots 8–14
Exploring Changes 8–17
Using Change Reports 8–27
Comparing Entities 8–29
Comparing Files and Folders 8–32
Comparing Text 8–35
Using TrackBack 8–36
About Snapshots
A snapshot captures the state of the files and entities in your project
at a given point in time. Snapshots allow you to compare changes
between entities as they were at different times.
An Understand 2.0 snapshot stores all the information needed to
regenerate metrics, reports, change markups, and more based on
the state of your source code when you created the snapshot.
(Creating frequent snapshots or snapshots of large code projects
can result in very large .udb project files.)
One advantage of using Understand 2.0 to find differences between
snapshots is that snapshots are always accessible. You don’t need
to do checkouts of old source code in order to make comparisons.
If you want to create snapshots of older generations of your source
code (from before you used Understand 2.0), you can check those
versions out in order to make snapshots of old code, or you can use
TrackBack records to make snapshots of old code.
Unlike the TrackBack tool (see page 8–36), snapshots compare
whole projects at a point in time—not incremental changes to
individual files that are backed up as they happen.
You use the Snapshot Manager to manage snapshots. To open this
window, choose Change->Manage Snapshots from the main
menubar in Understand 2.0.
Note: Once you create a snapshot, you can no longer change the
portability options for your project. Before creating a snapshot, see
page 3–16 to choose a file portability setting.
Creating Snapshots
To create a snapshot, choose Change->Make Snapshot from the
main menubar in Understand 2.0. (Or, use the icon in the
Snapshot Manager or click the Snapshots button in the Parse Log.)
Choose a type of snapshot to create from the menu. If you have the
“Pro” edition, you can only create a “Scratch” snapshot. If you have
the “Analyst” edition, you can create any type of snapshot.
....................................................................................................
Creating Scratch A “Scratch” snapshot is an unnamed snapshot you create of the
Snapshots source code in your project. The default name is “Scratch” and there
can only be one snapshot named “Scratch”. You can rename a
scratch snapshot after creating it.
To create a scratch snapshot, follow these steps:
1 Choose Change->Make Snapshot->Scratch from Current
Database from the main menubar in Understand 2.0.
(Alternately, use the icon in the Snapshot Manager or click
the Snapshots button in the Parse Log.)
2 You will be prompted to parse your project. Click Yes. The
project is parsed and a scratch snapshot is added to the
Snapshot Manager list if it is open. If a snapshot named
“Scratch” already existed, the new snapshot replaces the old
one.
3 If you want to rename this snapshot, select the row for the
Scratch snapshot in the Snapshot Manager and click the
Edit icon.
....................................................................................................
Creating Named A “Named” snapshot is similar to a “Scratch” snapshot except that
Snapshots you can specify the name and comment when you create it. In
addition, you can specify an alternate time for the snapshot—for
example, if you have checked out an older generation of your
source code.
To create a named snapshot, follow these steps:
1 Choose Change->Make Snapshot->Named from Current
Database from the main menubar in Understand 2.0.
(Alternately, use the icon in the Snapshot Manager or click
the Snapshots button in the Parse Log.)
2 You will be prompted to parse your project. Click Yes. The
project is parsed and the Make Named Snapshot dialog opens.
....................................................................................................
Creating Snapshots In addition to creating snapshots of the code in the current project,
from Other Locations you can create snapshots of alternate versions of the source code
that are located in other disk locations. For example, you may have
checked an older version of the source code out from a source code
control application.
To create a named snapshot, follow these steps:
1 Choose Change->Make Snapshot->Named from Alternate
Source Locations from the main menubar in Understand 2.0.
(Alternately, use the icon in the Snapshot Manager or click
the Snapshots button in the Parse Log.)
2 You are prompted to parse your project. Click Yes. The project is
parsed and the Create a Historic Snapshot dialog opens.
7 Click the “...” button next to the Alternate Source path and
browse for the directory where your historic code is located. This
directory should have the same subdirectory structure as a
directory in your Understand 2.0 project. Choosing the highest-
level directory that corresponds to a directory in your project is
best.
8 Click the “...” button next to the Current Project path and
browse for the corresponding directory that already exists in your
project.
9 Click OK.
You can select multiple pairs of current and alternate directory
pairs. All the subdirectories and files that are in the current
project will be replaced in the snapshot by the corresponding
subdirectories and files in the alternate location.
Combined, all the files in your project should be represented in
the alternate location unless they have been added to or deleted
from the project.
10 When you have added all the mappings you want to create, click
OK to create a preview of the snapshot.
- Files Found: A count and list of all of the files in the project
path and in the corresponding alternate location you selected.
- Files Not in Current Project: A count and list of source files
that were found in the alternate location but are not part of the
project in its usual location. If the files in the alternate location
are older, these may be files that have since been deleted from
the project. You can uncheck the Include box to exclude these
files from the snapshot.
- Project Files Not in Snapshot: A count and list of source files
that are not in the alternate location but are part of the project.
If the files in the alternate location are older, these may be files
that have been added to the project. Or, the files may be
excluded from the project by filters of various types.
12 If the list of files to be included in the snapshot is correct, click
Yes. Otherwise, click No and attempt to recreate the snapshot
with different paths. When you click Yes, the snapshot is created
and parsed. When parsing is complete, a message says the
snapshot was successfully created.
....................................................................................................
Creating TrackBack In addition to creating snapshots of the code in the current project,
Snapshots you can create snapshots of code as it was at any point in time as
saved by the TrackBack tool.
To create a TrackBack snapshot, follow these steps:
1 Choose Change->Make Snapshot->Named from Any Point in
Time from the main menubar in Understand 2.0. (Alternately,
use the icon in the Snapshot Manager or click the
Snapshots button in the Parse Log.)
2 You are prompted to parse your project. Click Yes. The project is
parsed and the Make Snapshot From Trackback dialog opens.
Managing Snapshots
After you have created snapshots, there are a number of ways to
use them. You can rename them, enable them, protect them, purge
them, and compare them.
You perform these actions from the Snapshot Manager, which you
open by choosing Change->Manage Snapshots from the main
menubar in Understand 2.0.
In this window, each snapshot has its own column listing project
metrics for each language used in the project.
Snapshots are sorted from newest to oldest by default. The table
provides some basic metrics about each snapshot. LOC is the total
number of code lines. Comment Ratio is #_of_comment lines /
total_#_of_lines. Avg Complexity is the average number of
independent paths through functions in the project.
In addition to snapshots you have created, the “Latest” snapshot
reflects the current database.
The toolbar for the Snapshot Manager allows you to perform the
following actions:
....................................................................................................
Edit Snapshot In the Snapshot Manager, click the Edit icon to open the Edit
Snapshot dialog.
....................................................................................................
Delete Snapshot To delete a snapshot, select one or more rows in the Snapshot
Manager, and click the Delete icon. Click OK if you are sure
you want to delete the snapshot(s).
....................................................................................................
Protect/Unprotect You can protect snapshots from being deleted by the Purge
Snapshot command (see page 8–13). This is a good idea for snapshots you
want to keep. You can leave temporary snapshots unprotected and
then easily delete all temporary snapshots to reduce the size of the
project database.
To protect snapshots, follow these steps:
1 Open the Snapshot Manager by choosing Change->Manage
Snapshots.
2 Select rows for one or more snapshots you want to protect or
unprotect.
3 Click the Protect/Unprotect icon and select one of the
commands from the drop-down menu. The Protected column
text for the selected snapshots changes.
....................................................................................................
Purge Snapshots To purge unprotected snapshots (see page 8–13), click the
Purge icon in the Snapshot Manager. You are asked if you really
want to delete all the unprotected snapshots without being able to
undelete them. Click OK to purge.
....................................................................................................
Copy Snapshot If you want to save information about your snapshots in another
Information application, you can copy information from the Snapshot Manager
and paste it into other applications as tab-separated text.
Select one or more rows in the Snapshot Manager and click the
Copy Selection icon. Or, click the Copy Table icon to
get information about all snapshots. Then, paste the information into
another application.
Comparing Snapshots
To compare snapshots you have taken of your project with the
current state of your project, you can compare snapshots and
explore the differences.
To compare snapshots, follow these steps:
1 Choose Change->Compare Snapshots from the main menubar
in Understand 2.0. This opens the Find Changes dialog
(Alternately, use the icon in the Snapshot Manager. If you
select two snapshots in the Snapshot Manager, these are
automatically chosen as the snapshots to compare.)
copied to the Find Changes dialog, and you can modify them
further if you like.
3 In the “Where” area, choose Everywhere if you want to compare
snapshots of entire projects. To limit the comparison, leave
Choose entities or a set of architectures chosen.
- Click Choose Entity to open the Entity Chooser. Use the
Show field to filter the entity list. You can sort the list by
clicking on the column headings. To hide one or more
columns, click the “+” icon. Find and select one or more
entities whose source code you want to compare. Click the
right arrow to move items to the right list. Then click OK.
7 Choose the later snapshot in the Later time field. In the results,
this snapshot will be shown on the right.
If you have the “Pro” edition of Understand 2.0, the Later time
field cannot be changed. It is generally set to the “Current
Database” unless you have created additional snapshots with
the “Analyst” edition and select them in the Snapshot Manager.
8 In the Exclude filter field, type a pattern-matching or regular
expression string to match files you want to exclude from the
comparison. For example, *.c excludes C source files.
9 In the “Options” area, you can choose to do a Case insensitive
comparison or to Skip whitespace. These options are possible
in Understand 2.0 because it compares entities and syntax
rather than comparing files character-by-character as many
differencing tools do.
10 In the “Organize results by” area, check the box if you want to
use an architecture (see Chapter 7) to organize the results. Then
select a Root Architecture from the list. If you don’t check this
box, you won’t be able to use the Tree view in the results.
11 Click Find Changes to compare the snapshots.
Exploring Changes
When you compare snapshots to generate change results, you see
a Change Results area:
Changed Entities
Entity Comparison
Difference List
This area provides several ways to examine the comparison you
created. The results have these main areas:
• Changed Entities: This area lists entities that were changed
using the selected architecture hierarchy. The number of
changes is also provided individually for each source language in
the comparison. See page 8–18.
• Entity Comparison: This area allows you to examine the
differences in entity versions. See page 8–22.
• Patch File: The patch area shows the patch file syntax to
convert from the left version to the right version. See page 8–26.
• Difference List: This area allows you to select individual
differences between two versions. See page 8–26.
At the top of this area, the two snapshots being compared are listed.
For example, in the figure above, the snapshots are “Oct 1” and
“Current Database” (which is available automatically).
The toolbar near the top of this area contains the following controls:
Save icon: Use this icon to save your comparison settings so
that you can reuse them using the Load Parameters button as
described in Comparing Snapshots on page 8–14. The settings are
stored with your project. When you click the icon, you see the Save
Search Settings dialog, which lists the settings you have already
saved. Type a Name for your settings and click OK.
You can filter entities out of the Tree or List view by using the
Exclude checkbox and filter field. Type a pattern matching or
regular expression string and then press the Enter key. For
example, g* and ^g both excludes all entities (such as functions) that
begin with “g”. Note that files that match the filter are not excluded
from tree views because they may contain entities that do not match
the exclude filter.
When you select an entity, the number and type of changes made to
it are shown to the right in the Change Summary. The Change
Summary area shows how many changes there are within the
selected architecture node or entity. Select a different hierarchy
node or entity to see how many changes there are at each level. If
multiple languages are used within an architecture node, the
Change Summary lists the number of changes for each language.
As always, right-click on any architecture node or entity to see lots of
item-specific options in the right-click menu. When you click on an
entity in the Tree view, information about that entity is shown in the
Info Browser.
When you use the List view, you can select the type of entity to
view using the Show drop-down list. To see the full list, choose All
Entities from the drop-down list.
The List view provides quite a few columns. You can click on the
column headings to sort the list in either ascending or descending
order. Click the icon to open the Locator Column Chooser. By
default, all the columns listed in the dialog are shown if you scroll the
list to the right. You can hide columns to reduce the amount of
scrolling needed if you like.
In the Change Columns area, the Lines Added, Lines Changed, and
Lines Removed columns are available only if you have the “Analyst”
edition. The Change Type, Lines Affected, and New Complexity
columns are available in both the “Analyst” and “Pro” editions.
You can hide the Changed Entities portion of the results by clicking
the small fold icon below the area. The currently
selected entity remains selected. This makes more space for the
Entity Comparison and Difference List areas.
....................................................................................................
Entity Comparison The Entity Comparison area shows individual differences between
versions of an entity. The display is similar to that of common
differencing tools.
The left side shows the code from the older snapshot of the entity;
the right side shows the code from the newer snapshot. The entity
name and snapshot names are shown just above the code.
You can use the small fold icon (like the one shown here)
between the two code versions to hide the older code
temporarily. Or, click the right arrow next to a code change
to do the same thing.
You can edit the source code if you like in the current database
version of the files. You cannot save code directly to a file. Instead,
you can use the button to save a patch file or you can
copy and paste code with merged changes and edits into another
application.
You can select text and copy it to the clipboard. To select text, use
the mouse or your keyboard. To select all, press Ctrl+A or right-click
and choose Select All. To copy text to the clipboard, press Ctrl+C
or right-click and choose Copy.
As always, right-click on any entity name or other text in the code to
see lots of item-specific options in the right-click menu.
To search for text in the source code displayed, follow these steps:
1 Press Ctrl+F to display the Search area in place of the status
bar.
2 In the Report Name dialog, type a name for your report. This
name is used in the title bar and first page heading of the report.
Comparing Entities
There are two ways to compare entities in Understand 2.0. You can
compare an entity across different snapshots, or you can compare
one entity with another.
....................................................................................................
Comparing the Same When you right-click on an entity in Understand 2.0, the right-click
Entity Between menu often contains the Compare command. When you choose
Snapshots this command, you see the following question (unless you are
comparing an entire file):
You can also move backward and forward through the history of a
file’s snapshots by clicking the left and right arrows.
If you are comparing an entity other than a file (such as a function),
merging changes and saving files in the comparison is not
permitted. You can still use the button to create a patch
file in “unified format”.
If you are comparing a file, you can merge changes and use the
Save and Save As buttons for the “Current Database”
version of the file.
....................................................................................................
Comparing Two You can compare two entities by choosing Change->Compare
Entities Entities from the menus. You see the Comparison window.
You can also launch this tool separately from Understand 2.0 by
running the UndDiff program provided with the Understand 2.0
installation.
In this dialog, select a file or folder for the left and right comparison.
Both sides should be similar files or similar folders. Click the file
button to browse for a file; click the folder button to browse for a
directory.
Subdirectories of the directories you choose are also compared.
When you click Compare, the comparison begins. The status bar at
the bottom of the Understand 2.0 window shows what is being
compared.
The folder and file comparison interface is quite similar to the
Change Results interface. The differences are as follows:
• The comparison uses the following folder and file icons.
• You can copy folders and files from one side to the other. The
copied items overwrite any items with the same names. To copy,
first select the items you want to copy. (To copy a folder and its
contents, select the folder and all the folders and files it
contains.) Then click the Copy/Merge button and choose either
to the right or to the left. This opens the Copy Files dialog,
which lists the files or folders to be copied. If the list is correct,
click OK.
Comparing Text
You can compare text that you paste into a window by choosing
Change->Compare arbitrary text from the menus. You see a
window like this:
Paste the before and after text you want to compare into the left and
right sides. Then, click OK to see the comparison.
Using TrackBack
The TrackBack tool automatically tracks changes to files. These
changes are backed up as they happen or on a regular schedule.
By default, TrackBack is installed with Understand 2.0 and
integration is enabled. To change the TrackBack integration setting,
see page 3–58.
TrackBack is a “personal change management” tool that
automatically creates backup versions of important files and
directories. It fills the gap between application-specific “autosave”
functions and expensive enterprise-wide change management
software, providing new power and productivity to individuals.
You can launch TrackBack from within Understand 2.0 by choosing
Tools->TrackBack History Explorer from the menus. For details
about using TrackBack, see the TrackBack User’s Guide.
When a Source Editor window is active, you can use the following
icons in the toolbar for TrackBack integration:
Add the current file to the set of files tracked by TrackBack.
This icon is inactive if the current file is already being tracked.
Open TrackBack to view the history of the current file. This icon
is inactive if the current file is not being tracked by TrackBack. You
can also right-click on a file that is being tracked and choose
TrackBack file history.
When you are in the Source Editor window for a file that is being
tracked by TrackBack, the right end of the status bar shows the
number of revisions of this file stored by TrackBack and you can
click the link to open TrackBack for the current source file.
The first time in a session that you use Understand 2.0 to save a file
that TrackBack is tracking, Understand 2.0 sends the file to
TrackBack for backup when the file is first modified. After the first
save in a session, the settings you have made in TrackBack about
how to monitor the file system for changes are used.
Section Page
Project Overview Graphics 9–2
Graphical View Browsers 9–4
Types of Views 9–10
Graphical Notation 9–18
Controlling Graphics Layout 9–19
Saving Graphical Views 9–30
Printing Graphical Views 9–32
In each area, you can choose the Graph View or the Table View.
Both views have a toolbar that lets you save the graph or data.
In the Graph View, you can use the toolbar to:
You can also use the graphics views drop-down menu in the toolbar
to select from the types of graphs available for the entity at the
current cursor position in a Source Editor tab.
....................................................................................................
Hierarchy Views A hierarchy view shows multiple level relationships between entities.
All relationships are multi-level and are shown to the top or bottom
of their respective tree unless a level option is set in the
preferences. The following is a Call By graph for a function.
....................................................................................................
Structure Views Structure views offer a one glance way to see important structure
and relational information about a given entity. The following is an
example of a Declaration structure view:
....................................................................................................
General Rules for There are some general rules that can be used for browsing any
Using Graphical type of graphical view.
Browsers • Entity info: Anywhere you see an entity, you can right-click on it
to see a menu that offers many ways to learn more about that
entity. Single-clicking shows information about the entity in the
Info Browser.
• Searching: Click the Search icon at the top of a graphical
view or press Ctrl+F to display the incremental search bar. You
can use this bar that same way you use it in the Source Editor to
find text the current graphical view. As you type search text, all
instances of the string are highlighted in the graphical view. See
page 6–7 for details.
Nodes to expand
or contract tree
....................................................................................................
Filtering Out Entities You can apply filters to hide certain entities in graphical views. To
create such a filter, follow these steps:
1 Right-click on the background of a graphical view and choose
Edit Graphic Filters from the pop-up menu.
4 Type a filter in the Filter Text field. For example, use gr* to
match entity names beginning with gr. Filters are case-sensitive.
5 In the Filter Criteria field, select whether to compare the filter to
long names, definition files, or the type text of entities. For
example, if you choose long names, a filter of print* does not
match SomeProc::printWide. Instead, you can type *print*.
Types of Views
There are two main types of graphical views: hierarchy views and
structure views.
....................................................................................................
Hierarchy View Types Hierarchical views show multi-level relationships between entities.
Understand 2.0 offers hierarchy graphs of the following types of
relationships. Some types apply to specific source languages.
• Butterfly: Shows both calls and called by.
• Calls: Shows who this entity calls.
• Called By: Shows who calls a given entity.
• Include: Shows who this file includes.
• IncludeBy: Shows who includes this file.
• Dependency Graph, Reverse-Dependency Graph, and
Butterfly-Dependency Graph: Available for architectures only.
See page 7–6.
• Derived Classes: Shows classes derived from a given class.
• Base Classes: Show what classes are the base for a class.
• Extends: Shows which classes extend this class.
• Extended By: Shows which classes are extended by this class.
• Class Inheritance: Shows who inherits from a given class.
• Child Lib Units: Shows the Child Library Units of a given
compilation unit. (Ada 95 only)
• Declared In: Shows the declaration tree from where this
program unit is declared.
• Declaration Tree: Shows the declaration nesting of program
units in a compilation unit.
• Instantiated From: Shows the instantiation tree of a generic
type or compilation unit.
• Instantiations: Shows who instantiates a given generic unit.
• Invocation: Shows what compilation units a unit invokes.
• Parent Lib Unit: Shows the parent lib units of a given entity.
• Type Derived From: Shows tree of types a type is derived from.
• Type Tree: Shows types that derive new types from an entity.
• Include By: Shows the include tree in the other direction. In the
previous example, align.h is included by several files such as
algebra.h.
• Base Classes: For classes, shows the base classes from which
this class is derived from. In this example, class CLInearCurve is
derived from class CCurve, which is derived from class CSurface
and so on.
• Derived Classes: Shows the classes that are derived from this
class. In this example, class CTexture3d is a base class for
classes CIrradianceCache and others.
....................................................................................................
Structure View Types Structure views offer a one glance way to see important structure
and relational information about a given entity. Understand 2.0
structure views include the following:
• Architecture Graph: Shows the hierarchy of an architecture
node. See page 7–6.
• Declaration: Shows what a structure is composed of. For
example, shows the parameters, return type, and callbys of a
function. For classes, shows what members are provided, who
inherits this class, and who it is based on.
• Parent Declaration: Shows what a structure is composed of.
Shows Calls instead of the Called Bys shown by a Declaration
graph.
• Declaration File: Shows what entities (such as functions, types,
macros, and variables) are defined within a given file.
• Declaration Type: Shows what a type is composed of.
• Class Declaration: Shows the members defining the class and
the parent class
• Data Members: Shows what components a class, struct, or type
contains.
• Control Flow: Shows a flow chart of the function or similar entity
type. Clicking on a node in the graphs jumps to the line of code
referenced.
• Package: Shows what entities are declared in a given package
(body or spec).
• Task: Shows the parameters, invocations, and what
entities/entry points are declared in a task. Also shows what the
task Withs.
• Rename Declaration: Shows what entities are renamed in the
entity.
....................................................................................................
Structure View Structure views quickly show structure and relations.
Examples Understand 2.0 structure views are designed to present essential
information about an entity in a small and concise manner. The
structure diagram is derived from the graphs presented by Booch
and Buhr in their respective books “Software Engineering with Ada”
and “System Design in Ada.” Where needed, symbols and
annotations have been extended or altered to represent new kinds
of information available from Understand 2.0.
Graphical Notation
The following symbols are used by Understand 2.0 to represent
various language constructs. The symbols vary somewhat
depending upon the type of view.
• Entities such as functions and other program units are shown in
rectangles.
• Files and system-level entities are usually shown in
parallelograms.
• Classes and types are shown in flattened hexagons.
• Macros are usually shown in flattened octagons.
• Objects such as variables are usually shown in slightly rounded
rectangles.
• Unknown or unresolved entities are drawn with dashed outlines
or in gray.
• Other shapes are language-specific.
In Control Flow views, standard flow chart symbols, such as
diamonds for decision points, are used.
These options control the layout and drawing of the graphic views
and vary based on the current type of view. The following
subsections describe a number of these options.
....................................................................................................
Called by Menu The Called by menu controls whether program units that call the
current entity are shown in declaration views.
....................................................................................................
Constants Menu The Constants menu controls whether to show constants in
Declaration views. The default is On.
....................................................................................................
Default Members The Default Members menu controls whether declaration views
Menu show default members of the class.
....................................................................................................
Dependent Of Menu The Dependent Of menu controls whether files a C file is
dependent on are drawn in the C File Declaration view. The Default
is On.
....................................................................................................
Dependent Menu If Dependents is on (the default) then files dependent on the current
C file are shown in a File Declaration view.
....................................................................................................
Duplicate Subtrees The Duplicate Subtrees menu controls whether multiple
Menu occurrences of the same sub-tree are shown in hierarchy views. The
options are to Hide or Show such subtrees. The default is to show
duplicate subtrees. In some applications, hiding duplicate subtrees
can dramatically simplify hierarchy views. Duplicate subtrees are not
shown if a view has over 1000 nodes.
....................................................................................................
Extended By Menu The Extended By menu controls whether declaration views show
classes by which the selected class is extended.
....................................................................................................
Extends Menu The Extends menu controls whether declaration views show
classes that the selected class extends.
....................................................................................................
External Functions If External Functions is on then functions defined in a header file or
Menu in a file included by a header file are shown in the Declaration View
for a header file. Default is On.
....................................................................................................
Filename Menu The Filename menu controls how filenames are displayed in views.
It is available for both declaration and hierarchy views. The options
are Off and On.:
• None: Filenames are not shown in the view.
• Shortname: Where filenames are relevant, only the name of the
file is shown in square brackets.
• Fullname: Where filenames are relevant, the full file path and
filename are shown in square brackets.
....................................................................................................
Function Pointer The Function Pointer menu controls whether function pointers are
Menu displayed as invocations in the Call and CallBy trees.
....................................................................................................
Globals Menu The Globals menu controls whether to show globals in Declaration
views. The default is On.
....................................................................................................
Implements Menu The Implements menu controls whether declaration views show
entities that the selected entity implements.
....................................................................................................
Implemented By The Implemented By menu controls whether declaration views
Menu show entities by which the selected entity is implemented.
....................................................................................................
Imports Menu The Imports menu controls whether declaration views show entities
imported by the current entity.
....................................................................................................
Included By Menu If IncludeBy is on (default) then files that include the Header File
being drawn in a Header File Declaration view are shown.
....................................................................................................
Includes Menu The Includes menu controls if include files are drawn on file
declaration diagrams (C file, Header file). Default is On.
....................................................................................................
Inherits Menu The Inherits menu controls whether declaration views show entities
that the selected entity inherits.
....................................................................................................
Inherited By Menu The Inherited By menu controls whether declaration views show
entities inherited by the selected entity.
....................................................................................................
Intrinsic Menu The Intrinsic menu controls whether intrinsic functions (for
example, cos and sin) are displayed or hidden.
....................................................................................................
Invocations Menu The Invocations menu controls whether procedures and functions
called by the current procedure or function are shown in Declaration
views.
....................................................................................................
Layout Menu The Layout menu controls the layout algorithm for a hierarchical
chart. It is available only in hierarchy views (calls, callby, etc.). The
options are:
• Crossing: A left-to-right view, minimizing space used but
sacrificing some readability by permitting lines between entities
to cross.
....................................................................................................
Level Menu The Level menu controls the number of levels to be traversed when
laying out a hierarchical view. The default value is “All Levels”.
Values of 1 to 5 may be set. It is available only in hierarchy views.
....................................................................................................
Members Menu The Members menu controls whether members and operators are
shown in the Type Tree and Type Derived From views. The choices
are to show None, Components, Operators, or Operators and
Components.
....................................................................................................
Name Menu The Name menu controls whether or not fullnames are used in
views. It is available for both declaration and hierarchy views.
....................................................................................................
Parameters Menu The Parameters menu controls whether parameters are shown in
hierarchical views. Available on any hierarchical graphical view
(invocation and callby). The default is Off, turning this On can make
hierarchical pictures much bigger.
Parameters On
....................................................................................................
Private Members The Private Members menu controls whether declaration views
Menu show private members of the entity.
....................................................................................................
Protected Members The Protected Members menu controls whether declaration views
Menu show protected members of the entity.
....................................................................................................
Public Members The Public Members menu controls whether declaration views
Menu show public members of the entity.
....................................................................................................
Renames Menu The Renames menu controls whether declarations that are
renames are shown in Declaration views. The default is to show
rename declarations.
....................................................................................................
Routines Menu The Routines menu controls whether to show routines (procedures,
functions, ...) in Declaration views. The default is On.
....................................................................................................
Scale Menu The Scale menu allows you to choose the size of the text used. It is
available for both declaration and hierarchy views. All picture sizes
and layouts vary with text point size. The currently selected size is
indicated by a check mark.
....................................................................................................
Text Menu The Text menu sets the way entity names are trimmed or altered to
accommodate the layout of graphics. It is available for both
declaration and hierarchy views. Names may be truncated to a
certain length or wrapped at a certain length.
....................................................................................................
Unresolved Menu The Unresolved menu controls whether entities that have been
used but no declaration was found should be drawn. This option is
available on hierarchy and structure views. Unresolved functions
and entities are those used in the analyzed source without a
definition in the same source. Unresolved include files are those
included but not found along a declared include path (either a
compiler or project include path).
Unresolved entities are drawn as normal but with a dashed border:
....................................................................................................
Usedby Menu The Usedby menu tells Declaration views whether to show items
that use this item.
....................................................................................................
Uses Menu The Uses menu tells Uses views whether to show only items that
are used directly, or to also show items that are used by nested
subprograms. The default is to show both.
....................................................................................................
Variables Menu The Variables menu controls whether to show globals in
Declaration views. The default is On.
....................................................................................................
Withs Menu The Withs menu controls on Declaration views of compilation units
(packages, tasks, separate procedures, etc...) if Withs are drawn.
The default is On.
....................................................................................................
With Bys Menu Controls if With Bys (who Withs a given compilation unit) are shown
on Declaration views. The default is On.
To save a Visio file, click the Export to Visio File icon on the
graphical view toolbar.
If Visio is not open, Understand 2.0 opens it and begins creating
objects to match the ones in the graphical view. The process of
creating all the objects may take some time for a large graphical
view. A progress bar is shown in Understand 2.0 while the file is
being created. Avoid exiting Visio or attempting to stop the process
of creating the Visio diagram while it is in progress.
Once the view has been drawn in Visio, use Visio to save the file.
You can choose to print the image at one of the following sizes:
• Full size uses the default scaling of 100%. The dialog shows the
number of pages in width x height format. The page size
selected with Page Setup is used.
• Fit to a single page scales the image to fit on the selected page
size.
• Scale by lets you choose the sizing percentage and shows the
number of pages that will be printed.
Check the Save to PDF file box if you want the image saved to an
Adobe Acrobat file rather than being sent to a printer. This PDF
printing feature does not require that you have third-party PDF
generating software installed on your computer.
Check the Print page number identifiers box if you
want page numbers on each page in the upper-left
corner. The page numbers are in “(column, row)” format.
For example, (1,3) indicates that the page goes in the
leftmost (first) column of the third row when you piece
the pages together. The page number is not printed if the view is
printed on a single page.
Check the Print page border markers box to place corner markers
in each corner of each page.
Click the Printer button to open the standard Print dialog for your
operating system. When you click Print or OK in that dialog, you
return to the Graphic Print Options dialog.
Click the Page Setup button to open a Page Setup dialog, which
allows you to choose the paper size, paper source (if applicable),
page orientation, and margin width. Click OK to return to the
Graphic Print Options dialog.
Click the OK button in the Graphic Print Options dialog to send the
graphical view to the printer (or a PDF file).
Note: The File->Page Setup menu option applies only to printing source
code and other text files. The Page Setup button on the Graphic
Print Options dialog saves its settings separately.
Section Page
Configuring Reports 10–2
Generating Reports 10–4
Viewing Reports 10–5
An Overview of Report Categories 10–6
Cross-Reference Reports 10–8
Structure Reports 10–14
Quality Reports 10–18
Metrics Reports 10–23
Configuring Reports
Understand 2.0 provides a large number of reports you can
generate about your code. These can be generated in HTML or text
format. You can choose which reports and how to format them.
To begin generating reports, choose Project->Project Reports.
Generating Reports
Once you have specified formatting options and the types of reports
to be generated, click Generate in the Project Reports dialog to
begin generating the selected reports.
On Windows, the ASCII text follows the DOS text file format
(carriage return and line feed at the end of each line). On UNIX, text
files are created according to the UNIX convention (lines end with a
carriage return).
HTML reports are generated as HTML 3.0 format files. The
generated HTML is not complex, the only HTML 3.0 (versus HTML
2.0) feature used is frames. Netscape 2.0 and higher, and Internet
Explorer 3.0 and higher can display the files.
You can view the reports as described in Viewing Reports on
page 10–5.
For large projects, reports can take a long time to generate. You can
click Cancel to halt report generation. Clicking Cancel leaves the
reports in a partially generated state.
Note: You may want to temporarily toggle off anti-virus protection
programs while reports are being generated. This may speed the
process of creating reports. If you do this, be sure to turn on virus
checking after report generation is finished.
Note: HTML, text, and project metrics reports may also be generated with
the “und” command line program. Refer to Chapter 13 for details.
Viewing Reports
To view generated reports, choose Project->Reports. Then click
the View HTML or View Text button.
File names of reports generated vary based on the type and format
of the report generated.
• For text files, a single text file containing all selected reports may
be generated or separate files for each type of report may be
generated. A single text file is named <project_name>.txt. For
separate text files, the file name is the type of report.
• For HTML reports, you can generate either a single HTML files
for each report type, or smaller files divided either alphabetically
by entity name or in groups of N number of entities. An index file
is also generated that contains links to all the other HTML reports
generated. The main window page is named [Link].
For HTML reports, a single index file contains an alphabetic list of all
entities found in all other generated HTML reports. The entities
listed in the index have hyperlinks to the Data Dictionary report for
that entity. The entity index file is named entity_index.html and can
be accessed from the “index” link on the main HTML page.
The following figure shows an example of the entity index.
Cross-Reference Reports
Cross-Reference reports show information similar to that in the
References section of the Info Browser, except that all entities are
shown together in alphabetic order. The following table shows the
page that describes each type of cross-reference report.
Report Name
Data Dictionary Report on page 10–8
Program Unit Cross-Reference Report on page 10–9
File Contents Report on page 10–10
Object Cross-Reference Report on page 10–10
Type Cross-Reference Report on page 10–11
Class and Interface Cross-Reference on page 10–11
Macro Cross-Reference on page 10–12
Include File Cross-Reference on page 10–12
Exception Cross-Reference Report on page 10–13
....................................................................................................
Data Dictionary The Data Dictionary Report lists all entities alphabetically. Each
Report listing shows the entity name, what kind of entity it is (for example,
Name and
entity type
You can create an additional Program Unit Index report to list all the
program units in the project and show the file and line where each is
declared. For text reports, this is stored in a *.pcn file.
....................................................................................................
File Contents Report Lists functions declared within a source file and the line numbers
where they are declared. HTML versions of this report permit
hyperlinked jumping to the function in the source as well as viewing
of the entire source file.
....................................................................................................
Object Cross- The Object Cross-Reference Report lists all objects (FORTRAN
Reference Report variables, parameters, macros) in alphabetic order along with
declaration and usage references.
....................................................................................................
Type Cross- The Type Cross-Reference Report lists all declared types in
Reference Report alphabetic order, along with their declaration and usage information.
The HTML version of the report offers hyperlinks to the Types data
dictionary report entry, as well as the source code where the
reference occurs.
....................................................................................................
Class and Interface The Class and Interface Cross-Reference Report lists all declared
Cross-Reference classes and interfaces in alphabetic order, along with their
declaration and usage information. The HTML version of the report
includes hyperlinks to the data dictionary report entries, as well as
the source code where the reference occurs.
....................................................................................................
Macro Cross- The Macro Cross-Reference Report lists all macros analyzed in the
Reference source code in alphabetic order along with information about where
they are declared and where they are used. The HTML version
offers hyperlinks to the macro’s Data Dictionary report entry and to
the source code where each reference occurs.
....................................................................................................
Include File Cross- The Include File Cross-Reference Report lists all include files
Reference analyzed in the source code in alphabetic order with information
about which files include them. The HTML version offers hyperlinks
to the source code where each reference occurs.
....................................................................................................
Exception Cross- The Exception Cross-Reference Report documents the declaration
Reference Report and usage of all exceptions. Each declaration and any raises or
handles are documented. In the HTML version each raise or handle
may be visited in the source, as well as the declaration point of the
Exception (if visible).
Structure Reports
Structure reports are designed to help you understand the
relationships between various entities. The following table shows
the page in this chapter that describes each type of structure report.
Report Name and Page
Declaration Tree on page 10–14
Class Extend Tree on page 10–15
Invocation Tree Report on page 10–16
Simple Invocation Tree Report on page 10–16
With Tree Report on page 10–16
Simple With Tree Report on page 10–17
Generic Instantiation Report on page 10–17
Renames Report on page 10–17
Import Report on page 10–17
....................................................................................................
Declaration Tree The Declaration Tree shows the declaration nesting of each
program unit analyzed. Each nesting level is indicated by an indent
with a vertical bar used to help align your eyes when viewing. Each
nesting level is read as “declares”. In the HTML version of the report
each program unit name is a hyperlink to its entry in the Program
Unit Cross-Reference Report.
Package Body Occupants
| Procedure Put_View
| Procedure Look
| Procedure Get
| Function May_I_Get
| Procedure Drop
| Function May_I_Drop
| Procedure Inventory
| Procedure Go
| | Block
In the above example, Package Body Occupants is the top level
program unit. It has declared within it, Put_View, Look, Get,
May_I_Get, Drop, May_I_Drop, Inventory, and Go. Nested within
Go is an unnamed declare block.
Subroutines/blocks
declared in file allocate.f
....................................................................................................
Class Extend Tree The Class Extend Tree report shows the nesting of class
declarations in the files analyzed. Each nesting level is indicated by
an indent with a vertical bar to help align your eyes when viewing.
Each nesting level is read as “extends”. In the HTML version of the
report each class name is a hyperlink to its entry in the Data
Dictionary and Interface Cross-Reference Report.
....................................................................................................
Invocation Tree The Invocation Tree Report shows a textual representation of the
Report invocation tree for each program unit analyzed. The report shows
who each program unit calls. Levels are indicated by tabs and are
lined up with vertical bars. Each nesting level is read as “calls”.
The HTML version offers hyperlinks to the corresponding Data
Dictionary report entries.
....................................................................................................
Simple Invocation The Simple Invocation Tree Report shows the invocation tree to only
Tree Report one level for each program unit that has been analyzed.
The invocation level is indicated by an indent and a vertical bar and
is read as “calls”.
....................................................................................................
With Tree Report Structured identically to the other hierarchy reports, the With Tree
report shows a textual representation of the With Tree for each
program unit that is not Withed by another.
As with the other textual hierarchy reports, indents show level with a
vertical bar helping align your eye. For this report, each line is read
as “Withs”.
Package Body Occupants
| Package Rename Text_IO
| | Package Text_IO
| | | Package IO_Exceptions
| | | Package System
| | | Package Parameters
Quality Reports
Understand 2.0’s quality reports are designed to provide information
about areas of the analyzed source that might not meet standards or
that hold the potential for trouble. They also identify areas where
extra programming has been done but not needed. This sometimes
identifies areas that aren’t yet complete, or that haven’t been
maintained completely.
The following table shows the page in this chapter that describes
each type of quality report.
Report Name and Page
Program Unit Complexity Report on page 10–18
FORTRAN Extension Usage Report on page 10–19
Implicitly Declared Objects Report on page 10–20
Uninitialized Items on page 10–20
Unused Variables and Parameters on page 10–21
Unused Objects Report on page 10–21
Unused Types Report on page 10–21
Unused Program Units Report on page 10–22
Withs Not Needed Report on page 10–22
Click column
header for
explanation
of each metric
....................................................................................................
FORTRAN Extension This report lists anywhere your source code has non-standard
Usage Report FORTRAN extensions. The report factors in what variant (F77, F90,
F95) you chose on your project configuration.
For information about what FORTRAN language extensions are
included in this report, see the Change Log on the Scientific
Toolworks website ([Link]
....................................................................................................
Implicitly Declared The Implicitly Declared Objects Report lists any variables or
Objects Report parameters that were implicitly declared using FORTRAN’s implicit
declaration mode. Using implicitly declared variables is considered a
risky practice, and this report helps you weed out where the practice
is occurring in your code.
The HTML version offers hyperlinks to the function’s Data Dictionary
report entry.
....................................................................................................
Uninitialized Items The Uninitialized Items report lists items such as variables that are
not initialized in the code. The report is organized by file. Each
uninitialized item within the file is listed by name along with the line
number on which the item is declared. The HTML version offers
hyperlinks to the location where the item is declared.
....................................................................................................
Unused Variables The Unused Variables and Parameters report lists items that are
and Parameters declared (and perhaps initialized) but never referenced other than
that. The report is organized by file. Each unused item is listed by
name along with the type of item and the line number on which the
item is declared. The function or similar container is shown after the
list of unused items within it. Types of items may include functions,
parameters, variables, and objects. The HTML version offers
hyperlinks to the location where each unused item is declared.
....................................................................................................
Unused Objects The Unused Objects Report lists objects (for example, variables,
Report parameters, constants) that are declared but never used. The HTML
version has links to the function’s Data Dictionary report entry and to
the source line where the object is declared.
....................................................................................................
Unused Types Report The Unused Types Report lists types that are declared but never
used. The HTML version has links to the function’s Data Dictionary
report entry and the source where the type is declared.
....................................................................................................
Unused Program The Unused Program Units Report identifies program units that are
Units Report declared but never used.
Note that this listing in this report doesn’t mean the system doesn’t
need this program unit. For instance, interrupt handlers that are
called by system interrupts are often never “used” within the other
source of the program.
....................................................................................................
Withs Not Needed This report lists, any With statements a program unit has but does
Report not need (by not using items made public by the With statement).
Note that this covers only direct usage in the program unit and
doesn’t account for side effects that may be needed by the program
to operate correctly. For instance, sometimes a package can be
Withed just to start a task or to execute code in its begin/end block.
Metrics Reports
Metrics provide statistical information about your project and
entities, such as the number of lines of code and the complexity of
various entities.
Understand 2.0 provides a number of ways to gather metrics
information. This section describes reports that provide metrics. See
page 11–2 for other ways to gather metrics.
The following table shows the page in this chapter that describes
each type of metrics report.
Report Name and Page
Project Metrics Report on page 10–24
Class Metrics Report on page 10–24
Class OO Metrics Report on page 10–25
Program Unit Metrics Report on page 10–25
File Metrics Report on page 10–26
File Average Metrics Report on page 10–27
....................................................................................................
Project Metrics The Project Metrics Report provides metric information about the
Report entire project. The metrics reported include: the total number of files,
the total number of program units, and the total number of lines of
source code.
These metrics are also reported on the title page of the HTML
report.
....................................................................................................
Class Metrics Report The Class Metrics Report provides the following metrics for each
class that has been analyzed:
• Total number of lines
• Total number of blank lines
• Total number of lines of code
• Total number of lines that contain comments
• Average number of lines per class
• Average number of comment lines per class
• Average complexity per class
• Maximum complexity within class
• Ratio of comment lines to code lines
....................................................................................................
Class OO Metrics The Class OO Metrics Report provides the following object-oriented
Report metrics for each class that has been analyzed:
• LCOM (Percent Lack of Cohesion): 100% minus the average
cohesion for class data members. A method is cohesive when it
performs a single task.
• DIT (Max Inheritance Tree): Maximum depth of the class in the
inheritance tree.
• IFANIN (Count of Base Classes): Number of immediate base
classes.
• CBO (Count of Coupled Classes): Number of other classes
coupled to this class.
• NOC (Count of Derived Classes): Number of immediate
subclasses this class has.
• RFC (Count of All Methods): Number of methods this class
has, including inherited methods.
• NIM (Count of Instance Methods): Number of instance
methods this class has.
• NIV (Count of Instance Variables): Number of instance
variables this class has.
• WMC (Count of Methods): Number of local methods this class
has.
....................................................................................................
Program Unit Metrics The Program Unit Metrics Report provides information on various
Report metrics for each program unit that has been analyzed.
....................................................................................................
File Average Metrics The File Average Metrics Report provides averages for the functions
Report within a file. All lines outside any function are ignored when
calculating the averages. The following metrics are provided for
each function:
• Cyclomatic: The average number of independent paths through
the functions in this file. The higher this metric the more likely a
program unit is to be difficult to test and maintain without error.
• Modified: Same as Cyclomatic complexity except that each
case statement is not counted; the entire switch statement
counts as 1.
• Strict: Same as Cyclomatic complexity except that && and ||
also count as 1.
• Essential: Measures the amount of unstructured code in a
function.
• Lines: Average number of lines in the functions in this file.
• Code: Average number of lines that contain any code in the
functions in this file.
• Comment: Average number of comment lines in the functions in
this file.
• Blank: Average number of blank lines in the functions in this file.
Section Page
About Metrics 11–2
Project Metrics Summary 11–3
Project Metrics Browser 11–4
Exporting Metrics to HTML 11–5
Exporting Metrics to a CSV File 11–6
Browsing Metric Graphs 11–8
About Metrics
Understand 2.0 provides a number of ways to gather metrics
information:
• Info Browser: The Info Browser tree has a Metrics node. You
can expand this branch to show a few metrics for the current
entity. See page 4–12.
• Project Metrics Summary: You can choose Metrics->Project
Metrics Summary from the menus to see a short list of metrics
for the entire project. You can view these for any snapshot. See
page 11–3.
• Project Metrics Browser: You can choose Metrics->Browse
Project Metrics from the menus to see a browser that lets you
choose any architecture node, file, or entity from any snapshot to
see all the metrics available for that item. See page 11–4.
• Export to HTML: You can click this button in the Project Metrics
Browser to export the full list of metrics for all architecture nodes
and files. See page 11–5.
• Export to CSV: You can choose Metrics->Export Project
Metrics from the menus to create a text file of all the project
metrics in comma-delimited format. See page 11–6. (You can
schedule this export to occur regularly; see page 3–19.)
• Browse Metric Graphs: You can choose Metrics->Browse
Metric Graphs from the menus to open the Metric Browser,
which lets you display graphs of various metrics on an
architecture and snapshot basis. See page 11–8.
• Reports: When you create reports by choosing Project->Project
Reports, some of the reports provide metrics. See page 10–23.
• PERL/C API: A more advanced way to get existing metrics and
calculate new metrics is with the PERL and C API. These
provide full access to the Understand 2.0 database. Choose
Help->PERL API Documentation and Help->FAQ for more
information. Examples and more documentation can be found at
[Link] See page 10–7.
If you have the “Analyst” edition, all metrics capabilities are
available. If you have the “Pro” edition, you can view metric graphs
only for the entire project—not for architecture nodes, files, and
individual entities—and cannot export metrics to HTML. If you have
the “Engineer” edition, you also cannot use the Project Metrics
Browser and cannot export metrics to a CSV file.
The Snapshots drop-down near the top lets you select a snapshot
for which to view metrics. The default is the current project files.
Double-click a file or entity to open the Source Editor for that item.
Right-click to see the standard informational menu choices.
You can select rows on the right and click Copy Selected or press
Ctrl+C to copy those lines to the clipboard. Click Copy All to copy
the full list of metrics for the selected directory or file.
Click Export to HTML to generate reports as described on
page 11–5. Click Generate Detailed Metrics to open the Export
Metrics dialog and generate a text file in comma-delimited format as
described on page 11–6.
Selecting entities in the architecture tree and the Export to HTML
button are available on if you have the “Analyst” edition. If you have
the “Pro” edition, you can select architecture nodes and files only.
The HTML-based report lets you select any architecture node or file
in the left pane. The right pane shows metrics available for that item.
• Save output to: Specify the location and name of the file you
want to use for metrics output. Understand 2.0 sends its metrics
output to a .csv (comma-separated values) file.
• Show File Entity Name as: Specify whether files should be
displayed with Short names (just the filename), Full names
(including the absolute path), or Relative names (relative
directory path).
• Show Declared in File: Check this box if you want the file in
which each entity is declared to be included in the output. You
can specify whether you want these files displayed with Short
names, Full names, or Relative names.
• Write Column Titles: Check this box if you want column
headings in the CSV file.
• Show Function Parameter Types: Check this box if you want
the type of each function parameter listed.
After setting options, click Export to export the .CSV file. If you
check the View File After Export box before exporting the file, the
CSV file is opened with the default application for working with CSV
files. This is likely to be a spreadsheet application.
If the output file already exists, you are asked if the files should be
overwritten. If you answer “No”, you can change the output filename
and click Export again.
You can schedule this metrics to be automatically exported to a
CSV file on a regular basis. See page 3–19 for details.
A complete and accurate list of the available metrics is available at:
[Link]
In a graph, you can choose the Graph View or the Table View. Both
views have a toolbar that lets you save the graph or data.
In the Graph View, you can use the toolbar to:
In the Table view, the numeric values for each pie slice or vertical
bar is shown in a table. You can use the toolbar to copy the data to
the clipboard in comma-separated (CSV), tab-separated, or table
format (spaces used so columns align with headings if a font such
as Courier is used).
If you selected multiple snapshots, tabs just below the toolbar let
you quickly switch from one snapshot to another.
If you are viewing data for several architecture nodes, you can
change the number in the lower-right corner to the number of
vertical bars you want to view on each page and click the checkmark
icon. Then use the arrows in the corners to move from page to page.
The text shows which vertical bars are currently shown out of the
total number. For example, the figure below indicates that bars 3
and 4 out of a total of 5 are currently shown.
Section Page
Using an External Editor 12–2
Configuring Tools 12–3
Adding Tools to the Right-Click Menus 12–10
Adding Tools to the Tools Menu 12–12
Adding Tools to the Toolbar 12–13
Importing and Exporting Tool Commands 12–14
Running External Commands 12–15
3 In the Editor field, click the folder icon and select the executable
file for the editor you want to use.
4 In the Parameters field, type the command line parameters you
want to use when opening the editor. Use the $File, $Line, and
$Col variables to allow Understand 2.0 to open source files to the
correct location.
For example, for the GVIM editor on UNIX, the Editor is “gvim”, and
the Parameters should be as follows (for GVIM 6.0 or later):
--servername UND --remote +$line $file
For the TextPad editor on Windows, the Editor is most likely
c:\Program Files\textpad4\[Link], and the Parameters should
be as follows:
$file($line,$col)
Configuring Tools
Select Tools->Configure User Tools from the menus to open the
Tool Configurations dialog, where you can configure external tools
such as source code editors for use within Understand 2.0. External
tools configured for use will be available for context-sensitive
launching. The Tool Configurations dialog provides a number of
categories that determine how they are launched.
First, use the User Tools category of the Tool Configurations dialog
to define a command and parameters as follows:
1 Click New.
2 In the Menu Text field, type the name you want to appear in
Understand 2.0 menus for this tool. You can use variables in the
Menu Text. For example, you can use $CurEntity to put the name
of the currently selected entity in the tool name. See Variables on
page 12–5 for a full list of variables.
3 If the tool you use is on your executable search path, simply type
its name in the Command field. If not, use the Browse button to
specify the full path to its executable.
4 In the Parameters field, specify parameters that need to be
passed on the tool’s command line. See Variables on page 12–5
for a full list of variables. Variables beginning with $Cur are
current position variables that apply only from a Source Editor
window. Variables beginning with $Decl are declaration variables
that apply only when an entity with a declaration is selected.
Variables beginning with $Prompt display a dialog to ask the
user for some information.
5 In the Initial Directory field, specify the directory in which the
tool should start running. You can use variables such as
$CurProjectDir in this field.
6 In the Icon file field, type or browse for a small graphic file to act
as the icon for this command. You can choose a BMP, GIF,
PBM, PGM, PNG, PPM, XBM, or XPM file.
7 Check the Capture output of command line tool box if you
want to send the output from the tool to a Command Window in
Understand 2.0.
This command window is reused by default if you run another
tool or re-run the same tool. You can force results to go to a new
window either by unchecking the Reuse box on the command
results window(s), or by holding down the CTRL key when
choosing the user tool you have added.
8 In the “Add to...” area, choose ways you want to access this
command in Understand 2.0. The Pop Up Menu checkbox adds
the tool to the right-click pop-up menu. The Main Menu
checkbox adds the tool to the Tools->User Tools submenu. The
Toolbar checkbox adds the tool’s icon to the toolbar.
9 Check the Understand perl script box if this is a Perl script that
uses the Understand Perl API.
To edit settings for an existing tool, select it in the list and make
changes as needed. Click OK to save your changes. If you want to
remove a tool, select it and click Delete.
For information about using the Import button, see Importing and
Exporting Tool Commands on page 12–14.
....................................................................................................
Variables Variables beginning with $Cur are current position variables that
apply only from a Source Editor window. Variables beginning with
$Decl are declaration variables that apply only when an entity with a
declaration is selected. Variables beginning with $Prompt display a
dialog to ask the user for some information.
You can use the following variables in the Command or the
Parameter field.
Variable Description
$CurCol Column position of cursor position in current file.
$CurEntity Full name of selected entity.
$CurEntityShortName Short name of selected entity.
$CurFile Current file's full path.
$CurFileDir Current file's directory.
$CurFileExt Current file's extension.
$CurFileFlatStr Current file's full path with all directory separation characters (such
as / and \) replaced with an underscore (_).
$CurFileName Current file's name not including extension or full path.
$CurFileShortName Current file's name without full path.
$CurLine Line number of cursor position in current file.
$CurProject Current fullname location of opened project.
$CurProjectDir Directory in which the opened project is located.
$CurProjectName Current short filename of opened project (not including extension).
$CurReportHtml Current fullname location of opened project's HTML report.
$CurReportText Current fullname location of opened project's CSV report.
$CurScopeEntity Scope of current entity.
$CurSelection Currently selected text in the current window (file windows only).
$CurWord The word/text at the current cursor position in the current file
window.
$DeclCol Column in which the selected entity was declared, defaults to 1.
$DeclFile Full path name of the file in which the selected entity was declared.
$DeclLine Line in which the selected entity was declared, defaults to 1.
Variable Description
$PromptForCheckBox Prompts user for a true/false value required by the command. A 0
(unchecked) or 1 (checked) is passed to the command in place of
this variable. This variable should be followed by a string to be
displayed as text next to the checkbox. For example,
$PromptForCheckBox "Show Debug Text" displays the
following prompt
$PromptForDir Prompts user to select a directory and passes the full path as a
string. For example, $PromptForDir "Directory
Path=$CurProjectDir" displays the following prompt with the
current project directory as the default. The “...” button opens the
standard directory selection dialog for your operating system:
Variable Description
$PromptForFile Prompts user to select a file and passes the full path as a string.
For example, $PromptForFile "Filename=$CurFile"
displays the following prompt with the current source file as the
default. The “...” button opens the standard file selection dialog for
your operating system:
Variable Description
$PromptForSelectEdit Prompts user to select from a drop-down box or edit the text in the
box. For example, $PromptForSelectEdit "Build
Version=Debug;Release;Optimized" displays the same
prompt as the example for $PromptForSelect, except that you can
edit the string in the box.
$PromptForText Prompts user for a string required by the command. For example,
$PromptForText "Replace=foo" displays the following
prompt and provides a default value. The text provided is passed
as a string.
To add a tool to the pop-up menus, select it on the right and click
Add. To remove a tool from the pop-up menus, select it on the left
and click Remove.
User tools appear on the right-click menu in the order they are listed
in the left column. Use the Move Up and Move Down buttons to
sort the tools as desired.
The following figure shows a right-click menu for an entity showing
the available external tools.
To add a tool to the menus, select it on the right and click Add. To
remove it from the menus, select it on the left and click Remove.
User tools appear on the Tools menu in the order they are listed in
the left column. Use the Move Up and Move Down buttons to sort
the tools as desired.
To add a tool to the toolbar, select it on the right and click Add. To
remove it from the toolbar, select it on the left and click Remove.
To add a vertical separator to the toolbar, select the item in the
Toolbar order box that should have a vertical line to the right of it.
Click Insert Separator to add “-----------” to the list.
Icons for the selected tools appear on the toolbar in the order they
are listed in the left column. Use the Move Up and Move Down
buttons to sort the icons as desired.
To change the icon for a particular tool, use the Icon file field in the
User Tools category.
For example, in the following figure, the first icon is provided by
Understand 2.0 to open the Tool Configurations dialog. The second
icon is the default icon for a user tool if none is specified.
In this toolbar, two icons have been added for user tools. A
separator has been added between them.
Note: You can control which icons are visible in the main toolbar by right-
clicking on the background of the toolbar and checking or
unchecking items for the various toolbar sections.
5 If you are running a Perl script, check the STI Perl script box if
this is a script provided by Scientific Toolworks.
6 Click Run. The output is shown in a Command Window in
Understand 2.0 if you checked the Capture Output box.
Otherwise, the command runs in the background and output is
shown in the Running Commands box. You can select a
command from this list and click Stop to halt the command.
Section Page
Using the und Command Line 13–2
Using the understand Command Line 13–11
The following command lists the available strings you can use after
the -list option.
und -db myproject -list
....................................................................................................
Creating a New There are several ways to create a new project file using “und”. Of
Project course you can use the graphical interface of Understand 2.0 to first
create your project, but here we will examine a few ways to do it
from the command line.
To create a new, empty, project called [Link]:
und -create -db myproject
This example creates a database called [Link].
....................................................................................................
Creating a Project You can create and add files to the database all in one command.
and Adding Sources For example:
in One Step und -db [Link] -create -addDir \usr\myfiles
....................................................................................................
Adding Files to a If you have a small number of source files then it may be easiest to
Project just supply their names to the analyzer using the wildcarding abilities
of your operating system shell. In this example we will process all
source files in the folder:
und -db [Link] -addDir \usr\myproject
In some cases, there may be too many file locations to use the -add
technique. A common command line limitation is 255 characters. A
directory with hundreds or thousands of files may easily exceed this
limit. In this case, or when you want more fine-grained/repeatable
control over what files are processed, you should create a “listfile”.
This file must have a format of one filename per line:
c:\myfiles\myproject\myproject.c
c:\myfiles\myproject\myproject.h
c:\myfiles\myproject\support.c
c:\myfiles\myproject\io.c
c:\myfiles\myproject\io.h
h:\shared\allprojects\file2.c
h:\options\file3.c
h:\options\file4.c
h:\options\file5.c
. . .
is processed via the -addFiles command line option:
und -db myproject -C++ -addFiles @[Link]
Note that there is no limit on the number of files listed in the list file.
....................................................................................................
Creating a List of On UNIX here are a couple ways to create such a file:
Files
• Use the ‘ls’ command, as in:
ls *.c *.h > my_project.lst
• Use the ‘find’ command to recurse subdirectories, as in:
find . -name “*.c *.h” -print > my_project.lst
In a Windows command shell:
• Use the dir command with the /b option:
dir /b *.c *.h > my_project.lst
• Use the /s option to recurse subdirectories, as in:
dir /b /s *c *.h > my_project.lst
....................................................................................................
Analyzing a Project The “und” command line program allows you to analyze (or re-
analyze) a previously created project database.
When analyzing a project, you have several options to choose from.
You may re-analyze all files with the -analyzeAll option, only those
files that have changed with the -analyze option, or a list of files with
the -analyzeFiles option.
If you are doing your first analysis after creating a new project, it
doesn’t matter which option you choose as it will parse all files
regardless. However, if you are performing this function on a regular
basis, you may prefer to do an incremental analysis where only the
modified files and any other files dependent on those files are re-
analyzed.
For example, you can parse all files in the project with the following
command:
und -db [Link] -analyzeAll
Or, to perform an incremental analysis, re-parsing only those files
that have changed or other dependent files, use the command:
und -db [Link] -analyze
This command checks each file previously parsed into the
repository to see if it has changed. If it has changed then it will re-
parse it, and any files that depend on it (and so on) until the
database is fully refreshed.
Use this feature to keep your database up to date while keeping
your parsing to a minimum.
....................................................................................................
Command Line The only required option for all commands using “und” is the -db
Options option to specify the project database file.
Command-lines for multi-language projects must also use an option
to specify which language you are configuring if you use a project
configuration options. For example: -C++, -Java, or -Pascal.
Where a command accepts a @[Link] for an option, the file must
contain one item per line. Full or relative paths may be used.
Relative paths are relative to the -cwd directory. A # sign in the first
column of a line in the file indicates a comment. If an item has a
definition, for example a macro definition, the macro name and its
value must be separated by an = sign. For example, DEBUG=true.
The following table lists the command line options (also called
command-line switches) for “und”:
Option Description
-db filename Specify the name of the database to create or open. An
extension of .udb is provided if no extension is given.
You can use a filename in the current directory or a full
path to the file. This option is required for most actions.
-Ada Sets the language that this configuration applies to.
-Assembly Required for configuration actions on multi-language
-C++ projects when you set items that apply to multiple
-C# languages, such as -include.
-Fortran
-Java
-Jovial
-Pascal
-Plm
-addDir directory Add the specified directory as a source file directory to
the project. When adding directories, you can also use
the following -addDir* options.
-addDirExcludes wildcard1 Add the specified paths or wildcard patterns to the list
wildcard2... of files to be excluded from the project.
-addDirFilters wildcard1 wildcard2... Use the specified filetype filters to match source files in
the directories specified by -addDir.
-addDirLangTypes lang1 lang2... Add only files that match the filetypes for the specified
languages.
Option Description
-addDirSubdirs [On/Off] Specify On if you want subdirectories of the directory
specified with -addDir to also be added.
-addDirWatch [On/Off] Specify On if you want the added directory to be a
watched directory.
-addFiles file1 file2 ... Add the listed files to the project. Filenames can be
or -addFiles @[Link] relative to -cwd or can use a full path.
-analyze Analyze (parse) any changed files in the project.
-analyzeAll Analyze all files in the project.
-analyzeFiles file1 file2... Analyze the specified list of files.
or -analyzeFiles @[Link]
-arch <name> Specify the name of an existing architecture for use
with other options.
-archDelete Delete the architecture specified with the -arch option.
-archRename newname Rename the architecture specified with the -arch
option.
-archExport [Link] Export XML for the architecture specified with the -arch
option.
-archImport [Link] Import XML for an architecture from the specified file.
-assembler name Set the configured name of the assembly language
assembler.
-changeReportDir path Sets the directory to which the change report should be
written.
-classpath file1 file2... Append to the current Java classpath list. Set to “none”
or -classpath @[Link] to clear the list. The filename may be a class path or a
jar file.
-compiler_includepath [path | “none”] Set the include path for the compiler for C++.
-compiler_name name Set the configured compiler for the specified language.
-compiler_version version Set the configured version of the compiler.
-create Create a new project with the given -db filename. If the
.udb file exists, it will be replaced with new empty
project. Use -languages to set the source code
language(s) for the new project.
Option Description
-cwd directory Set the current working directory for other relative
filenames, such as those provided with -db and
-report_htmldir.
-define macro1=def1 macro2=def2... Defines macros that may be used with #ifdef and
or -define @[Link] similar preprocessor directives.
-fileType ext1=lang ext2=lang... Add a file extension and specify the language it should
be treated as.
-fileTypeDel ext1 ext2... Delete the specified file extensions associations.
-help option Provide information about an option.
-include includedir1 includedir2... Add the specified directories to the list of include
or @[Link] directories.
-include_addfound [On/Off] Set to On if you want include files found when
analyzing a project to be automatically added to the
source file list.
-include_addfoundsys [On/Off] Set to On if you want system include files found when
analyzing a project to be automatically added to the
source file list.
-include_case [On/Off] Set to On if you want to use case-insensitive searching
for include files.
-include_search [On/Off] Set to On if you want to search for include files among
project files.
-include_treatsys [On/Off] Set to On if you want to treat system include files as
user include files.
-languages lang1 lang2... Specify the source code languages used by the
project.
-list option List the available settings for the specified command-
line option.
-list_tersemode [On/Off] Turns a shorter list from the -list option on or off.
-listarch List all the architecture names in the project.
-listfiles List all the files in the project database.
-listfilestree List all the files in the project database in tree format
showing watched states.
Option Description
-metrics [outputfile] Generate list of currently selected metrics. If an
outputfile is optionally specified, send the output to that
file.
-metrics_sel metric1 metric2... Add the specified metrics to the list to generate. To
or -metrics [all/none] clear the list, use none. Use -list metrics_sel to get a
list of metric names.
-metrics_DeclFilename Specify whether “declared in” filenames should be
[none/short/relative/full] shown as short, relative, full, or not at all (none).
-metrics_Filename [short/relative/full] Specify whether filenames should be shown as short,
relative, full, or not at all (none).
-metrics_Parameters [On/Off] Set to On if you want function parameter types shown
in metrics output.
-metrics_Titles [On/Off] Set to On if you want column headings in metrics
output.
-odefine macro1=def1 [...] Append to the current override macro list for the
or -odefine @[Link] specified file or directory. Must also use the -override
option. Set to “none” to clear the list.
-oinclude includedir [...] Append to the current override include list for the
or -oinclude @[Link] specified file or directory. Must also use the -override
option. Set to “none” to clear the list.
-option_Cache [On/Off] Set the C++ option to toggle the include cache.
-option_RefMacroExpand [On/Off] Set the C++ option to create references to macros
during macro expansion.
-option_Save_Comments [On/Off] Set the option to save comments associated with
entities.
-override file/directory Modify the override settings for the specified file or
directory. This option is required with the -odefine and
-oinclude options.
-process [Link] Pass a file containing command-line options to und.
The most recent -db setting is use for commands in the
file.
-quiet [On/Off] Set to On if you want only errors that would cause a
failure to be reported to the display.
Option Description
-removeDir directory Remove the specified directory and its subdirectories
from the project. If a directory is watched, it is set to
exclude.
-removeFiles file1 file2 ... Remove the listed files to the project. Filenames can
or -removeFiles @[Link] be relative to -cwd or can use a full path. If the files are
watched files, they are set to excluded files.
-report html text Generate currently selected reports. If html or text is
optionally specified, generate only that type of output.
-report_sel report1 report2... Add the specified reports to the list to generate. To
or -report [all/none] clear the list, use none. Use -list report_sel to get a list
of report names.
-report_htmldir directory Specify a directory to contain HTML report output.
-report_htmlstyle Specify how HTML reports are to be split.
[single/alpha/split=N]
-report_htmltitle titlepage Specify the filename of an HTML page you want used
as the title page.
-report_Filename [short/full] Specify whether you want the reports to use short or
full filenames.
-report_time [On/Off] Set to On if you want the time the report was generated
to be placed on the report.
-report_textdir directory Specify a directory to contain text report output.
-report_textfile [Link] Specify a filename for the text report if you are using
the single file option.
-report_textstyle [single/separate] Choose whether you want text reports sent to a single
file or separate files.
-rescan Rescan all the watched directories for newly added or
removed source files.
-rootAdd name1=directory1 [...] Create or reset one or more named root directories. If
the root does not exist in the current project, it is
added. Otherwise, its mapping is reset to the new
directory. A valid name must begin with an uppercase
letter (A-Z) and be followed by at least one more
uppercase letter, numbers, “_”, or “$”. This is a
temporary setting that applies to the current command
only. If you use this option in a [Link] for the
-process option, it applies to multiple commands.
Option Description
-rootList List the defined named root directories.
-rootMode mode Set the current default mode for adding named roots.
-rootRemove name Remove the specified named root definition.
-rootReset name=directory Sets the directory for the specified named root to the
specified directory. If the root does not exist in the
current project, an error occurs. This is a temporary
setting that applies to the current command only.
-snapshot name Create a new snapshot with the specified name.
-snapshotComment "Comment" Associate the specified comment with the snapshot
specified by the -snapshot option.
-version Show the build number of “und” being run.
-vsFile filename Add the specified Visual Studio file to the project
configuration.
-vsFileConf configuration Specify the Visual Studio configuration to use for the
specified -vsFile.
-vsFileDel filename Remove the specified Visual Studio file from this
project.
Option Discussion
-contextmenu filename [-line # -col # -text #] Shows the context (right-click) menu for
the specified filename at the mouse
location. Optionally shows the context
menu for the entity located at -line -col
(The -text option provides a name hint for
the entity).
-cwd path Set the current working directory to "path".
This takes precedence over the last
working directory for a project loaded with -
db or -lastproject.
-db filename Open the project specified by the filename.
-existing Detects any running instance of
Understand 2.0 and send the command
line to that instance.
-lastproject Open the last project opened by the
application.
-lastproject_cwd Use the directory of the last opened project
as the current working directory.
-noproject Ignore all project load requests on startup.
(This also clears the "Open Last Project"
application setting.)
Option Discussion
-runAsLicenseLevel level# Specify the license level to use when
running Understand 2.0. Use a level# of 0
for Engineer, 1 for Pro, and 2 for Analyst.
You must be licensed to use the level you
specify.
-visit filename [line# column#] Open the file "filename" in an editor
window. Optionally position the cursor at
the specified line number and column
number in the specified file.
Section Page
File Menu 14–2
Edit Menu 14–2
Search Menu 14–3
Project Menu 14–3
Metrics Menu 14–4
Architect Menu 14–4
Change Menu 14–5
Tools Menu 14–5
Window Menu 14–6
Help Menu 14–7
File Menu
The File menu in Understand 2.0 contains the following commands:
Command See
New Project page 3–3
Open Project page 2–5
Convert 1.4 Project page 3–69
Close <project_name> page 2–5
New File page 6–11
Open File page 6–11
Export to Image File page 9–30
Save <filename> page 6–6
Save <filename> As page 6–6
Save All page 6–6
Page Setup page 6–14
Print page 6–14
Print Entity Graph page 9–32
Recent Files page 3–55
Recent Projects page 3–55
Exit page 3–21
Edit Menu
The Edit menu in Understand 2.0 contains the following commands:
Command See
Undo page 6–5
Redo page 6–5
Cut page 6–4
Copy page 6–4
Paste page 6–4
Search Menu
The Search menu in Understand 2.0 contains the following
commands:
Command See
Entity Filter page 4–5
Entity Locator page 5–3
Find in Files page 5–8
Show Find Results page 5–10
Replace in Files page 5–11
Find page 6–8
Incremental Find page 6–7
Show Favorites page 4–18
Contextual Information Sidebar page 6–9
Project Menu
The Project menu in Understand 2.0 contains the following
commands:
Command See
Configure Project page 3–8
Rescan Watched Project Directories page 3–15
Analyze Changed Files page 3–67
Analyze All Files page 3–67
Project Browser page 4–14
Project Assistant page 4–4
Project Reports page 10–2
Project Interactive Reports page 2–18
Project Graphical Views page 2–18
Project Overview Graphs page 9–2
Metrics Menu
The Metrics menu in Understand 2.0 contains the following
commands:
Architect Menu
The Architect menu in Understand 2.0 contains the following
commands:
Change Menu
The Change menu in Understand 2.0 contains the following
commands:
Tools Menu
The Tools menu in Understand 2.0 contains the following
commands:
Command See
Run a command page 12–15
User Tools page 12–12
Configure User Tools page 12–3
Record Macro page 6–11
Replay Macro page 6–11
TrackBack History Explorer page 8–36
External Editor Settings page 12–2
Master Scheduler List page 3–19
Scheduled Activities page 3–19
Options page 3–51
Window Menu
The Window menu in Understand 2.0 contains the following
commands:
Command See
Last Parse Log page 3–67
Change Dock Window Layout page 5–14
Close <current_file> page 6–6
Close All Document Windows page 5–14
Tile page 5–14
Cascade page 5–14
Split Vertically page 5–14
Split Horizontally page 5–14
<open window list> page 5–14
Editors page 5–14
Entity Graphs page 5–14
Information Browsers page 5–14
Navigator page 5–14
Selector page 5–14
Bookmarks page 6–12
Help Menu
The Help menu in Understand 2.0 contains the following
commands:
Command See
Help page 1–5
Getting Started page 2–5
Key Bindings page 3–57
Example Projects page 1–5
PERL API Documentation page 2–18
FAQ page 1–5
Run At Licensing Level page 1–3
Licensing page 1–3
View SciTools Blog page 1–5
About Understand page 1–5
adding as source files, C++, 3–34 copying information in, 4–8, 4–13
adding as source files, FORTRAN, 3–42 displaying from entity in Entity Filter, 4–8
adding as source files, PL/M, 3–50 displaying source of selected entity, 4–11
adding before each project file, C++, 3–35 entity information displayed by,
adding in bulk, C++, 3–35 choosing, 4–10
adding in bulk, FORTRAN, 3–42 expanding and collapsing the tree, 4–9
adding in bulk, PL/M, 3–50 for current entity, 6–9
adding to project, C++, 3–34 for current file, 6–9
adding to project, FORTRAN, 3–42 history for, 4–9, 4–13
adding to project, PL/M, 3–50 location of, 2–4
compiler path for, C++, 3–32 metrics in, 4–12, 11–2
displayed in graphical views, 9–22 multiple occurrences open, 4–11
environment variables in paths for, References in, 4–12
C++, 3–34 right-clicking in, 2–8
hierarchy of, for source files, 9–10, 9–12 saving information in, 4–8, 4–13
ignoring during analysis, C++, 3–36 searching, 4–10
overriding MSVC project settings for, 3–27 synchronizing, 4–11
replacement text for, C++, 3–36 Inherited By menu, graphical views, 9–22
replacement text for, FORTRAN, 3–42 Inherits menu, graphical views, 9–22
reports about, 10–12 initialization files, 2–6
system include files, C++, 3–35 Insert Spaces Instead of Tabs field, Editor
-include option, und command, 13–7 options, 3–62
Include View, 9–10, 9–12 instance methods, 10–25
-include_addfound option, und instance variables, 10–25
command, 13–7 Instantiated From View, 9–10
-include_addfoundsys option, und instantiation
command, 13–7 of compilation units, 9–10
-include_case option, und command, 13–7 of generic types, 9–10
-include_search option, und command, 13–7 of generic units, 9–10
-include_treatsys option, und reports about, 10–17
command, 13–7 Instantiations View, 9–10
IncludeBy View, 9–10 interactivity during background
Included By menu, graphical views, 9–22 processing, 3–53
Includes category interfaces
C++, 3–34 listing in Filter Area, 2–9
FORTRAN, 3–42 reports about, 10–11
PL/M, 3–50 interrupt handlers, listed as unused program
Includes menu, graphical views, 9–22 units, 10–22
Incremental Find option, Search menu, 6–7 intrinsic functions, parsing, FORTRAN, 3–41
Indent field, Editor options, 3–62 Intrinsic menu, graphical views, 9–22
Info Browser (IB), 2–9, 2–12, 4–8 Intrinsics file field, FORTRAN, 3–41
architecture information in, 7–3 Invocation Tree report, 10–16
macros members
adding in bulk, C++, 3–38 cohesion of, 10–25
changing, Ada, 3–31 default, 9–20
compiler-specific, C++, 3–32 displayed in graphical views, 9–25
defining in command line, 13–5 graphical views of, 9–14
defining on command line, Ada, 3–31 private, 9–26
defining, Ada, 3–30 protected, 9–26
defining, C++, 3–37 public, 9–26
of editing changes, recording and Members menu, graphical views, 9–25
replaying, 6–11 memory
expansion text for, C++, 3–34 caching include files, C++, 3–34
importing, Ada, 3–31 optimizing analysis to use less, Ada, 3–30
listing in Filter Area, 2–9 menu bar, 2–4
as octagons, in graphical views, 9–18 menus. See specific menus
overriding MSVC project settings for, 3–27 merging, in Entity Comparison area, 8–25
recording references when expanding, methods
C++, 3–33 cohesion of, 10–25
reports about, 10–10, 10–12 instance, 10–25
undefined, C++, 3–38 listing in Filter Area, 2–9
See also objects metrics about, 10–25
Macros category metrics, 7–5, 7–7
Ada, 3–30 calculating automatically, 3–20
C++, 3–37 configuring, 3–22
FORTRAN, 3–42 displayed in Info Browser, 4–12
Pascal, 3–48 exporting to CSV file, 3–20, 11–2, 11–6
Main subprograms field, Ada, 3–30 exporting to HTML, 3–21, 11–2, 11–5
maintain_uperl command, 2–4 for project, 11–3, 11–4
Make Snapshot option, Change menu, 3–20, graphs for, 11–8
8–3 in Info Browser, 11–2
Manage Architectures menu option, 7–5 list of, online, 10–18, 10–23, 11–3
Manage Architectures option, Architect reports about, 10–23, 10–24, 10–25, 10–26,
menu, 7–9 10–27, 11–2
Manage Snapshots option, Change selecting, 3–23
menu, 8–2, 8–10 Metrics category, Project Configuration
Margins field, Editor options, 3–63 dialog, 3–22
Master Scheduler List option, Tools Metrics Export, 7–5
menu, 3–21 Metrics Export menu option, 7–8
"Mastering Regular Expressions" Metrics menu, 14–4
(O’Reilly), 5–7 Browse Metric Graphs option, 11–2, 11–8
Max Inheritance Tree metric, 10–25 Browse Project Metrics option, 11–2, 11–4
McCabe (Cyclomatic) complexity, 10–18, Export Project Metrics option, 3–20, 11–2,
10–27 11–6
tabs in, controlling behavior of, 6–13 read-only access for, 3–18
toolbar for, 5–15 removing from project, 4–15
TrackBack revisions count in, 8–36 saving, 6–6
source files searching, 2–11, 4–15, 5–8, 6–7
adding to project, 3–6, 3–11, 4–15 Sources tab, Project Configuration
adding to project on command line, 13–3 dialog, 3–11
analyzing using projects. See project spaces, converting tabs to, 3–62
closing, 6–6 Spacing menu, graphical views, 9–27
creating, 6–11 special member functions, C++, 3–33
declaration structure for, 9–14, 9–16 splash screen, displaying at startup, 3–52
deleting from project, 3–14 split workspace, 5–14
directories for, adding to project, 3–12 toolbar for, 5–15
directories for, deleting from project, 3–14 Sql menu, graphical views, 9–27
displaying by double-clicking entity, 4–11 SQL, embedded, in Pascal, 3–47
displaying by right-clicking on square brackets. See brackets
entities, 4–11 [Link] file, 3–44
displaying from Find Results [Link] file, 3–44
window, 2–11, 5–10 Staff predefined architecture, 7–10
editing. See Source Editor Standard field, Ada, 3–29
encoding for, 3–18, 3–61 standard libraries
excluding from source list, 3–13 Ada, directory for, 3–29
external editor for, 12–2 displaying in parse log, 3–59
imported classes in, 9–16 Pascal, paths for, 3–49
imported, report about, 10–17 Standard Library Paths category,
include files specified as, C++, 3–34 Pascal, 3–49
include files specified as, FORTRAN, 3–42 Start menu, Understand commands in, 2–5
include files specified as, PL/M, 3–50 startup
include hierarchy for, 9–10, 9–12 Getting Started dialog displayed on, 3–52
line endings for, 3–61 Splash-Screen displayed on, 3–52
list of, generating from command static functions, displayed in graphical
line, 13–4 views, 9–27
listing in Filter Area, 2–9 Static menu, graphical views, 9–27
metrics about, 10–26 status bar, Source Editor, 6–3
moving between windows of, 2–13 status icon, in Source Editor, 6–3
opening, 6–11 status line, 2–4
opening from graphical view, 9–6 %STI_INIDIR% environment variable, 2–6
overriding settings for, 3–15 strict complexity, count and/or operators in,
as parallelograms, in graphical Ada, 3–29
views, 9–18 Strict metric, 10–27
portability of, 3–16 Structure Browser, Contextual Information
printing, 6–14, 9–32 Sidebar, 6–9
printing, configuration for, 3–64 structure reports, 10–14
Truncate Medium text option, 9–28 Understand 1.4, converting to 2.0, 3–69
Truncate Short text option, 9–28 understand command, 13–11
truncation at column Understand Options dialog, 3–51
FORTRAN, 3–41 Analyze category, 3–59
JOVIAL, 3–45 Command Window category, 3–59
Turbo Pascal, 3–47 Configure category, 3–59
Type Cross-Reference report, 10–11 Editor category, 3–61
Type Derived From View, 9–10 General category, 3–52
Type Tree View, 9–10 Key Bindings category, 3–57, 6–11
types Portability category, 3–60
displayed in graphical views, 9–28 TrackBack category, 3–58
as hexagons, in graphical views, 9–18 User Interface category, 3–54
information about, 9–14, 9–16 undocking windows, 2–2
listing in Filter Area, 2–9 Unicode file handling, in Entity Comparison
reports about, 10–11, 10–21 area, 8–25
types derived from, 9–10 Uninitialized Items report, 10–20
Types menu, graphical views, 9–28 UNIX
Typetext menu, graphical views, 9–28 line termination style, for reports, 10–4
line termination style, for saving source
U files, 3–62
.udb file extension, 2–3, 3–2 symbolic links used when adding
und command, 13–1, 13–2 files, 3–13
adding files to project, 13–3 unknown entities, displaying in graphical
analyzing a project, 13–4 views, 9–28
creating new project, 13–3 Unknown menu, graphical views, 9–28
options for, list of, 13–5 unresolved entities
options in latest version, listing, 13–2 displaying in graphical views, 9–29
UndDiff program, 8–32 Unresolved menu, graphical views, 9–29
undefined macros, C++, 3–38 unresolved variables, listed in Entity
Undefines category, C++ Macros, 3–38 Locator, 2–10
Understand Unused Object report, 10–21
compared to compiler, 3–2 Unused Program Unit report, 10–22
contact information, 1–4 Unused Type report, 10–21
editions of, 1–3 Unused Variables and Parameters
features of, 1–2 report, 10–21
licensing of, 1–3 Update Information Browser field, Browse
multiple users for, 2–6 Mode Editor options, 3–66
online help for, 1–5, 2–6 uperl command, 2–4
programming languages supported, 1–4 Use alternating row colors field, User
starting, 2–5 Interface options, 3–54
starting from command line, 13–11 Use case-insensitive lookup for includes field
windows in, 2–2, 2–4 C++ Includes, 3–35
V W
variables warnings, displaying from Parse Log
displayed in graphical views, 9–29 window, 3–68
instance, 10–25 watched directories
listed in Entity Locator, 2–10 scanning, 3–15, 3–20
metrics about, 10–25 setting, 3–13, 3–14
reports about, 10–10, 10–20, 10–21 websites
as rounded rectangles, in graphical Change Log, 10–19
views, 9–18 external editor information, 12–3
uninitialized, report about, 10–20 metrics, list of, 10–18, 10–23, 11–3
unresolved, 2–10 O’Reilly and Associates, 5–7
See also objects Perl interface, 11–2
Variables menu, graphical views, 9–29 SciTools forum, 10–7
.vcp file extension, 3–26 white file icon, 6–3
.vcw file extension, 3–26 whitespace
Version field in Entity Comparison area, 8–25
Ada, 3–28 indicators for, 3–63
FORTRAN, 3–40 Whitespace field, Editor options, 3–63
Java, 3–43 wild cards, in filters for Entity Locator, 5–6
JOVIAL, 3–45 %WINDIR% environment variable, 2–6
Pascal, 3–47 Window menu, 5–14, 14–6
-version option, und command, 13–10 Bookmarks option, 5–15
The Snapshot Manager allows users to compare entities and architecture nodes that are either dependent on or depended upon by selected items. This is facilitated by checking the options to search dependents or depended places, providing a comprehensive view of dependencies across selected architectures and entities .
Metrics like Cyclomatic complexity measure the number of linearly independent paths through a program, indicating its testability and maintainability. LCOM (Percent Lack of Cohesion) assesses the degree to which methods of a class are related, suggesting class design efficiency. Both metrics are crucial for identifying complex or poorly designed code sections that may require refactoring .
The 'Copy/Merge' feature allows users to replicate files and folders from one side of the comparison area to the other, overwriting any existing items with the same name. Users select the items to copy and confirm the operation, which is crucial for keeping files synchronized across environments .
Users can add source directories by typing the full directory path in the Directory field or using the Browse for Folder dialog. Configurable options include adding or deleting languages using the Configured Filters field and selecting file types. Additional filters can be specified to include or exclude files based on pattern matching .
These features allow users to toggle the visibility of dependencies and duplicate structures in declaration views. By controlling the display of elements like 'Dependent Of', users can focus on particular dependencies of files, while hiding duplicates simplifies complex hierarchy views, making code easier to understand .
The 'Watch this directory' option enables monitoring of changes such as file additions or deletions within the directory, which are then reflected in the project. By default, it also applies to all subdirectories within the watched directory .
The software allows users to compare texts pasted into a window representing before and after states. Users can visually assess differences and manually decide to merge or ignore changes, without saving the files. This capability supports flexible, trial-and-error editing processes and hypothetical evaluations of text alterations .
Cross-reference reports such as the Data Dictionary provide comprehensive lists and hyperlink references to entities and their declarations, facilitating in-depth analysis of program usage. Program Unit Cross-Reference reports aid in understanding the interactions and dependencies between various programming functions, thus supporting effective code maintenance and enhancement .
Users can customize colors for folder and file names by selecting a new color from the Colors menu and using a color picker. This customization helps in visually distinguishing different projects or highlighting specific items, aiding users in navigating and managing their directories more effectively .
Pattern-matching and regular expression strings in the Exclude filter field allow users to specify criteria for excluding files from snapshot comparison. For example, using '*.c' will exclude all C source files from the comparison process .