FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


Metrics and Reports
 

 

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.

The available reports are:


 
Code Metrics:

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 an indicator of ease of maintenance and meaningfulness.

The cyclomatic complexity of each sub-program is reported.
 

Quality from Counting Errors
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:
SHOW PROGRAMS fpt lists the programs present in the code, and for each, shows the sub-programs and files required to build it.
 
SHOW SHARED MEMORY INTERFACES
 
Some Fortran environments support sharing of COMMON blocks between programs. The data flowing between the programs is reported.
 
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.
 
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.
 
SHOW MODULE TREE The module USE tree is reported. fpt reports the USE tree below each top-level primary file.
 
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.
 
SHOW MISSING SUB-PROGRAMS
 
Missing subroutines and functions are listed.
 

 
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.
 
SHOW INCLUDE TREE
 
The include file tree is shown below each primary file.
 
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.
 

 
Symbols, Data Kinds and labels:
SHOW SYMBOLS
SHOW SYMBOLS FILTERS
 
Reports the symbol table. Filters may be set to display sub-sets of the table.
 
COMMON BLOCK LISTING
 
The variables in COMMON blocks are listed in address order.
 
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 in analysing units and dimensions, and in some types of program optimisation. This command reports the lives of each scalar variable.
 
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.
 
SHOW UNUSED LABELS
 
Statement labels which are not referenced elsewhere in the code are listed.
 

 
Fortran Logical Unit Numbers:
SHOW LOGICAL UNITS Reports the Fortran logical unit numbers used to open, close, read and write to files and other devices.

 
CPP Macros:
SHOW CPP MACROS
 
Reports the CPP (C pre-processor) macros used in pre-processing the code. fpt lists the values taken by the macros as the code is processed.
 

 
fpt Settings and Resources:
SHOW FORMAT
 
Reports, and optionally saves to a specification script, the current code formatting rules. The rules may be saved and applied to other codes.
 
SHOW SETTINGS
 
Reports and optionally saves all of the settings which control formatting, systematic code modifications and error checking.
 
SHOW RESOURCES
 
Reports the internal resources used by fpt in processing the code.
 


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