Skip to content

SVN Log Parser

Category: Parser (takes in svn logs and outputs cc.json)

The SVN-Log-Parser generates visualisation data from repository SVN logs. It supports the following metrics per file:

MetricDescription
age_in_weeksThe file’s age measured in weeks since creation.
authorsThe authors that have worked on the file
number_of_authorsThe count of distinct authors who have contributed commits.
number_of_commitsThe total commits made to the file.
number_of_renamesHow many times the file has been renamed.
range_of_weeks_with_commitsThe span of weeks during which commits were made.
successive_weeks_with_commitsConsecutive weeks during which the file received commits.
weeks_with_commitsThe number of weeks in which the file was modified.
highly_coupled_filesFiles often modified together with this file (35% overlap or more).
median_coupled_filesThe median number of files modified in tandem with this file.

Additionally, the following Edge Metrics are calculated:

MetricDescription
temporal_couplingThe degree of temporal coupling between two files (>=35%)

The names of authors are saved when the --add-author flag is set.

ParameterDescription
FILEfile to parse
--add-authoradd an array of authors to every file
--silentsuppress command line output during process
-h, --helpdisplays help
-o, --output-file=<outputFile>output File (or empty for stdout)
-nc, --not-compressedsave uncompressed output file
Usage: ccsh svnlogparser [-h] [--add-author] [-nc] [--silent] [-o=<outputFile>]
FILE

The result is written as JSON to standard out or into an output file (if specified by -o option).

If a project is piped into the SVNLogParser, the results and the piped project are merged. The resulting project has the project name specified for the SVNLogParser.

Using SVN to create the repository log for metric generation

Section titled “Using SVN to create the repository log for metric generation”
SCMLog formatCommand for log creationtracks renamesignores deleted filessupports code churn
SVNSVN_LOGsvn log --verboseyesyesno

Executing this command generates the log file that can be used by the SVN-log parser. You can also use the bash script anongit which generates an anonymous git log with log format GIT_LOG_NUMSTAT_RAW for usage with CodeCharta.

Terminal window
# navigate to the project folder
- cd <my_svn_project>
# create svn log file
- svn log --verbose > svn.log
# create cc.json file
- ccsh svnlogparser svn.log -o output.cc.json