This is the manual for StatCVS, a statistics tool for CVS repositories.
To run StatCVS, you need:
It takes three steps to create reports for a CVS module:
You can skip this step if you have already checked out a working copy. Typically, the command looks like this (assuming module to be the name of the module):
cvs -d /cvsroot checkout module
Change into the directory where you have checked out the module, and use the cvs log command to create a log file.
cd module cvs log > logfile.log
StatCVS is run using the command java -jar statcvs.jar. It takes two command line parameters:
java -jar statcvs.jar <logfile> <checked-out-module>
java -jar /path/to/statcvs.jar /path/to/module/logfile.log /path/to/module
This command creates the reports in the current directory. You can now point your browser to the file index.html, which is the table of contents of the report.
You can tweak the reports and change the behaviour of StatCVS in various ways using command line options.
java -jar statcvs.jar [options] <logfile> <checked-out-module>
A list of all options understood by StatCVS follows.
Specify an output directory. The reports will be generated in this directory. The directory will be created if it doesn't exist.
Specify filters to exclude files from the analysis. A file will be ignored if it doesn't match any of the patterns in include-pattern-list, or if it matches any pattern in exclude-pattern-list.
The patterns are lists of Apache Ant-style wildcard patterns, seperated by colons or semicolons. The wildcards are:
For example, src/**/*.java matches all java files in the src directory or its subdirectories. Note that *.java only matches java files in the root directory, because '*' does not match subdirectories.
One more example:
-include '**/*.c:**/*.h' -exclude 'legacy/**'
This matches all .c and .h files anywhere in the directory tree except those in the legacy directory and its subdirectories.
For more information on Ant's wildcard syntax, see the Patternset section of the Ant manual.
If not specified, all files will be included and no files will be excluded.
Note: Unix users must put the patterns in quotes, or the shell will interfere with the wildcards.
Includes information about CVS tags into the reports. Only tags matching the regular expression are included. To include all tags, add -tags '.*' to the command line.
Note: Unix users must put the expression in quotes, or the shell will interfere with the wildcards.
Excludes a CVS account name from all developer reports. This is useful to reduce noise from administrative and other non-developer accounts. Multiple accounts can be excluded by adding the option to the command line once for each account.
Specifies a display title to be used in the reports. The name of the CVS module will be used as default if no title is specified.
Specify a Cascading Style Sheet for the report. This can be a HTTP URL or a local file. A URL will simply be linked in every page of the report. A local file will be copied into the report directory.
The contents of the specified file will be included at the top of the report's index page. The file should contain a valid block-level HTML fragment, for example:
<p> These are development statistics for the <a href="http://statcvs.sf.net/">StatCVS</a> project, created by StatCVS itself. </p> <p> <strong>Note:</strong> This report was generated by an unreleased development version of StatCVS. It might contain features not yet found in the official release. </p>
Specify the URL of a ViewCVS installation for the module. This must be the URL of the page for the module's root directory. StatCVS will create links to ViewCVS for directories, files and revisions.
Specify the URL of a ViewVC installation for the module. This must be the URL of the page for the module's root directory. StatCVS will create links to ViewVC for directories, files and revisions.
Specify the URL of a cvsweb installation for the module. This must be the URL of the page for the module's root directory. StatCVS will create links to cvsweb for directories, files and revisions.
Specify the URL of a Chora installation for the module. This must be the URL of the page for the module's root directory. StatCVS will create links to Chora for directories, files and revisions.
Specify the URL of a JCVSWeb installation for the module. This must be the URL of the page for the module's root directory. StatCVS will create links to JCVSWeb for directories, files and revisions.
Specify the root URL of a Bugzilla installation. In commit messages, this will turn “Bug ####” into a link to the appropriate bug.
Specify the root URL of a Mantis bug tracker installation. In commit messages, this will turn “Bug ####” into a link to the appropriate bug.
Generate Maven XDoc instead of HTML. This allows Maven and Maven 2 to integrate the reports when it generates the projects Maven site. Reports could be placed, for example, into src/site/statcvs.
Output additional progress information.
Output lots of additional progress information.
Output the version of StatCVS.
StatCVS doesn't provide options to specify a start and end date for the report. But you can use some options of the cvs log command to achieve the same effect.
cvs log -d "2002-01-01<" > logfile.log
This will result in a logfile starting at January 1st, 2002.
If you want to specify an end date, then you also have to check out the module as of this date.
cvs checkout -D 2002-12-31 modulename cd modulename cvs log -d "<2002-12-31" > logfile.log
The example checks out a module and creates a log that ends December 31st, 2002.
You can combine both approaches. This example generates a log for a report of 2002:
cvs checkout -D 2002-12-31 modulename cd modulename cvs log -d "2002-01-01<2002-12-31" > logfile.log
More information on the log -d option can be found in the CVS manual.
StatCVS comes with an Ant task for the Apache Ant build tool.
An example build file:
<?xml version="1.0"?> <project name="Example" default="stats" basedir="."> <target name="stats"> <taskdef name="statcvs" classname="net.sf.statcvs.ant.StatCvsTask" classpath="dist/statcvs.jar"/> <statcvs log="cvs.log" path="." title="StatCVS" outputDir="stats" notes="etc/report-notes.txt" viewcvs="http://statcvs.cvs.sourceforge.net/statcvs/statcvs" tags="v.*"/> </target> </project>
The attributes log and path are required. The other attributes are optional, their names correspond to the command line options. The path to statcvs.jar has to be provided in the <taskdef/>'s classpath attribute.
This section lists some limitations and inaccuracies of StatCVS and its reports.
Deleted and moved files: Lines of Code counts will be inaccurate for deleted or moved files. When a file is deleted or moved, StatCVS can't track exactly how many lines it had and by whom they were committed.
Branches: StatCVS analyzes only the default branch of a repository. Anything on side branches will be ignored. Analyzing side branches is currently not possible.