fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

The Reports Generated by fpt

fpt generates reports which describe the user's program. They may be used:

The reports are requested by commands which may be written on the operating system command-line, scripted in command (fsp) files or requested interactively at the FPT> prompt. They may be directed to the fpt listing (fpl) file by the LIST TO FILE command and to the screen by the LIST TO SCREEN command.

Metrics and Code Quality

Code quality from code attributes: SHOW METRICS

fpt reports the size, complexity and some aspects of the quality of the code analysed. The size is reported as the number of lines of declarations, exectable code and comments. The level of commenting is measured by counting the number of words in comments, and text comments are distinguished from blank lines and separators.

The proportion of non-local variable names used ambiguously, and the mean length of non-local names are reported as indicators of ease of maintenance and meaningfulness.

The cyclomatic complexity of each sub-program is reported.

Code quality from Counting Diagnostics: Q.A. ERROR WEIGHTING

fpt always reports a measure of code quality based on the number of warnings and errors generated as the code is processed. It is recommended that the user sets up a standard error checking script to make use of this report. Please see Checking for Errors for a description of the checks.

Program Units - Programs, Modules, Subroutines and Functions

Programs and their Components: SHOW PROGRAMS

fpt lists the programs present in the code, and for each, shows the sub-programs and files required to build it.

Shared Memory Between programs: SHOW SHARED MEMORY INTERFACES

Some Fortran environments support sharing of COMMON blocks between programs. The data flowing between the programs is reported.

Sub-programs and their Attributes: SHOW SUBPROGRAMS

The sub-programs (i.e. programs, modules, subroutines and functions) in the code are listed, The data types and attributes of functions and of all sub-program arguments are reported.

Memory Interfaces of Sub-Programs: SHOW SUBPROGRAM INTERFACES

The sub-programs are listed as described above, and in addition, all shared memory interfaces (for example through COMMON blocks) are reported.

The USE trees of Modules: SHOW MODULE TREE

The module USE tree is reported. fpt reports the USE tree below each top-level primary file.

The CALL Structure: SHOW CALL TREE, SHOW CALL STRUCTURE

The call tree below each main program is reported. The call structure listing also reports the calls made to, and the calls made by each program, subroutine and function.

Missing Routines: SHOW MISSING SUB-PROGRAMS

Missing subroutines and functions are listed.

File Organisation

Primary and Include Files: SHOW FILES

fpt lists the Fortran files which have been read. For each file it reports whether the file is a primary file or an include file, and shows the file name as it was read and the corresponding name which would be written.

The Include Tree: SHOW INCLUDE TREE

The include file tree is shown below each primary file.

Files which are Not Used: SHOW UNUSED FILES

The primary files and the sub-programs which are not required to build any of the main programs in the code are reported.

Fortran Logical Unit Numbers: SHOW LOGICAL UNITS

fpt reports the Fortran logical unit numbers used to open, close, read and write to files and other devices.

Symbols, Data Kinds and labels

The Symbol Table: SHOW SYMBOLS, SHOW SYMBOLS FILTERS

Reports the symbol table in alphabetical order, showing the scope and attributes of each symbol. Filters may be set to display sub-sets of the table.

Organisaton of COMMON Blocks: COMMON BLOCK LISTING

The variables in COMMON blocks are listed in address order, showing addresses, data types and other attributes.

Re-use of Variable: SHOW LIVES

The same variable may be used to hold two or more unrelated values as a program is run. The different values are termed "variable lives". fpt uses the life information to identify objects which are used before they are assigned, in some types of program optimisation and in analysing units and dimensions. This command reports the lives of each scalar variable.

Data Kinds used in the Code: SHOW KINDS

The data kinds used in the code are reported. For each kind, fpt lists the number of variables and the number of literal (i.e. constant) values declared or tagged to be of the kind, and the number which are inferred to be of the kind because of system defaults.

Clutter: SHOW UNUSED LABELS, CHECK FLOW

Statement labels which are not referenced elsewhere in the code are listed.

The flow check identifies unreachable, and therefore unused, code.

Conditional Compilation Control

CPP Macros: SHOW CPP MACROS

fpt processes CPP (C pre-processor) macros and stores them in its internal representation. The command SHOW CPP MACROS lists the macros used and shows the values encountered for each.

Conditional Compilation Control by DEC$ Constructs: SHOW DEC$ SYMBOLS

fpt Internal Resources and Settings

fpt Settings and Resources: SHOW SETTINGS SHOW RESOURCES

The command SHOW SETTINGS reports, and optionally saves, all of the settings which control formatting, systematic code modifications and error checking.

The command SHOW RESOURCES reports the internal resources used by fpt in processing the code.

The command SHOW FORMAT reports, and optionally saves to a specification (fpt) file, the current code formatting rules. The rules may be saved and applied to other codes.

Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.