QD Metrics User Manual
Version 1.01, 2004/05/27
QD Metrics (or just QDMet) is a program for quick-and-dirty metrics of C++ source code. It does not try to measure the code complexity or other non-trivial aspects just the size.
In addition to lines of code (whatever that means), QDI generates a number of other, similar metrics which may be of use in determining a project size. These metrics are discussed in detail in one of the next sections of this document.
The program runs only under Windows: an flavor from 95 to XP.
QDMet is a command-line program. You run it from the command-line interface, passing to the program a number of arguments and switches following a pattern like
qdmet name=value name=value /switch name=value /switch ...
where the order of named arguments and switches does not matter.
When executed like this, QDMet scans all source files following a given naming pattern in a given directory (possibly with subdirectories to any nesting depth), generates the metrics, and produces a tabular report to the screen, and in a test file named "qdmet.log" in the directory from which it was run.
The program does not modify any of your files; this means that it is not capable of doing any harm, regardless of the way you may use or misuse it.
Each argument is of a form "name=value" (important: no spaces around '=' !!!); an argument with a given name may appear at most once in the list.
qdmet /s root=../develop/bxlib files=*.cpp;*.h
qdmet root=c:\src\xproj /s
Note the forward slashes used in the root definition in the first example. Backslashes would be OK, too.
QDMet generates a log/report file named qdmet.log in the directory from which it was run (not the scanned root directory). Each line of the log contains a set of metrics for one unit or a subtotal for a given directory; the grand total is given at the end.
By "unit" we understand here any number of files in the same directory, with names differing only in extensions. For example, files "foo.cpp" and "foo.h" will be listed as one unit, "foo", unless they are in different directories.
Additionally, three derivatives of the above are listed (only in the log file, not in the screen output):
Actually, these four my say something on the coding style, and it is quite interesting to compare them between programmers.
QDMet is a text-only program it satisfies a relatively simple need, and I have more interesting things to do than spiffying a trivial application with GUI bells and whistles.
Still, you can view the graphic representation of the reports with use of my other freeware program, the Statmaster (check my Web site for a download).
The easiest way to integrate both programs is to place them in the same directory, together with the StatMaster setup file for QDMet reports, "qdmet.stm.ini" (included in this distribution). Run QDMet as usual, and then execute
statmaster qdmet.stm.ini qdmet.log
to view some distributions and scatter-plots of the generated metrics. Refer to the StatMaster documentation on how the setup can be modified to fit your needs and preferences.
QDMet is free to use for anyone except Osama bin Laden. Shareware and freeware vendors may include it in their collections as long as the whole original archive, including this document, is in the package.
Although the program is supplied on the "as is" basis, I will be glad to receive feedback: problem reports and enhancement suggestions. On the other hand, I am not planning to expand the program into advanced complexity metrics areas; there are commercial offerings (and quite expensive, too) which do that. Therefore keep your suggestions not too ambitious :)
1.00 2003/11/24 — Original public release.
1.01 2004/05/27 — Handles read-only files.
Legal stuff: Although the author has taken more than reasonable care to assure that the program works exactly as documented below and does not cause any damage, he assumes no responsibility, express or implied, for any results of use, misuse, or inability to use this software.
|Document last updated 2005/08/12|