Project

hotspots

0.01
Low commit activity in last 3 years
A long-lived project that still receives updates
Find all files that changed over the past days for a git repository. If a file is modified multiple times, it may require a re-design. Watch out for implementation changes without a corresponding test change.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.22.2
~> 13.1.0
~> 0.22.0

Runtime

~> 1.5.0
 Project Readme

Build Status Gem Version

Overview

This program helps in identifying files with maximum churn in a git repository. The more the number of changes made to a file, the more likelyhood of the file being a source of bugs. If the same file is modified many times for bug fixes, it indicates that the file needs some refactoring or redesign love.

Dependencies

This script depends on ruby. Obviously it also depends on git. Ruby and git executables should be in your execution path for the script to run.

Installation

gem install hotspots

Syntax

Usage: hotspots [options]

Specific options:
    -t, --time [TIME]                      Time in days to scan the repository for. Defaults to fifteen
    -r, --repository [PATH]                Path to the repository to scan. Defaults to current path
    -f, --file-filter [REGEX]              Regular expression to filtering file names. All files are allowed when not specified
    -m, --message-filter [PIPE SEPARATED]  Pipe separated values to filter files names against each commit message.
                                           All commit messages are allowed when not specified
    -c, --cutoff [CUTOFF]                  The minimum occurrence to consider for a file to appear in the list. Defaults to zero
        --log [LOG LEVEL]                  Log level (debug, info, warn, error, fatal)
    -v, --verbose                          Show verbose output
    -C, --colour, --color                  Show output in colours. The log level should be info or debug for colours
        --version                          Show version
    -h, --help                             Show this message

Examples

This will give you all file names that contain '.c' and have been modified at least once in the past 15 days in the git repository pointed to by the current path.

hotspots --file-filter "/.c"

Note that the dot "." is escaped as it is a regular expression matcher.

This will give you all file names that contain '.rb' and have been modified at least thrice in the past 5 days in git repository present in 'rails' directory.

hotspots --file-filter "/.rb" --path rails --cutoff 3 --time 5

Running tests

Clone the repository and run the following command from the repository.

gem install simplecov
rake

License

This tool is released under the MIT license. Please refer to LICENSE for more details.