Operational Concepts

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 20 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

Modes of Operation

  • Visual Studio 6 Integration
  • Visual Studio .NET Integration
  • Eclipse
  • JBuilder Integration
  • Shell Mode using output, report and input options
    - Open a command shell
    - rsm   -O output options   Report Options   File Input 

    Shell Mode or from a script using shell redirection to an output file
    - Open a command shell
    - rsm   Options   Files   >   output

Methods of file processing :

  1. Direct File name
    rsm Options /proj/src/filename.cpp
  2. Wild Cards
    rsm Options /proj/src/*.cpp
  3. Recursive descent of a directory tree
    rsm Options -r"h,cpp /proj/src"
  4. Reading from a list of files or directories
    rsm Options -F"/proj/filelist.lst"
Modes of Output 

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, XML and Text output.

  1. CSV Output -A
    rsm -A -To -TN *.h *.cpp > class_summary.csv
    rsm -A -O"class_summary.csv" -To -TN *.h *.cpp
  2. HTML Output -H
    rsm -H -To -TN *.h *.cpp > class summary.htm
    rsm -H -O"class summary.htm" -To -TN *.h *.cpp
  3. Text Output 
    rsm -To -TN *.h *.cpp > class summary.txt
    rsm -O"class summary.txt" -To -TN *.h *.cpp
  4. XML Output 
    rsm -X -Td -TN *.h *.cpp > rsm_xml_total_file_detail.xml
    rsm -X -O"rsm_xml_total_file_detail.xml" -Td -TN *.h *.cpp

    XML Output with optional XSL translation  
    rsm -X -Td -TN *.h *.cpp > rsm_xml_total_file_detail.xml
    rsm -X -O"rsm_xml_total_file_detail_xsl.xml" -u"File XSL ./Td_example_output.xsl" -Td -TN *.h *.cpp

Methods of Output

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.

  1. Report output to the screen or stdout
    rsm -A -To -TN *.h *.cpp
  2. Report output redirected to a file
    rsm -H -To -TN *.h *.cpp > class summary.htm
  3. Report output routed directly to a file
    rsm -A -To -TN -O"class_summary.csv" *.h *.cpp

Operation Step by Step

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. -fa -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. Try the Windows wizard it create RSM command lines.
    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" -fa -c -o -r"h,cpp,java ." 
    rsm -A -O"metricsdiff.csv" -w"x baseline1.dat, baseline2.dat