Using the STATSVN Statistics code

Source: Internet
Author: User

STATSVN Introduction

STATSVN is a Java-written open source code statistics program that is ported from Statcvs to get information from the Subversion repository and then generate various tables and graphs that describe the development of the project. For example: The line of code, the number of lines of code for each developer, the developer's level of activity, the number of files that the developer has recently submitted, the file size, average file sizes, maximum files, which files are the most frequently modified, the size of the directory, the repository tree with the number of files and the number of lines of code. The current version of STATSVN can generate a set of static HTML documents that include tables and graphs. statsvn Download

STARTSVN Official website address is: http://www.statsvn.org/index.html

STARTSVN download page is: http://www.statsvn.org/downloads.html can also download the attachment of this article

Now the latest version of the official web is: statsvn-0.7.0 statsvn Use

Notice of Use

STATSVN operation requires Java Runtime Environment support, so we need to install Java Runtime Environment (Java Runtime Environment). The JRE can be downloaded from the Sun's website.

STATSVN needs to use SVN's client in use, so you need to make sure that you have access to SVN's client commands on your machine

Checkout Working Copy

First, from the SVN repository checkout a need to count the path (if in the working directory, the first update, to ensure that the version in the workspace is the latest version, to ensure the accuracy of statistical results), such as I put a project under my path checkout on my Computer d:\ The myprojects path.

Generate SVN log file

Start with the command line into the working directory: D:\MyProjects, and then use the SVN log-v--xml > Logfile.log command, where Logfile.log is the name of the log file and can be defined as needed. This generates a file called Logfile.log in the directory of the working copy.

Note: 1. To use the SVN command at the command line, you must choose to install the commend component when installing TORTOISESVN, you can enter SVN help on the cmd command line to test whether the component is installed or not, if it is not installed, you cannot use the SVN log command. If you can operate SVN server, you can generate SVN log directly on the server and download it locally.

2. Compare two versions of the method is to add the-r 2034:2044 parameter to get log

call STATSVN for statistics

First we extract the Statsvn-0.7.0.zip package downloaded from the official website into the D:\statsvn-0.7.0 directory

Enter the D:\statsvn-0.7.0 directory from the command line

Call command Java-jar Statsvn.jar D:\MyProjects\logfile.log D:\MyProjects, the command to run successfully completed the statistical work.

The format of the command is Java-jar Statsvn.jar [options] <logfile> <checked-out-module>

Parameters <logfile>,<checked-out-module> for the SVN log file generated in the previous step is the checkout working Copy directory, note that all two parameters should list the correct full path, Otherwise, you will be prompted with errors such as Logfile.log not found   Java code   <logfile>           path to the svn logfile of the module   <directory >        path to the directory of the  checked out module  

       [options] as an optional parameter, the format and usage of this parameter are as follows: Java code   some options:  -version             print the version information  and exit  -output-dir <dir>          directory where HTML suite will be saved  -include < pattern>        include only files matching  pattern, e.g. **/*.c;**/*.h  -exclude <pattern>    exclude  matching files, e.g. tests/**;d ocs/**  -tags <regexp>         show matching tags in lines of code  chart, e.g. version-.*  -title <title>             Project title to be used in reports  -viewvc <url >         integrate with viewvc installation  at <url>  -trac <url>            integrate with Trac at <url>  -bugzilla <url>            integrate with Bugzilla  installation at <url>  -username <svnusername> username to  pass to svn  -password <svnpassword> password to pass  to svn  -verbose             print extra progress information  -xdoc                    optional switch output to xdoc  -xml                      optional switch output to xml  -threads <int>             how many threads for svn  diff  (default: 25)   -concurrency-threshold <millisec> switch to  concurrent svn diff if 1st call>threshol  -dump                dump the repository content  on console  -charset <charset>         specify the charset to use for html/xdoc  -tags-dir <directory >     optional, specifies the director for tags  (default  ' /tags/')    full options list: http://www.statsvn.org  

View Statistical Results

Once the above command runs successfully, you can see a set of static HTML documents in the D:\MyProjects directory that includes tables and graphs. The index.html can be opened in a browser to view statistical results.

Example Picture:

STATSVN Advantages and disadvantages Analysis

Advantages

STATSVN will present the state of the SVN library in the form of pictures and charts, can be divided into different categories to expand, powerful.

Disadvantages

STATSVN counts all lines of code, including comments and blank lines, but the general metric requirement is a valid line of code that you need to be aware of during analysis.

STATSVN does not consider the number of lines of code that are modified, only the number of lines of code that are new (+) and deleted (-) compared to the previous version.


Example:

1.D:\TEST>SVN log-r 2483:2543-v--xml D:\test > D:\test\svn.log
2.d:\test>java-jar Statsvn.jar D:\test\svn.log D:\test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.