RSM Operation
RSM operates from a shell command or as a Visual Studio Tool. You pass various arguments to RSM and file names via shell wild cards, a file list or recursive descent of a directory. The following is a summary of the RSM options and parameters. For complete detail on all the RSM options review the Reports and Options manual pages.
RSM Operation and Syntax is summarized in the help file. This file can be generated by specifying the -h option and rerouting the file to a file, rsm -H -hf > rsm_help.htm
Program Operation
Source files may be processed via wild cards, recursively down a file tree or from a specified list of files or directories. The evaluation copy of
this program will only process 10 files at one execution. Files are normally processed in the order they are discovered by the input mode. The option
-Rn will sort the input list alphabetically for sorted processing. The -F option processes a specific list of files or directories.
RSM operates through a series of switches and options. RSM processes files via several input modes and creates reports via several output modes.
This user manual details the input modes, output formats, modes and runtime
switches.
Modes of Operation:
Direct File name rsm Options /proj/src/filename.cpp
Wild Cards rsm Options /proj/src/*.cpp
Recursive descent of a directory tree rsm Options -r h,cpp /proj/src
Reading from a list of files or directories rsm Options -F /proj/filelist.lst
RSM emits it's output to standard out, which is normally to the screen or terminal, unless it is redirected to a file. This technology allows the user to capture various forms of file outputs. RSM can create CSV, HTML and Text output.
CSV Output -A rsm -A -To -TN *.h *.cpp > class_summary.csv rsm -A -O class_summary.csv -To -TN *.h *.cpp
HTML Output -H rsm -H -To -TN *.h *.cpp > class summary.htm rsm -H -O class summary.htm -To -TN *.h *.cpp
Text Output rsm -To -TN *.h *.cpp > class summary.txt rsm -O class summary.txt -To -TN *.h *.cpp
RSM can create reports via the following method. The default output method is to the screen or stdout. Users can redirect this output to a file as shown in the previous example or use the direct file method for creating report files.
Report output to the screen or stdout rsm -A -To -TN *.h *.cpp
Report output redirected to a file rsm -H -To -TN *.h *.cpp > class summary.htm
Report output routed directly to a file rsm -A -To -TN -O class_summary.csv *.h *.cpp
RSM is designed to operate according to the following process. Each step of the process is covered in detail in this manual.
Step 1: Determine the output format, -H -A or no switch for text.
"no option" ASCII UNIX Text Format
-A CSV format for spreadsheet import
-H HTML format with hyperlinks
Step 2: Determine the output file relative to the format.
-O report.htm -H
WWW Browser Report
-O report.csv -A
Spreadsheet Report
-O report.txt
Text Report
An option to using the -O option is the use of the shell redirection to a file. This is useful if a DOS text file is desired versus the RSM -O UNIX text format. rsm -s *.cpp > report.txt
Step 3: Specify the report type using the various report switches individually or by aggregation. -f -c -o Functions, Complexity, Objects -Es -Ec Extract strings and comments -hs Help Syntax
Step 4: Specify the file input mode using file names, wild cards,
file lists or recursive descent.
.\inc\anyfile.h
Ordinary file names.
*.h *.cpp
Wild cards, command line expansion
-F somefilelist.txt
File list of names and directories
-r h,c,cpp,java .
Recursive descent where . specifies
-r h,cpp,java /project the current working directory.
Step 5: Creating the RSM command line.
rsm anyfile.h anyfile.cpp
rsm -O analysis.txt -n c:\proj\*.h c:\proj\*.cpp
rsm -O metrics.txt -Ta -Tl -TN -F project1_list.txt
rsm -H -O metrics.htm -f -c -o -r h,cpp,java .
rsm -A -O metricsdiff.csv -wx baseline1.dat baseline2.dat
(Last Update:
June 12, 2001
)
Copyright 2001, M Squared Technologies